Esempio n. 1
0
        private void barBtn_ChangeDateSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //Query.ConditionAChooseForm f = new Book.UI.Query.ConditionAChooseForm();
            //if (f.ShowDialog(this) == DialogResult.OK)
            //{
            //    Query.ConditionA condition = f.Condition as Query.ConditionA;

            //    IList<Model.StockCheck> mStockChecklist = (this.manager as BL.StockCheckManager).SelectByDateRage(condition.StartDate, condition.EndDate);
            //    foreach (Model.StockCheck sc in mStockChecklist)
            //    {
            //        Model.ProductCategory _pc = new BL.ProductCategoryManager().Get(sc.ProductCategoryId);
            //        sc.ProductCategoryName = _pc == null ? "" : _pc.ProductCategoryName;
            //    }
            //    this.bindingSource1.DataSource = mStockChecklist;
            //    this.gridView1.GroupPanelText = condition.StartDate.ToString("yyyy-MM-dd") + "到" + condition.EndDate.ToString("yyyy-MM-dd") + "的記錄";
            //}
            StockCheckConditionForm f = new StockCheckConditionForm();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                StockCheckCondition      model           = f.model;
                IList <Model.StockCheck> mStockChecklist = (this.manager as BL.StockCheckManager).SelectByDateRage(model.StartDate, model.EndDate, model.Invoiceid);
                foreach (Model.StockCheck sc in mStockChecklist)
                {
                    Model.ProductCategory _pc = new BL.ProductCategoryManager().Get(sc.ProductCategoryId);
                    sc.ProductCategoryName = _pc == null ? "" : _pc.ProductCategoryName;
                }
                this.bindingSource1.DataSource = mStockChecklist;
                this.gridView1.GroupPanelText  = model.StartDate.ToString("yyyy-MM-dd") + "到" + model.EndDate.ToString("yyyy-MM-dd") + "的記錄";
            }
        }
Esempio n. 2
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     if (model == null)
     {
         model = new StockCheckCondition();
     }
     model.StartDate   = this.dateEditStart.EditValue == null ? global::Helper.DateTimeParse.NullDate : this.dateEditStart.DateTime;
     model.EndDate     = this.dateEditEnd.EditValue == null ? global::Helper.DateTimeParse.EndDate : this.dateEditEnd.DateTime;
     model.Invoiceid   = this.txt_Invoiceid.Text;
     this.DialogResult = DialogResult.OK;
 }