private void ProductMasterSearchOrCreateForm_Load(object sender, EventArgs e)
        {
            var eventArgs = new ProductMasterSearchOrCreateEventArgs();
            EventUtility.fireEvent(InitProductMasterSearchOrCreateEvent, sender, eventArgs);

            AddListItemToCombo(productMasterControl.cbbProductType,
                productMasterSearchControl.cbbProductType,
                eventArgs.ProductTypeList,
                "TypeName",
                productMasterControl.cbbProductType.Text,
                productMasterSearchControl.cbbProductType.Text);

            AddListItemToCombo(productMasterControl.cbbProductSize,
                productMasterSearchControl.cbbProductSize,
                eventArgs.ProductSizeList,
                "SizeName",
                productMasterControl.cbbProductSize.Text,
                productMasterSearchControl.cbbProductSize.Text);

            AddListItemToCombo(productMasterControl.cbbProductColor,
                productMasterSearchControl.cbbProductColor,
                eventArgs.ProductColorList,
                "ColorName",
                productMasterControl.cbbProductColor.Text,
                productMasterSearchControl.cbbProductColor.Text);

            AddListItemToCombo(productMasterControl.cbbCountry,
                productMasterSearchControl.cbbCountry,
                eventArgs.CountryList,
                "CountryName",
                productMasterControl.cbbCountry.Text,
                productMasterSearchControl.cbbCountry.Text);

            AddListItemToCombo(productMasterControl.cbbManufacturer,
                productMasterSearchControl.cbbManufacturer,
                eventArgs.ManufacturerList,
                "ManufacturerName",
                productMasterControl.cbbManufacturer.Text,
                productMasterSearchControl.cbbManufacturer.Text);

            AddListItemToCombo(productMasterControl.cbbDistributor,
                productMasterSearchControl.cbbDistributor,
                eventArgs.DistributorList,
                "DistributorName",
                productMasterControl.cbbDistributor.Text,
                productMasterSearchControl.cbbDistributor.Text);

            AddListItemToCombo(productMasterControl.cbbPackager,
                productMasterSearchControl.cbbPackager,
                eventArgs.PackagerList,
                "PackagerName",
                productMasterControl.cbbPackager.Text,
                productMasterSearchControl.cbbPackager.Text);

            SelectedProductMaster = null;
            dgvProductMaster.DataSource = null;
            if (ProductMasterList != null && ProductMasterList.Count > 0)
            {
                dgvProductMaster.DataSource = ProductMasterList;
                for (int i = 0; i < ProductMasterList.Count; i++)
                {
                    dgvProductMaster[0, i].Value = i;
                }
            }
        }
        private void btnCreate_Click(object sender, EventArgs e)
        {
            var productMaster = new ProductMaster
                                    {
                                        ProductName = productMasterControl.txtProductName.Text,
                                        Packager = productMasterControl.cbbPackager.SelectedIndex > 0 ? ((Packager) productMasterControl.cbbPackager.SelectedItem) : null,
                                        ProductSize = productMasterControl.cbbProductSize.SelectedIndex > 0 ? ((ProductSize) productMasterControl.cbbProductSize.SelectedItem) : null,
                                        ProductType = productMasterControl.cbbProductType.SelectedIndex > 0 ? ((ProductType) productMasterControl.cbbProductType.SelectedItem) : null,
                                        ProductColor = productMasterControl.cbbProductColor.SelectedIndex > 0 ?
                                            ((ProductColor) productMasterControl.cbbProductColor.SelectedItem) : null,
                                        Country = productMasterControl.cbbCountry.SelectedIndex > 0 ? ((Country) productMasterControl.cbbCountry.SelectedItem) : null,
                                        Manufacturer = productMasterControl.cbbManufacturer.SelectedIndex > 0 ? ((Manufacturer)productMasterControl.cbbManufacturer.SelectedItem) : null,
                                        Distributor = productMasterControl.cbbDistributor.SelectedIndex > 0 ? ((Distributor)productMasterControl.cbbDistributor.SelectedItem) : null
                                    };

            var eventArgs = new ProductMasterSearchOrCreateEventArgs { ProductMaster = productMaster };
            EventUtility.fireEvent(SaveProductMasterEvent, sender, eventArgs);
            SelectedProductMaster = productMaster;
            Close();
        }
 private void btnSearch_Click(object sender, EventArgs e)
 {
     var eventArgs = new ProductMasterSearchOrCreateEventArgs
                         {
                             ProductMasterId = productMasterSearchControl.txtProductMasterId.Text,
                             Packager = productMasterControl.cbbPackager.SelectedIndex > 0 ? ((Packager)productMasterControl.cbbPackager.SelectedItem) : null,
                             ProductMasterName = productMasterSearchControl.txtProductName.Text,
                             ProductSize = productMasterSearchControl.cbbProductSize.SelectedIndex > 0 ? ((ProductSize)productMasterControl.cbbProductSize.SelectedItem) : null,
                             ProductType = productMasterSearchControl.cbbProductType.SelectedIndex > 0 ? ((ProductType)productMasterControl.cbbProductType.SelectedItem) : null,
                             ProductColor = productMasterSearchControl.cbbProductColor.SelectedIndex > 0 ?
                                 ((ProductColor)productMasterSearchControl.cbbProductColor.SelectedItem) : null,
                             Country = productMasterControl.cbbCountry.SelectedIndex > 0 ? ((Country)productMasterControl.cbbCountry.SelectedItem) : null,
                             Manufacturer = productMasterControl.cbbManufacturer.SelectedIndex > 0 ? ((Manufacturer)productMasterControl.cbbManufacturer.SelectedItem) : null,
                             Distributor = productMasterControl.cbbDistributor.SelectedIndex > 0 ? ((Distributor)productMasterControl.cbbDistributor.SelectedItem) : null
                         };
     EventUtility.fireEvent(SearchProductMasterEvent, sender, eventArgs);
     ProductMasterList = eventArgs.ProductMasterList;
     dgvProductMaster.DataSource = ProductMasterList;
     /*for (int i = 0; i < ProductMasterList.Count; i++)
     {
         dgvProductMaster[0, i].Value = i;
     }*/
 }
 void _productMasterSearchOrCreateView_SearchCommonProductMasterEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
 {
     var criteria = new ObjectCriteria();
     if (!string.IsNullOrEmpty(e.ProductMasterId))
     {
         /*long value = 0;
         Int64.TryParse(e.ProductMasterId, out value);*/
         criteria.AddLikeCriteria("ProductMasterId", "%" + e.ProductMasterId + "%");
     }
     criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
     criteria.AddLikeCriteria("ProductName", "%" + e.ProductMasterName + "%");
     if (e.ProductType != null && e.ProductType.TypeId > 0)
     {
         criteria.AddEqCriteria("ProductType.TypeId", e.ProductType.TypeId);
     }
     if (e.ProductSize != null && e.ProductSize.SizeId > 0)
     {
         criteria.AddEqCriteria("ProductSize.SizeId", e.ProductSize.SizeId);
     }
     if (e.ProductColor != null && e.ProductColor.ColorId > 0)
     {
         criteria.AddEqCriteria("ProductColor.ColorId", e.ProductColor.ColorId);
     }
     if (e.Country != null && e.Country.CountryId > 0)
     {
         criteria.AddEqCriteria("Country.CountryId", e.Country.CountryId);
     }
     IList list = ProductMasterLogic.FindAll(criteria);
     IList returnList = new ArrayList();
     if(list!=null && list.Count > 0)
     {
         foreach (ProductMaster master in list)
         {
             AddNonDuplicateItem(returnList, master);
         }
     }
     e.ProductMasterList = returnList;
 }
        void _productMasterSearchOrCreateView_SearchRelevantProductsEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
        {
            var subCriteria = new SubObjectCriteria("ProductMaster");
            subCriteria.AddEqCriteria("ProductName", e.ProductMasterName);

            var criteria = new ObjectCriteria(true);
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            criteria.AddSubCriteria("ProductMaster", subCriteria);
            IList list = ProductLogic.FindAll(criteria);
            e.ProductList = list;
        }
        private void productMasterView_SearchProductMasterEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
        {
            var criteria = new ObjectCriteria();
            if (!string.IsNullOrEmpty(e.ProductMasterId))
            {
                /*long value = 0;
                Int64.TryParse(e.ProductMasterId, out value);*/
                criteria.AddLikeCriteria("ProductMasterId", "%" + e.ProductMasterId + "%");
            }
            criteria.AddEqCriteria("DelFlg", CommonConstants.DEL_FLG_NO);
            criteria.AddLikeCriteria("ProductName", "%" +e.ProductMasterName + "%");
            if (e.ProductType != null && e.ProductType.TypeId > 0)
            {
                criteria.AddEqCriteria("ProductType.TypeId", e.ProductType.TypeId);
            }
            if (e.ProductSize != null && e.ProductSize.SizeId > 0)
            {
                criteria.AddEqCriteria("ProductSize.SizeId", e.ProductSize.SizeId);
            }
            if (e.ProductColor != null && e.ProductColor.ColorId > 0)
            {
                criteria.AddEqCriteria("ProductColor.ColorId", e.ProductColor.ColorId);
            }
            if (e.Country != null && e.Country.CountryId > 0)
            {
                criteria.AddEqCriteria("Country.CountryId", e.Country.CountryId);
            }

            e.ProductMasterList = ProductMasterLogic.FindAll(criteria);
        }
 private void productMasterView_SelectProductMasterEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
 {
 }
 private void productMasterView_InitProductMasterSearchOrCreateEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
 {
     var criteria = new ObjectCriteria();
     criteria.AddEqCriteria("DelFlg", (long)0);
     e.ProductTypeList = ProductTypeLogic.FindAll(criteria);
     e.ProductTypeList.Insert(0, new ProductType());
     e.ProductSizeList = ProductSizeLogic.FindAll(criteria);
     e.ProductSizeList.Insert(0, new ProductSize());
     e.ProductColorList = ProductColorLogic.FindAll(criteria);
     e.ProductColorList.Insert(0, new ProductColor());
     e.CountryList = CountryLogic.FindAll(criteria);
     e.CountryList.Insert(0, new Country());
     e.ManufacturerList = ManufacturerLogic.FindAll(criteria);
     e.ManufacturerList.Insert(0, new Manufacturer());
     e.PackagerList = PackagerLogic.FindAll(criteria);
     e.PackagerList.Insert(0, new Packager());
     e.DistributorList = DistributorLogic.FindAll(criteria);
     e.DistributorList.Insert(0, new Distributor());
 }
 private void productMasterView_SaveProductMasterEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
 {
     e.ProductMaster.CreateDate = DateTime.Now;
     e.ProductMaster.UpdateDate = DateTime.Now;
     e.ProductMaster = ProductMasterLogic.Add(e.ProductMaster);
 }
 public void productMasterView_OpenProductMasterSearchOrCreateEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
 {
     var productMasterForm = GlobalUtility.GetOnlyChildFormObject<ProductMasterSearchOrCreateForm>(e.ParentForm, FormConstants.PRODUCT_MASTER_SEARCH_OR_CREATE_FORM);
     productMasterForm.ShowDialog();
     e.ProductMaster = productMasterForm.SelectedProductMaster;
 }
 private void productMasterView_SelectProductMasterEvent(object sender, ProductMasterSearchOrCreateEventArgs e)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 12
