using LYFZ.Software.MainBusiness.DoorCityProcess; 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.FinancialManagement.PieceCommissionRecords { public partial class FrmWeddingEntry : LYFZ.Software.UI.FinancialManagement.PieceCommissionRecords.FrmWeddingEntry { LYFZ.BLL.BLL_ErpSystemCategory csbll = new BLL.BLL_ErpSystemCategory(); LYFZ.BLL.BLL_ErpPieceCommissionRecords pcrsbll = new BLL.BLL_ErpPieceCommissionRecords(); public FrmWeddingEntry() { this.FormClosed += FrmWeddingEntry_FormClosed; } bool bl = false; /// /// /// /// /// void FrmWeddingEntry_FormClosed(object sender, FormClosedEventArgs e) { if (this.bl == true) { this.DialogResult = DialogResult.OK; } } /// /// 窗体加载事件 /// /// /// protected override void FrmWeddingEntry_Shown(object sender, EventArgs e) { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbPcr_DigitalDivision); this.txtPcr_Date.Text = SDateTime.Now.ToString(); LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBBBABBEBAIHGDCB", this.cmbtreevCompletionContents, IsFirstNodeNull: true); } /// /// 关闭 /// /// /// protected override void btnClose_Click(object sender, EventArgs e) { this.Close(); if (this.bl == true) { this.DialogResult = DialogResult.OK; } } /// /// 保存 /// /// /// protected override void btnSave_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(this.txtOrd_Number.Text)) { MessageBoxCustom.Show("订单号不能为空!请查找客户!"); return; } if (string.IsNullOrEmpty(this.txtPcr_Date.DateValue)) { MessageBoxCustom.Show("日期不能为空!"); return; } if (string.IsNullOrEmpty(this.cmbPcr_DigitalDivision.Text.Trim())) { MessageBoxCustom.Show("提成人不能为空!"); return; } if (string.IsNullOrEmpty(this.cmbtreevCompletionContents.Text.Trim())) { MessageBoxCustom.Show("工作内容不能为空!"); return; } if (string.IsNullOrEmpty(this.txtPcr_Quantity.Text)) { MessageBoxCustom.Show("数量不能为空!"); return; } LYFZ.Model.Model_ErpPieceCommissionRecords model = new Model.Model_ErpPieceCommissionRecords(); model.Pcr_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Pcr_OrderNumber = this.txtOrd_Number.Text; model.Pcr_DigitalDivision = this.cmbPcr_DigitalDivision.Tag.ToString(); model.Pcr_Date = Convert.ToDateTime(this.txtPcr_Date.DateTimeValue); model.Pcr_CompletionContents = this.cmbtreevCompletionContents.Tag.ToString().Trim(); model.Pcr_Quantity = Convert.ToDecimal(this.txtPcr_Quantity.Text); model.Pcr_CreateTime = SDateTime.Now; model.Pcr_EntryPeople = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID; model.Pcr_Type = 0; model.Pcr_OrderSource = StrOrdType; if (pcrsbll.Add(model)) { MessageBoxCustom.Show("保存成功!可继续录入资料!"); this.cmbtreevCompletionContents.SetTextAndTag_ValueNull(); this.txtPcr_Quantity.Text = ""; this.bl = true; } else { MessageBoxCustom.Show("保存失败!"); } } catch (Exception ex) { MessageBoxCustom.Show(ex.Message); } } /// /// 设置 /// /// /// protected override void btnSet_Click(object sender, EventArgs e) { LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet(); frm.TypeName = "BEBBBABBEBAIHGDCB"; frm.Version = "Version"; if (frm.ShowDialog() == DialogResult.OK) { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBBBABBEBAIHGDCB", this.cmbtreevCompletionContents, IsFirstNodeNull: true); } } /// /// 文本框设置 /// /// /// protected override void txtPcr_Quantity_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsPunctuation(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } else if (Char.IsPunctuation(e.KeyChar)) { if (e.KeyChar == '.') { if (((System.Windows.Forms.TextBox)sender).Text.LastIndexOf('.') != -1) { e.Handled = true; } } else { e.Handled = true; } } } string StrOrdType = ""; /// /// 选择订单 /// /// /// protected override void btnSelect_Click(object sender, EventArgs e) { LYFZ.Software.MainBusiness.FinancialManagement.PieceCommissionRecords.FrmSelectCustomer frm = new FrmSelectCustomer(); frm.ShowDialog(); if (!string.IsNullOrEmpty(frm.Ord_Number)) { this.StrOrdType = frm.Ord_Type; this.txtOrd_Number.Text = frm.Ord_Number; this.txtOrd_SeriesName.Text = frm.Ord_SeriesName; this.txtOrd_CustomerName1.Text = frm.Ord_CustomerName1; this.txtOrd_OrdersPerson.Text = frm.Ord_OrdersPerson; } } } }