using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm { public partial class ServicePaymentSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.ServicePaymentSuperSmallForm { public ServicePaymentSuperSmallForm() { this.btnSelect2.Click += btnSelect2_Click; this.btnSet2.Click += btnSet2_Click; } public string StrServerText = ""; public decimal IntAmount = 0; public decimal OutAmount = 0; public string OutRemark = ""; public string OutName = ""; public string SaleMan = ""; public string TwoSaleCategory = ""; public bool IsSave = false; /// /// 窗体加载事件 /// /// /// protected override void ServicePaymentSuperSmallForm_Load(object sender, EventArgs e) { this.txtName.Text = this.StrServerText.Trim(); this.BindPay_TwoPinsCategory(); if (this.IntAmount > 0) { this.txtAmount.Text = this.IntAmount.ToString().Trim(); } } /// /// 输入事件 /// /// /// protected override void txtAmount_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToString(e.KeyChar) == ".") { } else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 确定 /// /// /// protected override void btnOK_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.txtName.Text.Trim())) { if (!string.IsNullOrEmpty(this.txtAmount.Text.Trim())) { if (!string.IsNullOrEmpty(this.txtPay_OpenSingle.Text.Trim())) { if (!string.IsNullOrEmpty(this.cmbPay_TwoPinsCategory.Text.Trim())) { if (LYFZ.Command.Command_Validate.IsNumeric(this.txtAmount.Text.Trim())) { this.TwoSaleCategory = this.cmbPay_TwoPinsCategory.SelectedValue.ToString(); this.SaleMan = this.txtPay_OpenSingle.Tag.ToString().Trim(); this.OutName = this.txtName.Text.Trim(); this.OutAmount = Convert.ToDecimal(this.txtAmount.Text.Trim()); this.OutRemark = this.txtRemark.Text.Trim(); this.IsSave = true; this.Close(); } } else { MessageBoxCustom.Show("二销类别不能为空"); } } else { MessageBoxCustom.Show("销售人员不能为空"); } } else { MessageBoxCustom.Show("收款金额不能为空"); } } else { MessageBoxCustom.Show("收款项目不能为空"); } } /// /// 取消 /// /// /// protected override void btnCancel_Click(object sender, EventArgs e) { this.Close(); } /// /// 选择接单人 /// /// /// void btnSelect2_Click(object sender, EventArgs e) { LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmSelectPayOpenSingle set = new FinancialManagement.OrdersReceivables.FrmSelectPayOpenSingle(); set.ShowDialog(); if (!string.IsNullOrEmpty(set.Str1)) { this.txtPay_OpenSingle.Text = set.Str1; this.txtPay_OpenSingle.Tag = set.Str2; } } /// /// 设置 /// /// /// void btnSet2_Click(object sender, EventArgs e) { LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet set = new InitialSet.FrmSystemSet(); set.TypeName = "BEBACDAJDFDDEACGJ"; set.Version = "Version"; if (set.ShowDialog() == DialogResult.OK) { this.BindPay_TwoPinsCategory(); } } /// /// 绑定二销类别 /// public void BindPay_TwoPinsCategory() { DataTable dt = new DataTable(); LYFZ.BLL.BLL_ErpSystemCategory SystemCategorybll = new BLL.BLL_ErpSystemCategory(); DataTable dt2 = new DataTable(); dt2 = new DataTable(); dt2 = SystemCategorybll.GetList("Sc_ClassCode='BEBACDAJDFDDEACGJ'").Tables[0]; dt = SystemCategorybll.GetList("Sc_ClassParentID=" + dt2.Rows[0]["ID"] + "and Sc_ClassCode!='BEBCADBFBCDFBGJHC' and Sc_ClassCode!='BEBCADBFBDDEGGABF' and Sc_ClassCode!='BEBCBFBICGDHCGBEJ' and Sc_ClassCode!='BEBCABBAAICBDHDHI' and Sc_ClassCode!='BEBCABBAAICJAAGDG' and Sc_ClassCode!='BEBCBFBICFCECBHFF' ").Tables[0]; this.cmbPay_TwoPinsCategory.DataSource = dt; this.cmbPay_TwoPinsCategory.ValueMember = "Sc_ClassCode"; this.cmbPay_TwoPinsCategory.DisplayMember = "Sc_ClassName"; DataRow dr = dt.NewRow(); dr["Sc_ClassCode"] = "-1"; dr["Sc_ClassName"] = ""; dt.Rows.InsertAt(dr, 0); this.cmbPay_TwoPinsCategory.SelectedIndex = 0; } } }