0
        private void ProductMasterSearchForm_Load(object sender, EventArgs e)
        {
            var eventArgs = new ProductMasterSearchOrCreateEventArgs();
            EventUtility.fireEvent(InitProductMasterSearchOrCreateEvent, sender, eventArgs);

            AddListItemToCombo(
                productMasterSearchControl.cbbProductType,
                eventArgs.ProductTypeList,
                "TypeName",
                productMasterSearchControl.cbbProductType.Text);

            AddListItemToCombo(
                productMasterSearchControl.cbbProductSize,
                eventArgs.ProductSizeList,
                "SizeName",
                productMasterSearchControl.cbbProductSize.Text);

            AddListItemToCombo(
                productMasterSearchControl.cbbProductColor,
                eventArgs.ProductColorList,
                "ColorName",
                productMasterSearchControl.cbbProductColor.Text);

            AddListItemToCombo(
                productMasterSearchControl.cbbCountry,
                eventArgs.CountryList,
                "CountryName",
                productMasterSearchControl.cbbCountry.Text);

            AddListItemToCombo(
                productMasterSearchControl.cbbManufacturer,
                eventArgs.ManufacturerList,
                "ManufacturerName",
                productMasterSearchControl.cbbManufacturer.Text);

            AddListItemToCombo(
                productMasterSearchControl.cbbDistributor,
                eventArgs.DistributorList,
                "DistributorName",
                productMasterSearchControl.cbbDistributor.Text);

            AddListItemToCombo(
                productMasterSearchControl.cbbPackager,
                eventArgs.PackagerList,
                "PackagerName",
                productMasterSearchControl.cbbPackager.Text);
        }
