public FRM_Product()
        {
            InitializeComponent();
            try
            {
                #region Fill SearchEdit By Data :
                WareHouseManager wh = new WareHouseManager();

                HelperClass.FillSearchLookUpByData(DefPurchaseWareHouse, wh.CreateTable(), WareHouseManager.WareHouseDetails.WareHouseName.ToString(),
                                                   WareHouseManager.WareHouseDetails.WareHouseCode.ToString());

                HelperClass.FillSearchLookUpByData(DefSalesWareHouse, wh.CreateTable(), WareHouseManager.WareHouseDetails.WareHouseName.ToString(),
                                                   WareHouseManager.WareHouseDetails.WareHouseCode.ToString());

                UnitManager unit = new UnitManager();

                HelperClass.FillSearchLookUpByData(DefWareHouseUnit, unit.CreateTable(), UnitManager.UnitDetails.UnitName.ToString(),
                                                   UnitManager.UnitDetails.UnitCode.ToString());

                HelperClass.FillSearchLookUpByData(DefPurchaseUnit, unit.CreateTable(), UnitManager.UnitDetails.UnitName.ToString(),
                                                   UnitManager.UnitDetails.UnitCode.ToString());

                HelperClass.FillSearchLookUpByData(DefSalesUnit, unit.CreateTable(), UnitManager.UnitDetails.UnitName.ToString(),
                                                   UnitManager.UnitDetails.UnitCode.ToString());

                #region Product Types :
                DataTable PrTypes = new DataTable();
                PrTypes.Columns.Add("TypeName", typeof(string));
                PrTypes.Rows.Add(ProductManager.ProductType.RM.ToString());
                PrTypes.Rows.Add(ProductManager.ProductType.PKG.ToString());
                PrTypes.Rows.Add(ProductManager.ProductType.PACK.ToString());
                PrTypes.Rows.Add(ProductManager.ProductType.SFG.ToString());
                PrTypes.Rows.Add(ProductManager.ProductType.FG.ToString());
                PrTypes.Rows.Add(ProductManager.ProductType.Service.ToString());
                PrTypes.Rows.Add(ProductManager.ProductType.CoProduct.ToString());

                HelperClass.FillSearchLookUpByData(ProductType, PrTypes, "TypeName", "TypeName");
                #endregion

                HelperClass.FillSearchLookUpByData(PrGroup, new ProductGroupManager().CreateTable(), ProductGroupManager.GroupDetails.GroupName.ToString(),
                                                   ProductGroupManager.GroupDetails.GroupCode.ToString());
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void FRM_WareHouse_Load(object sender, EventArgs e)
        {
            try
            {
                #region Fill All ComboBox By Data :
                SiteManager.FillSiteComboBox(cmbSite);
                EmployeeManager.FillEmployeeComboBox(cmbManager);
                cmbType.DataSource = Enum.GetValues(typeof(WareHouseManager.WareHouseType));
                #endregion

                #region Fill Grid By Data :
                WareHouseGrid.DataSource = warehouse.CreateTable();
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }