Exemple #1
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            int            AdminId = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["AdminSession"].ToString()].ToString());
            Administrators _admin  = context.Administrator.ToList().Where(m => m.Administrators_Id == AdminId).FirstOrDefault();

            int     prdId    = Convert.ToInt32(lblProductId.Text);
            Product _Product = context.Product.ToList().Where(m => m.Product_Id == prdId).FirstOrDefault();

            if (_Product.Product_Status != eProductStatus.Rejected.ToString())
            {
                _Product.Product_Status       = eProductStatus.Rejected.ToString();
                context.Entry(_Product).State = System.Data.Entity.EntityState.Modified;
                context.SaveChanges();
                ProductHelper.CreateProductFlow(_Product.Product_Id, _Product.Product_Title, _admin.Administrators_Id, _admin.FullName, "Product " + _Product.Product_Status + " Due to : " + txtReasonReject.Text, _Product.Product_Status);
                LoadDetail(_Product.Product_Id.ToString());
                pnlErrorMessage.Attributes.Remove("class");
                pnlErrorMessage.Attributes["class"] = "alert alert-success alert-dismissable";
                pnlErrorMessage.Visible             = true;
                lblMessage.Text = "Success!!! Product Rejected successfully, Product Status Changed to " + _Product.Product_Status;
            }
            else
            {
                pnlErrorMessage.Attributes.Remove("class");
                pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                pnlErrorMessage.Visible             = true;
                lblMessage.Text = "Oops!!! You cannot the Reject the product, because Product Already in " + _Product.Product_Status + " Status.";
            }
        }
        protected void btnProceedToSubmit_Click(object sender, EventArgs e)
        {
            int            AdminId = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["AdminSession"].ToString()].ToString());
            Administrators _admin  = bAdministrator.List().Where(m => m.Administrators_Id == AdminId).FirstOrDefault();

            Product Product = new Product()
            {
                Store_Id               = _admin.Store_Id,
                Product_Title          = txtTitle.Text,
                Product_Description    = txtDescription.Content,
                Product_Specification  = txtSpecification.Content,
                Administrators_Id      = _admin.Administrators_Id,
                Product_Qty            = Convert.ToInt32(txtQuantity.Text),
                Product_Qty_Alert      = Convert.ToInt32(txtAlert.Text),
                Product_Delivery_Time  = Convert.ToInt32(txtProductDelieveredIn.Text),
                Product_Max_Purchase   = Convert.ToInt32(txtMaxPurchase.Text),
                Product_Mkt_Price      = Convert.ToDecimal(txtMarketPrice.Text),
                Product_Our_Price      = Convert.ToDecimal(txtOurPrice.Text),
                Product_ShippingCharge = Convert.ToDecimal(txtShippingCharge.Text),
                Product_Has_Size       = (rdbHasSize.SelectedValue == "Yes") ? true : false,
                Product_Size           = (rdbHasSize.SelectedValue == "Yes") ? txtSize.Text : "No Size",
                Product_Avail_ZipCode  = (txtZipcode.Text != "") ? txtZipcode.Text : "0",
                Product_Discount       = Convert.ToDecimal(txtDiscount.Text),
                SubCategory_Id         = Convert.ToInt32(ddlCategory.SelectedValue),
                Product_CreatedDate    = DateTime.Now,
                Product_UpdatedDate    = DateTime.Now,
                Product_Status         = eProductStatus.ReviewPending.ToString(),
                Store_Rating           = (txtRating.Text != "") ? Convert.ToInt32(txtRating.Text) : 1
            };

            bProduct.Create(Product);

            if (string.IsNullOrEmpty(Product.ErrorMessage))
            {
                ProductHelper.CreateProductFlow(Product.Product_Id, Product.Product_Title, _admin.Administrators_Id, _admin.FullName, "New Product Created and Pending for Review", Product.Product_Status);

                ProductBanners ProductBanner = new ProductBanners()
                {
                    Product_Id                 = Product.Product_Id,
                    Administrators_Id          = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["AdminSession"].ToString()].ToString()),
                    Product_Banner_Default     = 1,
                    Product_Banner_Photo       = "content/noimage.png",
                    Product_Banner_CreatedDate = DateTime.Now,
                    Product_Banner_UpdatedDate = DateTime.Now
                };

                bProduct.CreateProductBanner(ProductBanner);

                Response.Redirect("/administration/product/productsdetailstatic.aspx?SavePrdId=1000&Productid=" + Product.Product_Id);
            }
            else
            {
                pnlErrorMessage.Attributes.Remove("class");
                pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                pnlErrorMessage.Visible             = true;
                lblMessage.Text = "Product cannot be created. " + Product.ErrorMessage;
            }
        }
