protected override void OnOK() { if (this.condition == null) { this.condition = new ConditionPronoteHeader(); } if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditStartDate.DateTime, new DateTime())) { this.condition.StartDate = global::Helper.DateTimeParse.NullDate; } else { this.condition.StartDate = this.dateEditStartDate.DateTime; } if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditEndDate.DateTime, new DateTime())) { this.condition.EndDate = global::Helper.DateTimeParse.EndDate; } else { this.condition.EndDate = this.dateEditEndDate.DateTime; } this.condition.Product = this.buttonEditPro.EditValue as Model.Product; this.condition.PronoteHeaderIdStart = this.buttonEditProHeader1.Text == "" ? null : this.buttonEditProHeader1.Text; this.condition.PronoteHeaderIdEnd = this.buttonEditProHeader2.Text == "" ? null : this.buttonEditProHeader2.Text; this.condition.Customer = this.newChooseCustomer.EditValue as Model.Customer; if (this.coBoxSourceType.SelectedIndex == 0 || this.coBoxSourceType.SelectedIndex == -1) { this.condition.SourceTpye = -1; } else if (this.coBoxSourceType.SelectedIndex == 1) { this.condition.SourceTpye = 0; } else if (this.coBoxSourceType.SelectedIndex == 2) { this.condition.SourceTpye = 5; } else if (this.coBoxSourceType.SelectedIndex == 3) { this.condition.SourceTpye = 4; } this.condition.ProNameKey = this.TXTproNameKey.Text; this.condition.ProCusNameKey = this.TXTproCusNameKey.Text; this.condition.PronoteHeaderIdKey = this.txtpronoteHeaderIdKey.Text; this.condition.CusXOId = this.textEditCusXOId.Text; this.condition.CustomerProductName = this.txt_CustomerProductName.Text; this.condition.WorkHouseId = this.lue_WorkHouse.EditValue == null ? null : this.lue_WorkHouse.EditValue.ToString(); }
/// <summary> /// 构造函数,初始化 加工单 /// </summary> /// <param name="condition"></param> public Q49(ConditionPronoteHeader condition) { InitializeComponent(); this.condition = condition; IList <Model.PronoteHeader> list = detailManager.GetByDateMa(condition.StartDate, condition.EndDate, condition.Customer, condition.CusXOId, condition.Product, condition.PronoteHeaderIdStart, condition.PronoteHeaderIdEnd, condition.SourceTpye, null, false, condition.ProNameKey, condition.ProCusNameKey, condition.PronoteHeaderIdKey, false, false, false, false); if (list == null || list.Count <= 0) { throw new global::Helper.InvalidValueException("無數據"); } this.xrLabelPrintDate.Text += DateTime.Now.ToShortDateString(); this.xrLabelRepotName.Text = BL.Settings.CompanyChineseName; this.xrLabelDataName.Text = Properties.Resources.PronoteHeaderDetails; if (list != null) { foreach (Model.PronoteHeader ph in list) { Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(ph.InvoiceXOId); if (xo != null) { ph.CustomerShortName = xo.xocustomer.CustomerShortName; ph.CustomerInvoiceXOId = xo.CustomerInvoiceXOId; } headerList1.Add(ph); } } this.DataSource = headerList1; //生產通知 this.xrLabelPronoteHeaderID.DataBindings.Add("Text", this.DataSource, Model.PronoteHeader.PRO_PronoteHeaderID); this.xrLabelPronoteDte.DataBindings.Add("Text", this.DataSource, Model.PronoteHeader.PRO_PronoteDate, "{0:yyyy-MM-dd}"); this.xrLabelEmployee.DataBindings.Add("Text", this.DataSource, "Employee0Name"); this.xrLabelProductName.DataBindings.Add("Text", this.DataSource, "ProductName"); this.xrLabelCustomerProductName.DataBindings.Add("Text", this.DataSource, "CustomerProductName"); this.xrLabelCustomer.DataBindings.Add("Text", this.DataSource, "CustomerShortName"); this.xrLabelCustomerXOId.DataBindings.Add("Text", this.DataSource, "CustomerInvoiceXOId"); this.xrLabelCount.DataBindings.Add("Text", this.DataSource, Model.PronoteHeader.PRO_DetailsSum); this.xrLabelUnit.DataBindings.Add("Text", this.DataSource, Model.PronoteHeader.PRO_ProductUnit); this.xrLabelPronotedesc.DataBindings.Add("Text", this.DataSource, Model.PronoteHeader.PRO_Pronotedesc); this.xrRichTextProDesc.DataBindings.Add("Rtf", this.DataSource, "ProductDesc"); this.xrSubreport1.ReportSource = new Q49_1(); this.xrSubreport2.ReportSource = new Q49_2(); }
private void SetValue() { if (this.condition == null) { this.condition = new ConditionPronoteHeader(); } if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditStartDate.DateTime, new DateTime())) { this.condition.StartDate = global::Helper.DateTimeParse.NullDate; } else { this.condition.StartDate = this.dateEditStartDate.DateTime; } if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditEndDate.DateTime, new DateTime())) { this.condition.EndDate = global::Helper.DateTimeParse.EndDate; } else { this.condition.EndDate = this.dateEditEndDate.DateTime; } this.condition.Product = this.buttonEditPro.EditValue as Model.Product; this.condition.PronoteHeaderIdStart = this.buttonEditProHeader1.Text == "" ? null : this.buttonEditProHeader1.Text; this.condition.PronoteHeaderIdEnd = this.buttonEditProHeader2.Text == "" ? null : this.buttonEditProHeader2.Text; this.condition.Customer = this.newChooseCustomer.EditValue as Model.Customer; if (this.coBoxSourceType.SelectedIndex == 0 || this.coBoxSourceType.SelectedIndex == -1) { this.condition.SourceTpye = -1; } else if (this.coBoxSourceType.SelectedIndex == 1) { this.condition.SourceTpye = 0; } else if (this.coBoxSourceType.SelectedIndex == 2) { this.condition.SourceTpye = 5; } else if (this.coBoxSourceType.SelectedIndex == 3) { this.condition.SourceTpye = 4; } this.condition.ProNameKey = this.TXTproNameKey.Text; this.condition.ProCusNameKey = this.TXTproCusNameKey.Text; this.condition.PronoteHeaderIdKey = this.txtpronoteHeaderIdKey.Text; this.condition.CusXOId = this.textEditCusXOId.Text; if (!string.IsNullOrEmpty(this.ccb_BGHandBookIds.Text)) { string bgHandBookId = ""; string[] bgHandBookIds = this.ccb_BGHandBookIds.Text.Split(','); foreach (var item in bgHandBookIds) { bgHandBookId += "'" + item.Trim() + "',"; } bgHandBookId = bgHandBookId.TrimEnd(','); this.condition.HandbookId = bgHandBookId; } }