private bool IsInList(StockOutDetailCollection collection, StockOutDetail detail)
 {
     foreach (StockOutDetail outDetail in collection)
     {
         if (detail.Product.ProductId.Equals(outDetail.Product.ProductId))
         {
             return true;
         }
     }
     return false;
 }
        private void DepartmentStockInExtra_Load(object sender, EventArgs e)
        {
            IList list = new ArrayList();
            list.Add(new StockDefectStatus { DefectStatusId = 4, DefectStatusName = "Xuất tạm để sửa hàng"});
            list.Add(new StockDefectStatus { DefectStatusId = 5, DefectStatusName = "Xuất trả về nhà sản xuất" });
            list.Add(new StockDefectStatus { DefectStatusId = 7, DefectStatusName = "Xuất đi cửa hàng khác ngoài hệ thống" });
            list.Add(new StockDefectStatus { DefectStatusId = 9, DefectStatusName = "Xuất hàng mẫu" });

            cbbStockOutType.DataSource = list;
            cbbStockOutType.DisplayMember = "DefectStatusName";

            stockOutDetailList = new StockOutDetailCollection(bdsStockIn);
            bdsStockIn.DataSource = stockOutDetailList;
            dgvDeptStockOut.DataError += new DataGridViewDataErrorEventHandler(dgvDeptStockIn_DataError);

            // create DepartmentStockIn
            if (stockOut == null)
            {
                stockOut = new StockOut();
                stockOut.CreateDate = DateTime.Now;
                stockOut.UpdateDate = DateTime.Now;
                stockOut.CreateId = ClientInfo.getInstance().LoggedUser.Name;
                stockOut.UpdateId = ClientInfo.getInstance().LoggedUser.Name;
                stockOut.ExclusiveKey = 0;
                CreateNewStockInDetail();
            //                btnBarcode.Visible = false;
            //                numericUpDownBarcode.Visible = false;
            //                btnPreview.Visible = false;
                // load products to extra combo box
                LoadProductMasterToComboBox();
                stockOutDetailList.RemoveAt(0);
                bdsStockIn.EndEdit();

            }
            else
            {
            //                btnBarcode.Visible = true;
            //                numericUpDownBarcode.Visible = true;
            //                btnPreview.Visible = true;
                IList deptStockInDetails = stockOut.StockOutDetails;
                foreach (StockOutDetail detail in deptStockInDetails)
                {
                    if (detail.DelFlg == CommonConstants.DEL_FLG_NO)
                    {
                        stockOutDetailList.Add(detail);
                        //detail.OldQuantity = detail.Quantity;
                    }
                }

                for (int i = 0; i < dgvDeptStockOut.Columns.Count; i++)
                {
                    dgvDeptStockOut.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                    if (i != QUANTITY_POS
                            && i != PRICE_POS
                            && i != SELL_PRICE_POS)
                    {
                        dgvDeptStockOut.Columns[i].ReadOnly = true;
                    }
                }
            //                txtDexcription.Text = stockOut.Description;
            }
            stockOut.StockOutDetails =
                    ObjectConverter.ConvertToNonGenericList<StockOutDetail>(stockOutDetailList);
        }
Example #3
0
        private void TemporaryStockOutForm_Load(object sender, EventArgs e)
        {
            stockViewList = new StockViewCollection(bdsProductMasters);
            bdsProductMasters.DataSource = stockViewList;
            bdsProductMasters.ResetBindings(true);

            if (!DepartmentReturnForm)
            {
                stockDefectList = new StockCollection(bdsStockDefect);
                bdsStockDefect.DataSource = stockDefectList;
                bdsStockDefect.ResetBindings(true);

                stockOutList = new StockOutDetailCollection(bdsStockOut);
                bdsStockOut.DataSource = stockOutList;
                bdsStockOut.ResetBindings(true);
                LoadGoodsToCombo();
            }
            else
            {
                deptStockDefectList = new DepartmentStockDefectCollection(bdsStockDefect);
                bdsStockDefect.DataSource = deptStockDefectList;
                bdsStockDefect.ResetBindings(true);

                deptStockOutList = new DepartmentStockOutDetailCollection(bdsStockOut);
                bdsStockOut.DataSource = deptStockOutList;
                bdsStockOut.ResetBindings(true);

                rdoTraHang.Visible = false;
                rdoTamXuat.Visible = false;
                lblTitle.Text = " TRẢ HÀNG VỀ KHO CHÍNH";
                lblStockOut.Text = " Trả hàng về kho chính";
                LoadDeptGoodsToCombo();
            }
        }
Example #4
0
 private bool HasInList(Stock defect, StockOutDetailCollection list)
 {
     foreach (StockOutDetail detail in list)
     {
         if(detail.Product.ProductId == defect.Product.ProductId)
         {
             return true;
         }
     }
     return false;
 }
        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 StockOutDetail GetFromStockOutList(Stock stock, StockOutDetailCollection list)
 {
     foreach (StockOutDetail detail in list)
     {
         if(detail.Product.ProductId == stock.Product.ProductId)
         {
             return detail;
         }
     }
     return null;
 }