Exemple #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                int           subCatId     = Convert.ToInt32(hdnCatId.Value);
                int           catId        = Convert.ToInt32(hdnCurrentSubCatCatId.Value);
                SubCategories _otherSubCat = bSubCategory.List().Where(m => m.Category_Id == catId && m.SubCategory_Id != subCatId & m.SubCategory_Title == txtCategory.Text).FirstOrDefault();
                int           adminId      = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["AdminSession"].ToString()]);
                if (_otherSubCat == null)
                {
                    SubCategories SubCategories = bSubCategory.List().Where(m => m.SubCategory_Id == subCatId).FirstOrDefault();
                    SubCategories.SubCategory_Title       = txtCategory.Text;
                    SubCategories.SubCategory_UpdatedDate = DateTime.Now;
                    SubCategories.Administrators_Id       = adminId;
                    SubCategories.Category_Id             = Convert.ToInt32(ddlCategory.SelectedValue);
                    SubCategories.SubCategory_Status      = (chkIsActive.Checked) ? eStatus.Active.ToString() : eStatus.InActive.ToString();

                    SubCategories = bSubCategory.Update(SubCategories);

                    if (string.IsNullOrEmpty(SubCategories.ErrorMessage) && SubCategories.SubCategory_Status == eStatus.InActive.ToString())
                    {
                        List <Product> products = new List <Product>();
                        products = bProduct.List().Where(m => m.Product_Status == eProductStatus.Published.ToString() && m.SubCategory.SubCategory_Id == SubCategories.SubCategory_Id).ToList();

                        foreach (var item in products)
                        {
                            item.Product_Status = eProductStatus.ReviewPending.ToString();
                            bProduct.Update(item);
                            ProductHelper.CreateProductFlow(item.Product_Id, item.Product_Title, adminId, "System", "Sub Category In Active : Product Updated and set to Review Pending Status", item.Product_Status);
                            bProduct.DeleteTopEight(item.Product_Id);
                            bProduct.DeleteProductFeature(item.Product_Id);
                            bProduct.DeleteCart(item.Product_Id);
                        }
                    }

                    ActivityHelper.Create("Update Sub Category", "Sub Category Updated On " + DateTime.Now.ToString("D") + " Successfully and Title is " + SubCategories.SubCategory_Title + ".", adminId);

                    Response.Redirect("/administration/categories/subcategory.aspx?id=2000&redirecturl=admin-category-RachnaTeracotta");
                }
                else
                {
                    pnlErrorMessage.Attributes.Remove("class");
                    pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                    pnlErrorMessage.Visible             = true;
                    lblMessage.Text = "Oops!! Sub Category not updated successfully, sub category name should not be same as other.";
                }
            }
            catch (Exception ex)
            {
                pnlErrorMessage.Attributes.Remove("class");
                pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                pnlErrorMessage.Visible             = true;
                lblMessage.Text = "Oops!! " + ex.Message.ToString();
            }
        }
        protected void btnProceedToSubmit_Click(object sender, EventArgs e)
        {
            int            AdminId = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["VendorSession"].ToString()].ToString());
            Administrators _admin  = bAdministrator.List().ToList().Where(m => m.Administrators_Id == AdminId).FirstOrDefault();

            int     prdId   = Convert.ToInt32(hdnProductId.Value);
            Product Product = bProduct.List().ToList().Where(m => m.Product_Id == prdId).FirstOrDefault();

            Product.Store_Id = _admin.Store_Id;
            if (Product.Product_Title != txtTitle.Text || Product.Product_Description != txtDescription.Content || Product.Product_Specification != txtSpecification.Content)
            {
                Product.Product_Title         = txtTitle.Text;
                Product.Product_Description   = txtDescription.Content;
                Product.Product_Specification = txtSpecification.Content;
                Product.Product_Status        = eProductStatus.ReviewPending.ToString();
            }
            Product.Administrators_Id      = _admin.Administrators_Id;
            Product.Product_Qty            = Convert.ToInt32(txtQuantity.Text);
            Product.Product_Qty_Alert      = Convert.ToInt32(txtAlert.Text);
            Product.Product_Delivery_Time  = Convert.ToInt32(txtProductDelieveredIn.Text);
            Product.Product_Max_Purchase   = Convert.ToInt32(txtMaxPurchase.Text);
            Product.Product_Mkt_Price      = Convert.ToDecimal(txtMarketPrice.Text);
            Product.Product_Our_Price      = Convert.ToDecimal(txtOurPrice.Text);
            Product.Product_ShippingCharge = Convert.ToDecimal(txtShippingCharge.Text);
            Product.Product_Has_Size       = (rdbHasSize.SelectedValue == "Yes") ? true : false;
            Product.Product_Size           = (rdbHasSize.SelectedValue == "Yes") ? txtSize.Text : "No Size";
            Product.Product_Avail_ZipCode  = (txtZipcode.Text != "") ? txtZipcode.Text : "0";
            Product.SubCategory_Id         = Convert.ToInt32(ddlCategory.SelectedValue);
            Product.Product_Discount       = Convert.ToDecimal(txtDiscount.Text);
            Product.Product_UpdatedDate    = DateTime.Now;
            Product.Store_Rating           = (txtRating.Text != "") ? Convert.ToInt32(txtRating.Text) : 1;

            bProduct.Update(Product);

            if (string.IsNullOrEmpty(Product.ErrorMessage))
            {
                ProductHelper.CreateProductFlow(Product.Product_Id, Product.Product_Title, _admin.Administrators_Id, _admin.FullName, "Product Updated and set to Review Pending Status", Product.Product_Status);
                bProduct.DeleteTopEight(Product.Product_Id);
                bProduct.DeleteProductFeature(Product.Product_Id);
                bProduct.DeleteCart(Product.Product_Id);
                Response.Redirect("/adminvendor/product/productsdetailstatic.aspx?SavePrdId=2000&Productid=" + Product.Product_Id);
            }
            else
            {
                pnlErrorMessage.Attributes.Remove("class");
                pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                pnlErrorMessage.Visible             = true;
                lblMessage.Text = "Product cannot be updated. " + Product.ErrorMessage;
            }
        }
