internal static void FillFromReader(CombinationProduct combinationProduct, SqlDataReader reader)
        {
            int colIndex = 0;
            colIndex = reader.GetOrdinal(CN_COMBINATION_ID);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.ID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_ID);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.ProductID = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_REFERENCE);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.ProductReference = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_EAN13_ID);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.ProductEAN13 = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_UPC);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.ProductUPC = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_SUPPLIER);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.SupplierRefernce = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_WHOLESALE_PRICE);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.WholesalePrice = reader.GetDecimal(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_IMPACT_ON_PRICE);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.ImpactOnPrice = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_IMPACT_ON_WEIGHT);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.ImpactOnWeight = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_INITIAL_STOCK);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.InitialStock = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_MINIMUM_QUANTITY);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.MinimumQuantity = reader.GetInt32(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_IS_DEFAULT);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.IsDefault = reader.GetBoolean(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_COLOR);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.Color = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(CN_COMBINATION_PRODUCT_IS_DELETED);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.IsDefault = reader.GetBoolean(colIndex);

            colIndex = reader.GetOrdinal(ECommerceDataMapperBase.CN_ECO_LAN_NAME);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.Location = reader.GetString(colIndex);

            colIndex = reader.GetOrdinal(ECommerceDataMapperBase.CN_ECO_LAN_LAN_ID);
            if (!reader.IsDBNull(colIndex))
                combinationProduct.LanguageID = reader.GetInt32(colIndex);
        }
        internal static CombinationProduct GetCombinationProduct(List<CombinationProduct> CombinationProducts, SqlDataReader reader)
        {
            int colIndex = 0;
            colIndex = reader.GetOrdinal(CN_COMBINATION_ID);
            int value = reader.GetInt32(colIndex);

            CombinationProduct CombinationProduct = CombinationProducts.Where(c => c.ID == value).FirstOrDefault();
            if (CombinationProduct == null)
            {
                CombinationProduct = new CombinationProduct();
                CombinationProducts.Add(CombinationProduct);
            }
            return CombinationProduct;
        }
        void btnSaveCombinationProductOtherLanguage_Click(object sender, EventArgs e)
        {
            try
            {
                if (SelecedCombinationProductId > 0)
                {
                    CombinationProduct combinationProduct =
                        CombinationProductManager.GetCombinationProduct(SelecedCombinationProductId, ucCombinationProductLanguage.SelectedLanguageID);

                    combinationProduct.Color = ucColorPicker.SelectedColor;
                    combinationProduct.ImpactOnPrice = Convert.ToInt32(txtImpactOnPrice.Text);
                    combinationProduct.ImpactOnWeight = Convert.ToInt32(txtImpactOnWeight.Text);
                    combinationProduct.InitialStock = Convert.ToInt32(txtCombinationInitialStock.Text);
                    combinationProduct.IsDefault = cbIsDefault.Checked;
                    combinationProduct.IsDeleted = false;
                    combinationProduct.LanguageID = ucCombinationProductLanguage.SelectedLanguageID;
                    combinationProduct.ModuleID = (int)CMSEnums.ECommerceModule.CombinationProduct;
                    combinationProduct.ProductID = SelecedProductId;

                    combinationProduct.MinimumQuantity = Convert.ToInt32(txtCombinationInitialQuantity.Text);
                    combinationProduct.PortalID = CMSContext.PortalID;
                    combinationProduct.ProductEAN13 = txtCombinationEan13.Text;
                    combinationProduct.ProductReference = txtProductReference.Text;
                    combinationProduct.ProductUPC = txtCombinationUPC.Text;

                    combinationProduct.SupplierRefernce = Convert.ToInt32(cddCombinationSupplier.SelectedValue);
                    combinationProduct.WholesalePrice = Convert.ToDecimal(txtWholesalePrice.Text);

                    CombinationProductManager.Update(combinationProduct);

                    CombinationProduct combinationProductOtherLanguage = new CombinationProduct();
                    combinationProductOtherLanguage.Location = txtCombinationLocation.Text;
                    combinationProductOtherLanguage.LanguageID = ucCombinationProductLanguage.SelectedLanguageID;
                    combinationProductOtherLanguage.ID = combinationProduct.ID;
                    combinationProductOtherLanguage.PortalID = CMSContext.PortalID;

                    CombinationProductManager.AddOtherLanguage(combinationProductOtherLanguage);

                    FillCombinationProduct(SelecedProductId);
                }
            }
            catch (Exception ex)
            {
                dvCombinationProductProblems.Visible = true;
                dvCombinationProductProblems.InnerText = ex.ToString();
            }
            finally
            {
                upnlCombinationProduct.Update();
                upnlCombinationProductDetails.Update();
            }

        }
 public static int Add(CombinationProduct combinationProduct)
 {
     return CombinationProductDataMapper.Add(combinationProduct);
 }
 public static void AddOtherLanguage(CombinationProduct combinationProduct)
 {
     CombinationProductDataMapper.AddOtherLanguage(combinationProduct);
 }
 public static void Update(CombinationProduct combinationProduct)
 {
     CombinationProductDataMapper.Update(combinationProduct);
 }