コード例 #1
0
ファイル: BaseStockOutForm.cs プロジェクト: DelLitt/opmscoral
        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();
            }
        }
コード例 #2
0
        private void DepartmentStockInExtra_Load(object sender, EventArgs e)
        {
            timer1.Start();
            cbbStockOutType.Enabled = false;
            btnReset.Enabled = false;
            cboProductMasters.Enabled = false;

            rdoFastStockOut.Checked = true;
            rdoRetail.Checked = true;
            IList list = new ArrayList();
            if (ClientSetting.IsSubStock())
            {
                list.Add(new StockDefectStatus {DefectStatusId = 7, DefectStatusName = "Xuất đi cửa hàng khác"});
            }
            else
            {
                list.Add(new StockDefectStatus { DefectStatusId = 4, DefectStatusName = "Xuất tạm để sửa hàng" });
                list.Add(new StockDefectStatus { DefectStatusId = 6, DefectStatusName = "Xuất trả về kho chính" });

            }
            DepartmentStockOutEventArgs eventArgs = new DepartmentStockOutEventArgs();
            EventUtility.fireEvent(LoadAllDepartments,this,eventArgs);
            string directDept = "";
            string marketDept = "";
            if(eventArgs.DepartmentsList!= null && eventArgs.DepartmentsList.Count > 0)
            {
                BindingSource bdsDepartment = new BindingSource();
                bdsDepartment.DataSource = typeof (Department);
                cboDepartment.DataSource = bdsDepartment;
                cboDepartment.DisplayMember = "DepartmentName";
                foreach (Department department in eventArgs.DepartmentsList)
                {
                    if (department.DepartmentId != CurrentDepartment.Get().DepartmentId)
                    {
                        /*if (!ClientSetting.IsSubStock())
                        {*/
                            bdsDepartment.Add(department);
                        /*}
                        else
                        {
                            string departmentId = department.DepartmentId.ToString();
                            string currentSubStock = CurrentDepartment.Get().DepartmentId.ToString();
                            if(currentSubStock.StartsWith(departmentId))
                            {
                                bdsDepartment.Add(department);
                                directDept = department.DepartmentName;
                            }
                            if(ClientSetting.MarketDept.Equals(departmentId))
                            {
                                bdsDepartment.Add(department);
                                marketDept = department.DepartmentName;
                            }
                        }*/

                    }
                }
                bdsDepartment.EndEdit();
                cboDepartment.Refresh();
                cboDepartment.Invalidate();
            }

            cbbStockOutType.DataSource = list;
            cbbStockOutType.DisplayMember = "DefectStatusName";
            /*if(!string.IsNullOrEmpty(directDept))
            {
                rdoFastStockOut.Text = " Xuất đến " + directDept;
            }*/
            /*foreach (Department department in cboDepartment.Items)
            {
                string departmentId = department.DepartmentId.ToString();
                string currentSubStock = CurrentDepartment.Get().DepartmentId.ToString();
                if (currentSubStock.StartsWith(departmentId))
                {
                    cboDepartment.SelectedItem = department;
                    cboDepartment.Enabled = false;
                    break;
                }
            }*/

            rdoFastStockOut_CheckedChanged(null, null);
            rdoStockOut_CheckedChanged(null, null);
            deptSODetailList = new DepartmentStockOutDetailCollection(bdsStockIn);
            bdsStockIn.DataSource = deptSODetailList;
            dgvDeptStockIn.DataError += new DataGridViewDataErrorEventHandler(dgvDeptStockIn_DataError);

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

            }
            else
            {
            //                btnBarcode.Visible = true;
            //                numericUpDownBarcode.Visible = true;
            //                btnPreview.Visible = true;
                IList deptStockInDetails = deptSO.DepartmentStockOutDetails;
                foreach (DepartmentStockOutDetail detail in deptStockInDetails)
                {
                    if (detail.DelFlg == CommonConstants.DEL_FLG_NO)
                    {
                        deptSODetailList.Add(detail);
                        //detail.OldQuantity = detail.Quantity;
                    }
                }

                for (int i = 0; i < dgvDeptStockIn.Columns.Count; i++)
                {
                    dgvDeptStockIn.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                    if (i != QUANTITY_POS
                            && i != PRICE_POS
                            && i != SELL_PRICE_POS)
                    {
                        dgvDeptStockIn.Columns[i].ReadOnly = true;
                    }
                }
            //                txtDexcription.Text = deptSO.Description;
            }
            deptSO.DepartmentStockOutDetails =
                    ObjectConverter.ConvertToNonGenericList<DepartmentStockOutDetail>(deptSODetailList);

            UpdateStockOutDescription();
            cboDepartment.Enabled = false;
            GlobalMessage message = (GlobalMessage)GlobalUtility.GetObject("GlobalMessage");
            message.HasNewMessageEvent += new EventHandler<GlobalMessageEventArgs>(Instance_HasNewMessageEvent);
        }