Exemple #5
0
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            int            AdminId = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["AdminSession"].ToString()].ToString());
            Administrators _admin  = context.Administrator.ToList().Where(m => m.Administrators_Id == AdminId).FirstOrDefault();

            int     prdId    = Convert.ToInt32(lblProductId.Text);
            Product _Product = context.Product.ToList().Where(m => m.Product_Id == prdId).FirstOrDefault();


            List <ProductBanners> ProductBanners = context.ProductBanner.Where(m => m.Product_Id == _Product.Product_Id).ToList();

            if (ProductBanners.Count() > 1 && (!(ProductBanners[0].Product_Banner_Photo == "content/noimage.png" && ProductBanners[0].Product_Banner_Default == 1)))
            {
                string currentStatus = _Product.Product_Status;
                if (_Product.Product_Status != eProductStatus.Published.ToString())
                {
                    _Product.Product_Status = ProductHelper.GetProductStatus(currentStatus);

                    context.Entry(_Product).State = System.Data.Entity.EntityState.Modified;
                    context.SaveChanges();

                    ProductHelper.CreateProductFlow(_Product.Product_Id, _Product.Product_Title, _admin.Administrators_Id, _admin.FullName, "Product Updated from" + currentStatus + " to " + _Product.Product_Status, _Product.Product_Status);
                    LoadDetail(_Product.Product_Id.ToString());
                    pnlErrorMessage.Attributes.Remove("class");
                    pnlErrorMessage.Attributes["class"] = "alert alert-success alert-dismissable";
                    pnlErrorMessage.Visible             = true;
                    lblMessage.Text = "Success!!! Product Updated Successfully and Product Status Set to " + _Product.Product_Status
                                      + " Status, from " + currentStatus + " Status";
                }
                else
                {
                    pnlErrorMessage.Attributes.Remove("class");
                    pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                    pnlErrorMessage.Visible             = true;
                    lblMessage.Text = "Oops!!! You cannot Update the product status to " + _Product.Product_Status + " from "
                                      + currentStatus + " Because, Product status is in published status. You can reject the product.";
                }
            }
            else
            {
                pnlErrorMessage.Attributes.Remove("class");
                pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                pnlErrorMessage.Visible             = true;
                lblMessage.Text = "Oops!!! You cannot Update the product status to " + _Product.Product_Status
                                  + " Because, there is no enough product banner available(Bnner should not be no image banner and also allease Minimum two banners required). Product should not have default banner.";
            }
        }
