/// <summary> /// 绑定控件 /// </summary> public void bankj() { string ID = AppDomain.CurrentDomain.GetData("s").ToString(); BuyPaymentManager buy = new BuyPaymentManager(); Model.BuyPayment bu = buy.GetModel(XYEEncoding.strCodeHex(ID)); this.textBoxOddNumbers.Text = XYEEncoding.strHexDecode(bu.Buy_Code); this.dateTimePicker1.Value = Convert.ToDateTime(bu.Buy_Date); this.labtextboxTop1.Text = XYEEncoding.strHexDecode(bu.Buy_SuName); this.labtextboxTop2.Text = XYEEncoding.strHexDecode(bu.Buy_AmountPay); this.labtextboxTop6.Text = XYEEncoding.strHexDecode(bu.Buy_AccountName); this.labtextboxTop7.Text = XYEEncoding.strHexDecode(bu.Buy_AccountPaid); this.labtextboxTop8.Text = XYEEncoding.strHexDecode(bu.Buy_Actmoney); this.labtextboxBotton1.Text = XYEEncoding.strHexDecode(bu.Buy_SalesMan); this.labtextboxBotton4.Text = XYEEncoding.strHexDecode(bu.Buy_AuditMan); }
/// <summary> /// 审核付款按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonExamine_Click(object sender, EventArgs e) { try { if (this.labtextboxTop8.Text != "") { if (IsNotNull()) { Model.BuyPayment buy = new Model.BuyPayment(); buy.Buy_Code = XYEEncoding.strCodeHex(this.textBoxOddNumbers.Text.Trim()); //单号 buy.Buy_Date = this.dateTimePicker1.Value; //日期 buy.Buy_SuName = XYEEncoding.strCodeHex(this.labtextboxTop1.Text.Trim()); //供应商 buy.Buy_AmountPay = XYEEncoding.strCodeHex(this.labtextboxTop2.Text.Trim()); //应付金额 buy.Buy_AccountName = XYEEncoding.strCodeHex(this.labtextboxTop6.Text.Trim()); //付款账户 buy.Buy_AccountPaid = XYEEncoding.strCodeHex(this.labtextboxTop7.Text.Trim()); //已付金额 buy.Buy_Actmoney = XYEEncoding.strCodeHex(this.labtextboxTop8.Text.Trim()); //实付金额 buy.Buy_SalesMan = XYEEncoding.strCodeHex(this.labtextboxBotton1.Text.Trim()); //业务员 if (_yuanyu == null) { buy.Buy_Remark = _yuanyu; } else { buy.Buy_Remark = XYEEncoding.strCodeHex(_yuanyu); //原因 } buy.Buy_AuditMan = XYEEncoding.strCodeHex(this.labtextboxBotton4.Text.Trim()); //审核人 if (weifujine == 0) { bool result = bm.PaymentUpdate(buy); if (result) { bool r = buymanager.PaymentUpdate(buy.Buy_Code, 3); if (r) { MessageBox.Show("【审核并付款】成功!"); this.labSH.Visible = true; this.labFK.Visible = true; pay.Band(); return; } else { MessageBox.Show("【审核并付款】失败!"); return; } } else { return; } } else { bool res = bm.ReveiweUpdate(XYEEncoding.strCodeHex(this.textBoxOddNumbers.Text.Trim())); if (res == true) { bool r = buymanager.PaymentUpdate(buy.Buy_Code, 5); if (r) { MessageBox.Show("【审核并付款】成功!"); this.labSH.Visible = true; this.labFK.Visible = true; pay.Band(); return; } else { MessageBox.Show("【审核并付款】失败!"); return; } } } } } else { MessageBox.Show("【付款金额】不能为空!"); return; } } catch (Exception ex) { MessageBox.Show("错误代码:3211-采购付款单保存异常,异常信息:" + ex.Message); } }