コード例 #3
0
ファイル: BaseStockOutForm.cs プロジェクト: DelLitt/opmscoral
 private bool HasInDeptList(DepartmentStockHistory defect, DepartmentStockOutDetailCollection list)
 {
     foreach (DepartmentStockOutDetail detail in list)
     {
         if (detail.Product.ProductId == defect.Product.ProductId)
         {
             return true;
         }
     }
     return false;
 }
コード例 #4
0
        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 = 6, DefectStatusName = "Xuất trả về kho chính" });
            //list.Add(new StockDefectStatus { DefectStatusId = 7, DefectStatusName = "Xuất đi cửa hàng khác" });

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

            deptSODetailList = new DepartmentStockOutDetailCollection(bdsStockIn);
            bdsStockIn.DataSource = deptSODetailList;
            dgvDeptStockIn.DataError += new DataGridViewDataErrorEventHandler(dgvDeptStockIn_DataError);

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

            }
            else
            {
            //                btnBarcode.Visible = true;
            //                numericUpDownBarcode.Visible = true;
            //                btnPreview.Visible = true;
                IList deptStockInDetails = deptSO.DepartmentStockOutDetails;
                foreach (DepartmentStockOutDetail detail in deptStockInDetails)
                {
                    if (detail.DelFlg == CommonConstants.DEL_FLG_NO)
                    {
                        deptSODetailList.Add(detail);
                        //detail.OldQuantity = detail.Quantity;
                    }
                }

                for (int i = 0; i < dgvDeptStockIn.Columns.Count; i++)
                {
                    dgvDeptStockIn.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                    if (i != QUANTITY_POS
                            && i != PRICE_POS
                            && i != SELL_PRICE_POS)
                    {
                        dgvDeptStockIn.Columns[i].ReadOnly = true;
                    }
                }
            //                txtDexcription.Text = deptSO.Description;
            }
            deptSO.DepartmentStockOutDetails =
                    ObjectConverter.ConvertToNonGenericList<DepartmentStockOutDetail>(deptSODetailList);
        }
コード例 #5
0
        private void DepartmentStockInExtra_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'masterDB.Department' table. You can move, or remove it, as needed.
            this.departmentTableAdapter.Fill(this.masterDB.Department);
            IList list = new ArrayList();
            if (ClientSetting.IsSubStock())
            {
                list.Add(new StockDefectStatus {DefectStatusId = 7, DefectStatusName = "Xuất đi cửa hàng khác"});
                cboDepartment.Visible = true;
                label2.Visible = true;
            }
            /*else
            {*/
            list.Add(new StockDefectStatus { DefectStatusId = 4, DefectStatusName = "Xuất tạm để sửa hàng" });
            list.Add(new StockDefectStatus { DefectStatusId = 6, DefectStatusName = "Xuất trả về kho chính" });
            list.Add(new StockDefectStatus { DefectStatusId = 9, DefectStatusName = "Xuất hàng mẫu" });

            /*}*/

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

            deptSODetailList = new DepartmentStockOutDetailCollection(bdsStockIn);
            bdsStockIn.DataSource = deptSODetailList;
            dgvDeptStockIn.DataError += new DataGridViewDataErrorEventHandler(dgvDeptStockIn_DataError);

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

            }
            else
            {
                //                btnBarcode.Visible = true;
                //                numericUpDownBarcode.Visible = true;
                //                btnPreview.Visible = true;
                IList deptStockInDetails = deptSO.DepartmentStockOutDetails;
                foreach (DepartmentStockOutDetail detail in deptStockInDetails)
                {
                    if (detail.DelFlg == CommonConstants.DEL_FLG_NO)
                    {
                        deptSODetailList.Add(detail);
                        //detail.OldQuantity = detail.Quantity;
                    }
                }

                for (int i = 0; i < dgvDeptStockIn.Columns.Count; i++)
                {
                    dgvDeptStockIn.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                    if (i != QUANTITY_POS
                            && i != PRICE_POS
                            && i != SELL_PRICE_POS)
                    {
                        dgvDeptStockIn.Columns[i].ReadOnly = true;
                    }
                }
                //                txtDexcription.Text = deptSO.Description;
            }
            deptSO.DepartmentStockOutDetails =
                    ObjectConverter.ConvertToNonGenericList<DepartmentStockOutDetail>(deptSODetailList);

            departmentBindingSource.Filter = " DEPARTMENT_ID <> " + CurrentDepartment.Get().DepartmentId;
            departmentTableAdapter.Fill(masterDB.Department);
            departmentBindingSource.ResetBindings(false);
            cboDepartment.Refresh();
            cboDepartment.Invalidate();
        }
コード例 #6
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();
            }
        }
コード例 #7
0
 private DepartmentStockOutDetail GetFromDepartmentStockOutList(DepartmentStock stock, DepartmentStockOutDetailCollection list)
 {
     foreach (DepartmentStockOutDetail detail in list)
     {
         if (detail.Product.ProductId == stock.Product.ProductId)
         {
             return detail;
         }
     }
     return null;
 }