Exemplo n.º 1
0
        private void butSearch_Click(object sender, EventArgs e)
        {
            StoreInPlanDialogModel model = new StoreInPlanDialogModel();
            model.StoreInPlanNum = txtFilter1.Text.ToString();
            model.InvoiceNum = txtFilter2.Text.ToString();
            model.PONumber = txtFilter3.Text.ToString();
            model.ImportFlag = status;
            model.TransactionType = this.Type;

            int FilterType = 0;
            if (status == 2)
            {
                FilterType = 0;
            }
            else if (this.Type == "")
            {
                FilterType = 1;
            }
            else
            {
                FilterType = 2;
            }

            var list = _repo.GetByFilter(model, FilterType);
            dgvList.Rows.Clear();
            ListToGrid(list);
        }
Exemplo n.º 2
0
 public StoreInBalance(SessionInfo _session = null, StoreInPlanDialogModel model = null)
 {
     InitializeComponent();
     this._repoPln = new StoreInPlanRepo();
     this._repo = new StoreInRepo();
     this.StoreInPlanBln = new List<StoreInPlanDialogModel>();
     this.FilterData = model;
 }
Exemplo n.º 3
0
        private void StoreInBalance_Load(object sender, EventArgs e)
        {          
            if (FilterData != null)
            {
                StoreInPlanDialogModel filter = new StoreInPlanDialogModel();
                filter.StoreInPlanNum = FilterData.StoreInPlanNum;
                filter.InvoiceNum = FilterData.InvoiceNum;
                filter.InvoiceDateFrom = FilterData.InvoiceDateFrom;
                filter.InvoiceDateTo = FilterData.InvoiceDateTo;

                StoreInPlanBln = _repoPln.GetByFilter(filter, 0);
            }
            SetGrid(StoreInPlanBln);
        }
Exemplo n.º 4
0
        public IEnumerable<StoreInPlanDialogModel> GetByFilter(StoreInPlanDialogModel model, int FilterType)
        {
            IEnumerable<StoreInPlanDialogModel> query = new List<StoreInPlanDialogModel>();

            if (FilterType == 0)
            {
                query = GetAll();
            }
            else if (FilterType == 1)
            {
                query = GetAll(model.ImportFlag);
            }
            else
            {
                query = GetAll(model.ImportFlag, model.TransactionType);
            }

            query = query.Where(p => p.InvoiceDate >= model.InvoiceDateFrom && p.InvoiceDate <= model.InvoiceDateTo);

            if (!string.IsNullOrEmpty(model.StoreInPlanNum)) { query = query.Where(p => p.StoreInPlanNum.Contains(model.StoreInPlanNum)); }
            if (!string.IsNullOrEmpty(model.InvoiceNum)) { query = query.Where(p => p.InvoiceNum.Contains(model.InvoiceNum)); }
            if (!string.IsNullOrEmpty(model.PONumber)) { query = query.Where(p => p.PONumber.GetString().Contains(model.PONumber.GetString())); }

            return query.ToList();
        }
Exemplo n.º 5
0
        private void butSearch_Click(object sender, EventArgs e)
        {
            StoreInPlanDialogModel model = new StoreInPlanDialogModel();
            model.StoreInPlanNum = txtStoreInPlanNo.Text.Trim();
            model.InvoiceNum = txtInvoiceNo.Text.Trim();
            model.InvoiceDateFrom = dtpInvoiceDateFrom.Value;
            model.InvoiceDateTo = dtpInvoiceDateTo.Value;

            var result = _repoPln.GetByFilter(model, 0);
            SetGrid(result);
        }
Exemplo n.º 6
0
        private void storeInBalanceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            StoreInPlanDialogModel model = new StoreInPlanDialogModel();
            model.StoreInPlanId = HeadContent.StoreInPlanId;
            model.StoreInPlanNum = HeadContent.StoreInPlanNum;
            model.InvoiceNum = HeadContent.InvoiceNum;
            model.InvoiceDateFrom = HeadContent.InvoiceDate;
            model.InvoiceDateTo = HeadContent.InvoiceDate;

            StoreInBalance frm = new StoreInBalance(epiSession, model);
            frm.Show();
        }