Example #1
0
        private void barBtnChangeSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ChooseConditionExport f = new ChooseConditionExport();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                ConditionExport condition = f.Condition as ConditionExport;
                this.bindingSource1.DataSource = (this.manager as BL.PCExportReportANSIManager).SelectForChooseExport(condition.StartDate, condition.EndDate, condition.Product, condition.Customer, condition.CusXOId, condition.ExpType);
                this.gridControl1.RefreshDataSource();
            }
        }
        protected override void OnOK()
        {
            if (this.condition == null)
            {
                this.condition = new ConditionExport();
            }
            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.btnEditProduct.EditValue as Model.Product;
            this.condition.Customer = this.nccCustomer.EditValue as Model.Customer;
            this.condition.CusXOId  = this.txtInvoiceXOId.Text;
            string mExpType = string.Empty;

            switch (this.cmbExpType.SelectedIndex)
            {
            case -1:
            case 0:
                mExpType = "";
                break;

            case 1:
                mExpType = "ANSI";
                break;

            case 2:
                mExpType = "CSA";
                break;

            case 3:
                mExpType = "BS/EN";
                break;
            }
            this.condition.ExpType = mExpType;
        }