Exemple #6
0
        private void InsertExcelRecords(string FilePath)
        {
            List <Product> _products   = new List <Product>();
            var            csvData     = System.IO.File.ReadAllLines(FilePath).Skip(1);
            int            insertCount = 0;
            int            updateCount = 0;

            try
            {
                //Execute a loop over the rows.
                foreach (string row in csvData)
                {
                    if (!string.IsNullOrEmpty(row))
                    {
                        if (row != ",,,,,,,,,,,,,,,,")
                        {
                            _products.Add(new Product
                            {
                                Product_Id             = Convert.ToInt32(row.Split(',')[0]),
                                SubCategory_Id         = Convert.ToInt32(row.Split(',')[1]),
                                Product_Title          = row.Split(',')[2],
                                Product_Description    = row.Split(',')[3],
                                Product_Specification  = row.Split(',')[4],
                                Product_Qty            = Convert.ToInt32(row.Split(',')[5]),
                                Product_Qty_Alert      = Convert.ToInt32(row.Split(',')[6]),
                                Product_Delivery_Time  = Convert.ToInt32(row.Split(',')[7]),
                                Product_Max_Purchase   = Convert.ToInt32(row.Split(',')[8]),
                                Product_Mkt_Price      = Convert.ToDecimal(row.Split(',')[9]),
                                Product_Our_Price      = Convert.ToDecimal(row.Split(',')[10]),
                                Product_ShippingCharge = Convert.ToDecimal(row.Split(',')[11]),
                                Product_Has_Size       = Convert.ToBoolean(row.Split(',')[12].ToLower()),
                                Product_Size           = row.Split(',')[13],
                                Product_Avail_ZipCode  = row.Split(',')[14],
                                Product_Discount       = Convert.ToDecimal(row.Split(',')[15]),
                                Product_CreatedDate    = DateTime.Now,
                                Product_UpdatedDate    = DateTime.Now,
                                Product_Status         = eProductStatus.ReviewPending.ToString()
                            });
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }

            int            AdminId = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["AdminSession"].ToString()].ToString());
            Administrators _admin  = context.Administrator.ToList().Where(m => m.Administrators_Id == AdminId).FirstOrDefault();

            foreach (var item in _products)
            {
                SubCategories _subCategory = context.SubCategory.Where(m => m.SubCategory_Id == item.SubCategory_Id).FirstOrDefault();
                item.Administrators_Id = _admin.Administrators_Id;
                item.Store_Id          = _admin.Store_Id;
                if (_subCategory != null)
                {
                    if (item.Product_Id == 0)
                    {
                        Product Product = new Product()
                        {
                            Store_Id               = _admin.Store_Id,
                            Product_Title          = item.Product_Title,
                            Product_Description    = item.Product_Description,
                            Product_Specification  = item.Product_Specification,
                            Administrators_Id      = _admin.Administrators_Id,
                            Product_Qty            = item.Product_Qty,
                            Product_Qty_Alert      = item.Product_Qty_Alert,
                            Product_Delivery_Time  = item.Product_Delivery_Time,
                            Product_Max_Purchase   = item.Product_Max_Purchase,
                            Product_Mkt_Price      = item.Product_Mkt_Price,
                            Product_Our_Price      = item.Product_Our_Price,
                            Product_ShippingCharge = item.Product_ShippingCharge,
                            Product_Has_Size       = item.Product_Has_Size,
                            Product_Size           = (item.Product_Has_Size == true) ? item.Product_Size : "No Size",
                            Product_Avail_ZipCode  = item.Product_Avail_ZipCode,
                            Product_Discount       = item.Product_Discount,
                            SubCategory_Id         = item.SubCategory_Id,
                            Product_CreatedDate    = item.Product_CreatedDate,
                            Product_UpdatedDate    = item.Product_UpdatedDate,
                            Product_Status         = item.Product_Status
                        };
                        try
                        {
                            int maxAdminId = 1;
                            if (context.Product.ToList().Count > 0)
                            {
                                maxAdminId = context.Product.Max(m => m.Product_Id);
                            }
                            maxAdminId          = (maxAdminId == 1 && context.Product.ToList().Count > 0) ? (maxAdminId + 1) : maxAdminId;
                            Product.ProductCode = "PRDTRACH" + maxAdminId + "TERA" + (maxAdminId + 1);
                            context.Product.Add(Product);
                            context.SaveChanges();

                            ProductHelper.CreateProductFlow(Product.Product_Id, Product.Product_Title, _admin.Administrators_Id, _admin.FullName, "New Product Created", Product.Product_Status);

                            item.Product_Id = Product.Product_Id;
                            insertCount     = insertCount + 1;
                            ProductBanners ProductBanner = new ProductBanners()
                            {
                                Product_Id                 = Product.Product_Id,
                                Administrators_Id          = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["AdminSession"].ToString()].ToString()),
                                Product_Banner_Default     = 1,
                                Product_Banner_Photo       = "content/noimage.png",
                                Product_Banner_CreatedDate = DateTime.Now,
                                Product_Banner_UpdatedDate = DateTime.Now
                            };

                            int maxBnrAdminId = 1;
                            if (context.ProductBanner.ToList().Count > 0)
                            {
                                maxBnrAdminId = context.ProductBanner.Max(m => m.Product_Id);
                            }
                            maxBnrAdminId = (maxBnrAdminId == 1 && context.ProductBanner.ToList().Count > 0) ? (maxBnrAdminId + 1) : maxBnrAdminId;
                            ProductBanner.Product_BannerCode = "PRDBNRTRACH" + maxBnrAdminId + "TERA" + (maxBnrAdminId + 1);
                            context.ProductBanner.Add(ProductBanner);
                            context.SaveChanges();
                        }
                        catch
                        {
                        }
                    }
                    else
                    {
                        Product _product = context.Product.ToList().Where(m => m.Product_Id == item.Product_Id).FirstOrDefault();
                        if (_product != null)
                        {
                            _product.Store_Id               = _admin.Store_Id;
                            _product.Product_Title          = item.Product_Title;
                            _product.Product_Description    = item.Product_Description;
                            _product.Product_Specification  = item.Product_Specification;
                            _product.Administrators_Id      = _admin.Administrators_Id;
                            _product.Product_Qty            = item.Product_Qty;
                            _product.Product_Qty_Alert      = item.Product_Qty_Alert;
                            _product.Product_Delivery_Time  = item.Product_Delivery_Time;
                            _product.Product_Max_Purchase   = item.Product_Max_Purchase;
                            _product.Product_Mkt_Price      = item.Product_Mkt_Price;
                            _product.Product_Our_Price      = item.Product_Our_Price;
                            _product.Product_ShippingCharge = item.Product_ShippingCharge;
                            _product.Product_Size           = item.Product_Size;
                            _product.Product_Avail_ZipCode  = item.Product_Title;
                            _product.Product_Discount       = item.Product_Discount;
                            _product.SubCategory_Id         = item.SubCategory_Id;
                            _product.Product_UpdatedDate    = item.Product_UpdatedDate;
                            _product.Product_Status         = item.Product_Status;

                            try
                            {
                                updateCount = updateCount + 1;
                                context.Entry(_product).State = System.Data.Entity.EntityState.Modified;
                                context.SaveChanges();
                            }
                            catch
                            {
                            }
                        }
                        else
                        {
                            item.Product_Status = "Invalid Product Id";
                        }
                    }
                }
                else
                {
                    item.Product_Status = "Invalid Sub Category Id";
                }
            }
            pnlErrorMessage.Attributes.Remove("class");
            pnlErrorMessage.Attributes["class"] = "alert alert-success alert-dismissable";
            pnlErrorMessage.Visible             = true;
            lblMessage.Text = "We are done!! " + insertCount + " Products Inserted and " + updateCount + " Products Updated Successfully also we have dowloaded the updated excel. Please check your download folder.";

            DataTable dt = ConvertToDataTable(_products);

            Response.ClearContent();
            Response.Buffer = true;
            Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "Products.xls"));
            Response.ContentType = "application/ms-excel";
            string str = string.Empty;

            foreach (DataColumn dtcol in dt.Columns)
            {
                Response.Write(str + dtcol.ColumnName);
                str = "\t";
            }
            Response.Write("\n");
            foreach (DataRow dr in dt.Rows)
            {
                str = "";
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    Response.Write(str + Convert.ToString(dr[j]));
                    str = "\t";
                }
                Response.Write("\n");
            }
            Response.End();
        }
