public ProductMasterSearchDepartmentForm()
 {
     InitializeComponent();
     deptStockList = new DepartmentStockCollection(deptStockBindingSource);
     deptStockBindingSource.DataSource = deptStockList;
     deptStockBindingSource.ResetBindings(true);
     dgvProducts.DataError += new DataGridViewDataErrorEventHandler(dgvProducts_DataError);
     dgvProductMaster.DataError += new DataGridViewDataErrorEventHandler(dgvProductMaster_DataError);
 }
        private void DepartmentStockCheckingForm_Load(object sender, EventArgs e)
        {
            stockList = new DepartmentStockCollection(bdsStockDefect);
            bdsStockDefect.DataSource = stockList;
            bdsStockDefect.EndEdit();
            bdsStockDefect.ResetBindings(true);
            dgvStock.Refresh();
            dgvStock.Invalidate();

            stockList.Clear();
            DepartmentStockFixingEventArgs eventArgs = new DepartmentStockFixingEventArgs();

            EventUtility.fireEvent(LoadAdhocStocksEvent,this,eventArgs);
            if(eventArgs.DeptStockAdhocList!= null && eventArgs.DeptStockAdhocList.Count > 0)
            {
                foreach (DepartmentStock stockTempView in eventArgs.DeptStockAdhocList)
                {
                    stockList.Add(stockTempView);
                }
                bdsStockDefect.EndEdit();
                dgvStock.Refresh();
                dgvStock.Invalidate();
            }
        }
        private void DepartmentStockSearchForm_Load(object sender, EventArgs e)
        {
            stockViewList = new DepartmentStockViewCollection(bdsStockView);
            bdsStockView.ResetBindings(true);

            stockList = new DepartmentStockCollection(bdsStock);
            bdsStock.ResetBindings(true);

            var eventArgs = new DepartmentStockSearchEventArgs();
            EventUtility.fireEvent(InitDepartmentStockSearchEvent, this, eventArgs);

            productMasterSearchControl.cbbProductType.DataSource = eventArgs.ProductTypeList;
            productMasterSearchControl.cbbProductType.DisplayMember = "TypeName";

            productMasterSearchControl.cbbProductSize.DataSource = eventArgs.ProductSizeList;
            productMasterSearchControl.cbbProductSize.DisplayMember = "SizeName";

            productMasterSearchControl.cbbProductColor.DataSource = eventArgs.ProductColorList;
            productMasterSearchControl.cbbProductColor.DisplayMember = "ColorName";

            productMasterSearchControl.cbbCountry.DataSource = eventArgs.CountryList;
            productMasterSearchControl.cbbCountry.DisplayMember = "CountryName";
        }
Esempio n. 4
0
        private void ProcessErrorGoodsForm_Load(object sender, EventArgs e)
        {
            if (!DepartmentProcessing)
            {
                returnGoodsList = new StockOutDetailCollection(bdsReturnGoods);
                tempStockOutList = new StockOutDetailCollection(bdsTempStockOut);
                destroyGoodsList = new StockOutDetailCollection(bdsDestroyGoods);
                stockDefectList = new StockCollection(bdsStockDefect);

                bdsReturnGoods.ResetBindings(true);
                bdsTempStockOut.ResetBindings(true);
                bdsDestroyGoods.ResetBindings(true);
                bdsStockDefect.ResetBindings(true);

                LoadStockDefects();
            }
            else
            {
                deptReturnGoodsList= new DepartmentStockOutDetailCollection(bdsReturnGoods);
                deptTempStockOutList= new DepartmentStockOutDetailCollection(bdsTempStockOut);
                deptDestroyGoodsList= new DepartmentStockOutDetailCollection(bdsDestroyGoods);
                deptStockDefectList= new DepartmentStockCollection(bdsStockDefect);
                bdsReturnGoods.ResetBindings(true);
                bdsTempStockOut.ResetBindings(true);
                bdsDestroyGoods.ResetBindings(true);
                bdsStockDefect.ResetBindings(true);
                lblReturnGoods.Text = "Trả hàng lỗi về cho kho chính";
                LoadDepartmentStockDefects();
            }
        }
 private bool HasInStockDefectList(DepartmentStock stock, DepartmentStockCollection list, out int stockDefIndex)
 {
     int count = 0;
     foreach (DepartmentStock stockDefect in list)
     {
         if (stockDefect.DepartmentStockPK.DepartmentId == stock.DepartmentStockPK.DepartmentId
             && stockDefect.Product.ProductId.Equals(stock.DepartmentStockPK.ProductId))
         {
             stockDefIndex = count;
             return true;
         }
         count += 1;
     }
     stockDefIndex = count;
     return false;
 }
        private void DepartmentStockCheckingForm_Load(object sender, EventArgs e)
        {
            stockList = new DepartmentStockCollection(bdsStockDefect);
            bdsStockDefect.DataSource = stockList;
            bdsStockDefect.ResetBindings(true);
            if(Status == ViewStatus.OPENDIALOG)
            {
                button4.Enabled = false;
                if(RestrictDepartmentStocks!=null && RestrictDepartmentStocks.Count > 0)
                {
                    foreach (DepartmentStock departmentStock in RestrictDepartmentStocks)
                    {
                        stockList.Add(departmentStock);
                    }
                    bdsStockDefect.EndEdit();
                    dgvStock.Refresh();
                    dgvStock.Invalidate();
                }

            }
        }