public InDepotDetail(InDepot condition) : this() { this.lblCompanyName.Text = BL.Settings.CompanyChineseName; this.lblReportName.Text = Properties.Resources.InDepotDetail; this.lblDateRange.Text = "日期區間:" + condition.StartDate.ToString("yyyy-MM-dd") + "-" + condition.EndDate.ToString("yyyy-MM-dd"); this.lblPrintDate.Text = "列印日期:" + DateTime.Now.ToString("yyyy-MM-dd"); IList <Model.DepotInDetail> details = manager.SelectByCondition(condition.StartDate, condition.EndDate, condition.InDepotIdStart, condition.InDepotIdEnd, condition.DepotIdStart, condition.DepotIdEnd, condition.SupplierStart, condition.SupplierEnd); if (details == null) { throw new Helper.InvalidValueException("無記錄"); } this.DataSource = details; this.TCDate.DataBindings.Add("Text", this.DataSource, Model.DepotInDetail.PRO_Date, "{0:yyyy-MM-dd}"); this.TCInDepotId.DataBindings.Add("Text", this.DataSource, Model.DepotInDetail.PRO_DepotInId); this.TCDepot.DataBindings.Add("Text", this.DataSource, "DepotPosition." + "Depot." + Model.Depot.PRO_DepotName); this.TCProduct.DataBindings.Add("Text", this.DataSource, "Product"); this.TCUnit.DataBindings.Add("Text", this.DataSource, Model.DepotInDetail.PRO_ProductUnit); this.TCPosition.DataBindings.Add("Text", this.DataSource, "DepotPosition"); this.TCNum.DataBindings.Add("Text", this.DataSource, Model.DepotInDetail.PRO_DepotInQuantity); this.lblTotalNum.Summary.FormatString = "{0:0}"; this.lblTotalNum.Summary.Func = SummaryFunc.Sum; this.lblTotalNum.Summary.IgnoreNullValues = true; this.lblTotalNum.Summary.Running = SummaryRunning.Report; this.lblTotalNum.DataBindings.Add("Text", this.DataSource, Model.DepotInDetail.PRO_DepotInQuantity); }
protected override void OnOK() { if (this.condition == null) { this.condition = new InDepot(); } if (global::Helper.DateTimeParse.DateTimeEquls(this.date_Start.DateTime, new DateTime())) { this.condition.StartDate = global::Helper.DateTimeParse.NullDate; } else { this.condition.StartDate = this.date_Start.DateTime; } if (global::Helper.DateTimeParse.DateTimeEquls(this.date_End.DateTime, new DateTime())) { this.condition.EndDate = global::Helper.DateTimeParse.EndDate; } else { this.condition.EndDate = this.date_End.DateTime; } this.condition.InDepotIdEnd = this.txt_InDepotIdStart.Text; this.condition.InDepotIdStart = this.txt_InDepotIdEnd.Text; this.condition.DepotIdStart = this.lookUpEditDepotStart.EditValue == null ? null : this.lookUpEditDepotStart.EditValue.ToString(); this.condition.DepotIdEnd = this.lookUpEditDepotEnd.EditValue == null ? null : this.lookUpEditDepotEnd.EditValue.ToString(); this.condition.SupplierStart = this.nccCustomerStart.EditValue == null ? null : this.nccCustomerStart.EditValue as Model.Supplier; this.condition.SupplierEnd = this.nccCustomerEnd.EditValue == null ? null : this.nccCustomerEnd.EditValue as Model.Supplier; }