protected override void OnOK() { if (condition == null) { condition = new Condition1(); } 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.buttonEditProduct.EditValue as Model.Product; this.condition.mCustomerId = this.nccCustomer.EditValue == null ? "" : (this.nccCustomer.EditValue as Model.Customer).CustomerId; this.condition.mSupplierId = this.nccSupplier.EditValue == null ? "" : (this.nccSupplier.EditValue as Model.Supplier).SupplierId; this.condition.ProduceOtherCompactId = this.txt_OtherCompactId.Text; this.condition.InvoiceCusXOId = this.txt_InvoiceCusXOId.EditValue == null ? null : this.txt_InvoiceCusXOId.EditValue.ToString(); }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Condition1ChooseForm f = new Condition1ChooseForm(); if (f.ShowDialog(this) == DialogResult.OK) { Condition1 condition = f.Condition as Condition1; listDetail = (this.manager as BL.ProduceOtherCompactManager).GetByDate(condition.StartDate, condition.EndDate, condition.Product, condition.InvoiceCusId, condition.mCustomerId, condition.mSupplierId, condition.ProduceOtherCompactId, null); foreach (Model.ProduceOtherCompact item in listDetail) { item.Checkeds = true; } this.bindingSource1.DataSource = listDetail; this.barStaticItem1.Caption = string.Format("{0}項", this.bindingSource1.Count); } }