/// <summary>
 /// Save Style Colors.
 /// </summary>
 /// <param name="Style"></param>                  
 /// <param name="Colors"></param>
 public void Save(ItemStyle Style, List<Color> Colors)
 {
     using (DbManager db = new DbManager())
     {
         foreach (Color color in Colors)
         {
             var style_color = new StyleColor{
                 ColorCode = color.ColorCode,
                 StyleNumber = Style.StyleNumber,
                 DateCreated = DateTime.Now,
             };
             Accessor.Query.Insert(db, style_color);
         }
     }
 }
 /// <summary>
 /// Save Style Sizes.
 /// </summary>
 /// <param name="Style"></param>                  
 /// <param name="Colors"></param>
 public void Save(ItemStyle Style, List<Size> Sizes)
 {
     using (DbManager db = new DbManager())
     {
         foreach (Size size in Sizes)
         {
             var style_size = new StyleSize{
                 SizeCode = size.SizeCode,
                 StyleNumber = Style.StyleNumber,
                 DateCreated = DateTime.Now
             };
             Accessor.Query.Insert(db, style_size);
         }
     }
 }
        protected void btnSaveStyle_Click(object sender, EventArgs e)
        {
            decimal SRP = 0;
            decimal CostPrice = 0;
            if (string.IsNullOrEmpty(txtSRP.Text))
            {
                SRP = 0;
            }
            else
            {
                SRP = decimal.Parse(txtSRP.Text);
            }

            if (string.IsNullOrEmpty(txtCostPrice.Text))
            {
                CostPrice = 0;
            }
            else
            {
                CostPrice = decimal.Parse(txtCostPrice.Text);
            }
            ItemStyle NewGenericStyle = new ItemStyle
            {
               AP_type = rdioTopOrBottom.SelectedValue,
                Brand = dlBrandsForStyleNumber.SelectedValue,
                Description = txtStyleDescription.Text ,
                Fitting =DDLFittings.SelectedItem.Text,
                RecordNo =0,
                StyleNumber = txtStyleNumber.Text,
                SubFitting =DDLSubFitting.SelectedValue,
                IsApprove = "Yes" ,
                IsGeneric = true,
                IsActive = true ,
                Fabric = dlFabricsForStyleNumber.SelectedItem.Text,
                SRP = SRP,
                CostPrice = CostPrice
            };

            StyleManager.Save(NewGenericStyle);

            Response.Redirect("~/Marketing/GenericStylesManagementPanel.aspx");
        }
 protected void btnUpdateGeneratedSKUs_Click(object sender, EventArgs e)
 {
     try
     {
         STYLE_ = StyleManager.GetStyleNumberByItemStyle(gvProductList.SelectedRow.Cells[3].Text);
     }
     catch (Exception)
     {
         STYLE_ = null;
     }
 }
        private void SaveStyelNumber(string Status)
        {
            try
            {
                decimal COST_PRICE = 0;
                decimal SRP = 0;
                if (!string.IsNullOrEmpty(txtSRP.Text))
                {
                    SRP = decimal.Parse(txtSRP.Text);
                }
                if (!string.IsNullOrEmpty(txtCostPrice.Text))
                {
                    COST_PRICE = decimal.Parse(txtCostPrice.Text);
                }

                var style = new ItemStyle
                {
                    StyleNumber = txtStyleNumber.Text,
                    Description = txtStyleDescription.Text,
                    IsApprove = Status,
                    Brand = dlBrandsForStyleNumber.SelectedValue,
                    CostPrice = COST_PRICE,
                    SRP = SRP,
                    AP_type = rdioTopOrBottom.SelectedValue,
                    Fabric = dlFabricsForStyleNumber.SelectedItem.Text,
                    IsActive = true,
                    IsGeneric = false,
                    Fitting = DDLFittings.SelectedItem.Text,
                    SubFitting = DDLSubFitting.SelectedValue
                };
                StyleManager.Save(style);
            }
            catch (Exception)
            {
                StringBuilder errorMsg = new StringBuilder();
                    errorMsg.Append("<br />Error during Insertion of new Style! <br /> Please check your data prerequisite!");
                    lblErrorMessage.Text =(errorMsg.ToString());
                    Label1_ModalPopupExtender.Show();
                    return;
            }
        }
 /// <summary>
 /// Update Sytyle Number Status.
 /// </summary>
 /// <param name="style">Style</param>
 private void SaveStyelNumber(ItemStyle style)
 {
     style.IsApprove = "Yes";
     StyleManager.Save(style);
 }