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 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();
                }

            }
        }