Exemple #7
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                int        id        = Convert.ToInt32(hdnCatId.Value);
                Categories _otherCat = bCategory.List().Where(m => m.Category_Id != id && m.Category_Title == txtCategory.Text).FirstOrDefault();
                int        adminId   = Convert.ToInt32(Session[ConfigurationSettings.AppSettings["AdminSession"].ToString()].ToString());
                if (_otherCat == null)
                {
                    Categories Categories = bCategory.List().Where(m => m.Category_Id == id).FirstOrDefault();
                    Categories.Category_Title       = txtCategory.Text;
                    Categories.Category_UpdatedDate = DateTime.Now;
                    Categories.Administrators_Id    = adminId;
                    Categories.Category_Status      = (chkIsActive.Checked) ? eStatus.Active.ToString() : eStatus.InActive.ToString();
                    if (imgInp.HasFile)
                    {
                        Categories.Category_Photo = "files/category/" + "Category_" + Categories.Category_Id + ".png";
                        string   path = Server.MapPath("../" + Categories.Category_Photo);
                        FileInfo file = new FileInfo(path);
                        if (file.Exists)//check file exsit or not
                        {
                            file.Delete();
                        }
                        Upload(Categories.Category_Id);
                    }

                    Categories = bCategory.Update(Categories);

                    if (string.IsNullOrEmpty(Categories.ErrorMessage) && Categories.Category_Status == eStatus.InActive.ToString())
                    {
                        List <SubCategories> subCategories = new List <SubCategories>();
                        List <Product>       products      = new List <Product>();
                        subCategories = bSubCategory.List().Where(m => m.Category_Id == Categories.Category_Id && m.SubCategory_Status == eStatus.Active.ToString()).ToList();
                        foreach (var item113 in subCategories)
                        {
                            List <Product> productsTemp = new List <Product>();
                            productsTemp = bProduct.List().Where(m => m.Product_Status == eProductStatus.Published.ToString() && m.SubCategory.SubCategory_Id == item113.SubCategory_Id).ToList();
                            products.AddRange(productsTemp);
                        }

                        foreach (var item in products)
                        {
                            item.Product_Status = eProductStatus.ReviewPending.ToString();
                            bProduct.Update(item);
                            ProductHelper.CreateProductFlow(item.Product_Id, item.Product_Title, adminId, "System", "Category In Active : Product Updated and set to Review Pending Status", item.Product_Status);
                            bProduct.DeleteTopEight(item.Product_Id);
                            bProduct.DeleteProductFeature(item.Product_Id);
                            bProduct.DeleteCart(item.Product_Id);
                        }
                    }

                    ActivityHelper.Create("Update Category", "New Category Updated On " + DateTime.Now.ToString("D") + " Successfully and Title is " + Categories.Category_Title + ".", adminId);

                    Response.Redirect("/administration/categories/category.aspx?id=2000&redirecturl=admin-category-RachnaTeracotta");
                }
                else
                {
                    pnlErrorMessage.Attributes.Remove("class");
                    pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                    pnlErrorMessage.Visible             = true;
                    lblMessage.Text = "Oops!! Category not updated successfully, category name should not be same as other";
                }
            }
            catch (Exception ex)
            {
                pnlErrorMessage.Attributes.Remove("class");
                pnlErrorMessage.Attributes["class"] = "alert alert-danger alert-dismissable";
                pnlErrorMessage.Visible             = true;
                lblMessage.Text = ex.InnerException.InnerException.Message;
            }
        }