private void btnOK_Click(object sender, EventArgs e) { if (this.txtPayment.Text.Trim() == "") { DasherStation.HumanResource.CommUI.AlertError("本次付款不能为空!"); return; } decimal mValue; if (decimal.TryParse(this.txtPayment.Text.Trim(), out mValue) == false) { DasherStation.HumanResource.CommUI.AlertError("在本次付款中请输入数值!"); return; } if (decimal.Parse(this.txtCount2.Text) + decimal.Parse(this.txtPayment.Text) > decimal.Parse(this.txtCount1.Text)) { DasherStation.HumanResource.CommUI.AlertError("已付总额不能大于应付总额!"); return; } tFundsRecorderInfo entity = new tFundsRecorderInfo(); tFundsRecorderInfo.tFundsRecorderRow oRow = entity.tFundsRecorder.NewtFundsRecorderRow(); oRow.tuId = long.Parse(this.cboClient.SelectedValue.ToString()); oRow.paidUp = mValue; oRow.type = EnumAccountType.运输款.ToString(); if (this.chkCheck.Checked) { oRow.checkNo = this.txtCheckNo.Text.Trim(); } if (this.chkInvoice.Checked) { oRow.invoiceNo = this.txtInvoiceNo.Text.Trim(); } oRow.inputMan = this.UserName; if (this.txtMemo.Text.Trim() != "") { oRow.remark = this.txtMemo.Text.Trim(); } oRow.cash1 = decimal.Parse(this.txtCount1.Text); oRow.cash2 = decimal.Parse(this.txtCount3.Text) - decimal.Parse(this.txtPayment.Text); entity.tFundsRecorder.AddtFundsRecorderRow(oRow); TransportBalanceLogic model = new TransportBalanceLogic(); model.AddPaid(entity); this.txtPayment.Text = ""; this.chkCheck.Checked = false; this.chkInvoice.Checked = false; this.txtCheckNo.Text = ""; this.txtInvoiceNo.Text = ""; this.txtMemo.Text = ""; this.InitForm(model); }