Ejemplo n.º 13
0
 private void dgvProductMaster_SelectionChanged(object sender, EventArgs e)
 {
     ProductList.Clear();
     if (dgvProductMaster.CurrentRow != null)
     {
         DataGridViewRow row = dgvProductMaster.CurrentRow;
         var eventArgs = new ProductMasterSearchOrCreateEventArgs
         {
             ProductMasterName = row.Cells["ProductName"].Value.ToString()
         };
         EventUtility.fireEvent(SearchRelevantProductsEvent, this, eventArgs);
         if (eventArgs.ProductList != null && eventArgs.ProductList.Count > 0)
         {
             foreach (Product product in eventArgs.ProductList)
             {
                 ProductList.Add(product);
             }
             bdsProduct.ResetBindings(false);
             dgvProduct.Refresh();
             dgvProduct.Invalidate();
         }
     }
 }
Ejemplo n.º 14
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     var eventArgs = new ProductMasterSearchOrCreateEventArgs
     {
         ProductMasterId = productMasterSearchControl.txtProductMasterId.Text,
         Packager = productMasterSearchControl.cbbPackager.SelectedIndex > 0 ? ((Packager)productMasterSearchControl.cbbPackager.SelectedItem) : null,
         ProductMasterName = productMasterSearchControl.txtProductName.Text,
         ProductSize = productMasterSearchControl.cbbProductSize.SelectedIndex > 0 ? ((ProductSize)productMasterSearchControl.cbbProductSize.SelectedItem) : null,
         ProductType = productMasterSearchControl.cbbProductType.SelectedIndex > 0 ? ((ProductType)productMasterSearchControl.cbbProductType.SelectedItem) : null,
         ProductColor = productMasterSearchControl.cbbProductColor.SelectedIndex > 0 ?
             ((ProductColor)productMasterSearchControl.cbbProductColor.SelectedItem) : null,
         Country = productMasterSearchControl.cbbCountry.SelectedIndex > 0 ? ((Country)productMasterSearchControl.cbbCountry.SelectedItem) : null,
         Manufacturer = productMasterSearchControl.cbbManufacturer.SelectedIndex > 0 ? ((Manufacturer)productMasterSearchControl.cbbManufacturer.SelectedItem) : null,
         Distributor = productMasterSearchControl.cbbDistributor.SelectedIndex > 0 ? ((Distributor)productMasterSearchControl.cbbDistributor.SelectedItem) : null,
         Barcode = productMasterSearchControl.txtBarcode.Text
     };
     EventUtility.fireEvent(SearchCommonProductMasterEvent, sender, eventArgs);
     ProductMasterList = eventArgs.ProductMasterList;
     dgvProductMaster.DataSource = ProductMasterList;
     CurrentProductMasterSearchOrCreateEventArgs = eventArgs;
 }