private void ReadCompanyAccount() { using (CompanyAccountServiceBF bf = new CompanyAccountServiceBF()) { this.companyAccount = bf.ICompanyAccount.ReadComapnyAccount(); } }
private void btnOk_Click(object sender, EventArgs e) { CompanyAccount companyAccount = new CompanyAccount() { CompanyID = this.txtAccount.Text, CompanyName = this.txtCompanyName.Text, CompanyPwd = this.txtPwd.Text, ServiceURL = this.txtUrl.Text }; if (companyAccount.CompanyID.Length == 0) { MessageBox.Show("请输入合法的企业账号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //检查账号密码是否正确,执行一次登录尝试 if (LoginChecker.getInstance().BindingCheck(companyAccount)) { using (CompanyAccountServiceBF bf = new CompanyAccountServiceBF()) { if (bf.ICompanyAccount.BindCompanyAccount(companyAccount) == "") { MessageBox.Show("账号绑定设置成功,请重启收费系统完成绑定操作!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("账号绑定失败,请检查输入的URL、账号和密码是否正确", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }
private void webKitBrowser1_DocumentTitleChanged(object sender, EventArgs e) { if (isPaying) { isPaying = false; //充值返回了数据 try { Message msg = JsonConvert.DeserializeObject <Message>(this.webKitBrowser1.DocumentTitle); if (msg.Result) { //充值成功,提示打印票据 PayResult pay = JsonConvert.DeserializeObject <PayResult>(msg.TxtMessage); Print(pay); using (CompanyAccountServiceBF bf = new CompanyAccountServiceBF()) { Iot_TopUpRecord topUpRecord = new Iot_TopUpRecord() { ID = pay.ID, Address = this._user.Address, Amount = pay.Amount, Context = pay.Context, MeterID = pay.MeterID, MeterNo = pay.MeterNo, Oper = pay.Oper, OrgCode = "", PayType = pay.PayType, Ser = pay.Ser, CompanyID = "", State = (char)pay.State, TaskID = pay.TaskID, TopUpDate = pay.TopUpDate, TopUpType = (char)pay.TopUpType, UserID = pay.UserID, UserName = _user.UserName }; bf.ICompanyAccount.AddTopUpRecord(topUpRecord); } } else { //充值失败 this.btnClose.Enabled = true; this.btnPay.Enabled = true; MessageBox.Show("充值失败,原因:" + msg.TxtMessage, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ee) { this.btnClose.Enabled = true; this.btnPay.Enabled = true; MessageBox.Show("充值失败,原因:服务器返回错误数据。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public PrintTemplateSelect() { InitializeComponent(); using (CompanyAccountServiceBF bf = new CompanyAccountServiceBF()) { TemplateId = bf.ICompanyAccount.GetIotPayTicketTemplate(); List <ReportTemplate> list = bf.ICompanyAccount.getInvoiceTemplate(); this.bindingSource1.DataSource = bf.ICompanyAccount.getInvoiceTemplate(); this.comboBox1.SelectedValue = templateId; //this.comboBox1.SelectedItem = list.Where(p => p.RD_ID == TemplateId).SingleOrDefault(); //this.bindingSource2.DataSource = list.Where(p => p.RD_ID == TemplateId).ToList(); } }
public PayManageForm(IMainFrm mainFrm) { InitializeComponent(); this.mainFrm = mainFrm; this.btnPrinterSelect.Visible = mainFrm.IsExist(1024); if (LoginChecker.getInstance().Login(mainFrm)) { //登录成功 string strURL = string.Format("{0}/IotM/SFXT/Payment.html", LoginChecker.getInstance().CompanyAccount.ServiceURL); Uri url = new System.Uri(strURL, System.UriKind.Absolute); this.webKitBrowser1.Url = url; } else { this.webKitBrowser1.Url = new System.Uri(string.Format("{0}/{1}", LoginChecker.getInstance().CompanyAccount.ServiceURL, "Fail.html"), System.UriKind.Absolute);; } //需要增加票据模版定义功能 using (CompanyAccountServiceBF bf = new CompanyAccountServiceBF()) { this.printer = new TicketPrinter(bf.ICompanyAccount.GetIotPayTicketTemplate()); } }