Exemplo n.º 1
0
        private void FrmProductInventoryRecordsView_Load(object sender, EventArgs e)
        {
            StackOutRecordSearchCondition con1 = new StackOutRecordSearchCondition();

            con1.LastActiveDate = new DateTimeRange(DateTime.Today.AddMonths(-1), DateTime.Now);
            con1.States         = new List <SheetState>();
            con1.States.Add(SheetState.Shipped);
            con1.ProductID   = ProductInventory.ProductID;
            con1.WareHouseID = ProductInventory.WareHouseID;
            List <StackOutRecord> item1 = new StackOutSheetBLL(AppSettings.Current.ConnStr).GetDeliveryRecords(con1).QueryObjects;

            StackInRecordSearchCondition con2 = new StackInRecordSearchCondition();

            con2.LastActiveDate = new DateTimeRange(DateTime.Today.AddMonths(-1), DateTime.Now);
            con2.States         = new List <SheetState>();
            con2.States.Add(SheetState.Inventory);
            con2.ProductID   = ProductInventory.ProductID;
            con2.WareHouseID = ProductInventory.WareHouseID;
            List <StackInRecord> item2 = new StackInSheetBLL(AppSettings.Current.ConnStr).GetInventoryRecords(con2).QueryObjects;

            List <ProductInventoryRecord> items = new List <ProductInventoryRecord>();

            items.AddRange(item1.Select(item => new ProductInventoryRecord()
            {
                Date = item.LastActiveDate, ProductID = item.ProductID, ProductName = item.Product.Name, Out = item.Count, SheetNo = item.SheetNo
            }));
            items.AddRange(item2.Select(item => new ProductInventoryRecord()
            {
                Date = item.LastActiveDate, ProductID = item.ProductID, ProductName = item.Product.Name, In = item.Count, SheetNo = item.SheetNo
            }));
            items = (from item in items
                     orderby item.Date descending
                     select item).ToList();
            ShowItemsInGrid(items);
        }
Exemplo n.º 2
0
        private void btnNullify_Click(object sender, EventArgs e)
        {
            StackOutSheetBLL bll = new StackOutSheetBLL(AppSettings.Current.ConnStr);

            PerformOperation <StackOutSheet>(bll, SheetOperation.Nullify);
        }
Exemplo n.º 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            StackOutSheetBLL bll = new StackOutSheetBLL(AppSettings.Current.ConnStr);

            PerformOperation <StackOutSheet>(bll, IsAdding ? SheetOperation.Create : SheetOperation.Modify);
        }