如何使用C#将数据从表复制到剪贴板?

时间:2019-05-25 14:18:16

标签: c#

我有一个按钮单击事件,它在完成交易后将短信发送给客户。现在,我还想将数据从sms事件复制到剪贴板。下面是我的完整代码。

        private void btnSend_Click(object sender, EventArgs e)
    {
        GoogleAnalyticsTracker.TrackControlAccessed(POSEnumerators.GetEnumValue(POSEnumerators.ControlTypes.Buttons), POSEnumerators.GetEnumValue(POSEnumerators.EventTypes.Click), this.btnSend.ToolTip, this.Text);
        if (string.IsNullOrWhiteSpace(this.txtMobile.Text.TrimEnd(new char[0])))
        {
            POSUIUtil.ErrorMsgBox(POSUIUtil.GetLabel("PlsEnterMobileNumber"), POSEnumerators.ErrorType.Information, this);
            this.txtMobile.Focus();
            return;
        }
        if (!POSUIUtil.ValidatePhoneNo((!string.IsNullOrWhiteSpace(SecurityContext.CountryCode)) ? SecurityContext.CountryCode : "+1", this.txtMobile.Text))
        {
            this.txtMobile.ErrorText = POSUIUtil.GetLabel("PlsEnterValidMobileNumber");
            this.txtMobile.Focus();
            return;
        }
        this.txtMobile.ErrorText = string.Empty;
        if (!BL_APP.IsCreditSMSBalanceOver())
        {
            string applicationPreferences = ApplicationHelper.GetApplicationPreferences("SMS_GATEWAY_URL", null);
            if (!string.IsNullOrWhiteSpace(applicationPreferences))
            {
                this.splashScreenManager1.ShowWaitForm();
                this.splashScreenManager1.Properties.UseFadeInEffect = true;
                this.splashScreenManager1.SetWaitFormCaption(POSUIUtil.GetLabel("PleaseWait"));
                this.splashScreenManager1.SetWaitFormDescription(POSUIUtil.GetLabel("SendingSMS"));
                PrintingStructure.SendEODBySMS(this.txtMobile.Text, this.netReceivable, this.dueAmount, this.netPayable, this.netExpenses, this.cashInHand, this.eODDate);
                if (this.splashScreenManager1.IsSplashFormVisible)
                {
                    this.splashScreenManager1.CloseWaitForm();
                }
            }
            else
            {
                POSUIUtil.ErrorMsgBox(POSUIUtil.GetLabel("SMSConfigurationisnotdone"), POSEnumerators.ErrorType.Information, this);
            }
            base.Close();
            base.DialogResult = DialogResult.OK;
            return;
        }
        POSUIUtil.ErrorMsgBox(POSUIUtil.GetLabel("DonothaveSMSBalance"), POSEnumerators.ErrorType.Information, this);
    }
}

0 个答案:

没有答案