public Q56(ConditionOtherInDepot condition) { InitializeComponent(); this._condition = condition; IList <Model.ProduceOtherInDepot> list = inDepotManager.SelectByCondition(condition.StartDate, condition.EndDate, condition.Supplier1, condition.Supplier2, condition.ProduceOtherCompactId1, condition.ProduceOtherCompactId2, condition.Product1, condition.Product2, condition.InvouceCusIdStart, condition.InvoiceCusIdEnd); if (list == null || list.Count <= 0) { throw new global::Helper.InvalidValueException("查詢無記錄."); } if (!global::Helper.DateTimeParse.DateTimeEquls(condition.StartDate, global::Helper.DateTimeParse.NullDate)) { this.xrLabelDateRange.Text += "自 " + condition.StartDate.ToString("yyyy-MM-dd"); } this.xrLabelDateRange.Text += "至 " + condition.EndDate.ToString("yyyy-MM-dd"); this.xrLabelDates.Text += DateTime.Now.ToString("yyyy-MM-dd"); this.RepotName.Text = BL.Settings.CompanyChineseName; this.ReportTitle.Text = Properties.Resources.ProduceOtherInDepot; this.DataSource = list; this.ProduceOtherInDepotId.DataBindings.Add("Text", this.DataSource, Model.ProduceOtherInDepot.PRO_ProduceOtherInDepotId); this.SupplierId.DataBindings.Add("Text", this.DataSource, "Supplier." + Model.Supplier.PROPERTY_SUPPLIERSHORTNAME); this.ProduceOtherInDepotDate.DataBindings.Add("Text", this.DataSource, Model.ProduceOtherInDepot.PRO_ProduceOtherInDepotDate, "{0:yyyy-MM-dd}"); this.ProduceOtherInDepotId.DataBindings.Add("Text", this.DataSource, Model.ProduceOtherInDepot.PRO_ProduceOtherInDepotId); this.DepotId.DataBindings.Add("Text", this.DataSource, "Depot." + Model.Depot.PRO_DepotName); //this.Employee1Id.DataBindings.Add("Text", this.DataSource, "Employee1." + Model.Employee.PROPERTY_EMPLOYEENAME); //this.Employee0Id.DataBindings.Add("Text", this.DataSource, "Employee0." + Model.Employee.PROPERTY_EMPLOYEENAME); //this.ProduceOtherInDepotDesc.DataBindings.Add("Text", this.DataSource, Model.ProduceOtherInDepot.PRO_ProduceOtherInDepotDesc); this.xrSubreport1.ReportSource = new Q56_1(); }
protected override void OnOK() { if (this.condition == null) { this.condition = new ConditionOtherInDepot(); } this.condition.StartDate = this.dateEditStartDate.EditValue == null ? global::Helper.DateTimeParse.NullDate : this.dateEditStartDate.DateTime; this.condition.EndDate = this.dateEditEndDate.EditValue == null ? System.DateTime.Now : this.dateEditEndDate.DateTime; this.condition.ProduceOtherCompactId1 = this.buttonEditProduceOtherCompactId1.EditValue == null ? null : this.buttonEditProduceOtherCompactId1.EditValue.ToString(); this.condition.ProduceOtherCompactId2 = this.buttonEditProduceOtherCompactId2.EditValue == null ? null : this.buttonEditProduceOtherCompactId2.EditValue.ToString(); this.condition.Supplier1 = this.nccSupplier1.EditValue as Model.Supplier; this.condition.Supplier2 = this.nccSupplier2.EditValue as Model.Supplier; this.condition.Product1 = this.StartProductId.EditValue as Model.Product; this.condition.Product2 = this.EndProductId.EditValue as Model.Product; this.condition.InvouceCusIdStart = this.txtInvouceCusIdStart.Text; this.condition.InvoiceCusIdEnd = this.txtInvouceCusIdEnd.Text; }