public ActionResult DeletePricingDetails(string ProductPricingId)
        {
            if (User.Identity.IsAuthenticated)
            {
                if (isAdminUser())
                {
                    StringBuilder ErrorMessages   = new StringBuilder();
                    StringBuilder SuccessMessages = new StringBuilder();
                    try
                    {
                        PricingData pricingData = new PricingData();
                        if (!string.IsNullOrEmpty(ProductPricingId))
                        {
                            pricingData.ProductPricingId = ProductPricingId;
                            bool InsertResult = false;
                            InsertResult = PricingDetailsProxy.CUDPricingDetails(pricingData, "Delete");
                            DataSet   PricingDataSet   = new DataSet();
                            DataTable PricingDataTable = new DataTable();
                            PricingDataSet   = PricingDetailsProxy.FetchPricingDetails();
                            PricingDataTable = PricingDataSet.Tables[0];
                            managePricing_IndexViewModel.PricingDataTable = PricingDataTable;
                            if (InsertResult == false)
                            {
                                ErrorMessages.Append(CUDConstants.DeleteError);
                            }
                            else
                            {
                                SuccessMessages.Append(CUDConstants.DeleteSuccess);
                            }
                        }
                        else
                        {
                            ErrorMessages.Append(CUDConstants.DeleteError);
                        }
                    }
                    catch (Exception e)
                    {
                        ErrorMessages.Append(CUDConstants.DeleteError);
                    }
                    if (!String.IsNullOrEmpty(SuccessMessages.ToString()))
                    {
                        managePricing_IndexViewModel.SuccessMessage = SuccessMessages.ToString();
                    }
                    if (!String.IsNullOrEmpty(ErrorMessages.ToString()))
                    {
                        managePricing_IndexViewModel.ErrorMessage = ErrorMessages.ToString();
                    }

                    return(PartialView("PricingDataTable", managePricing_IndexViewModel));
                }
                else
                {
                    return(RedirectToAction("Index", "Home"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
        public ActionResult UpdatePricingDetails(PricingData pricingData)
        {
            if (User.Identity.IsAuthenticated)
            {
                if (isAdminUser())
                {
                    StringBuilder ErrorMessages   = new StringBuilder();
                    StringBuilder SuccessMessages = new StringBuilder();
                    try
                    {
                        bool UpdateResult = false;
                        UpdateResult = PricingDetailsProxy.CUDPricingDetails(pricingData, "Update");
                        DataSet   PricingDataSet   = new DataSet();
                        DataTable PricingDataTable = new DataTable();
                        PricingDataSet   = PricingDetailsProxy.FetchPricingDetails();
                        PricingDataTable = PricingDataSet.Tables[0];
                        PricingDataTable = DataTablePhotoMapping(PricingDataTable);
                        managePricing_IndexViewModel.PricingDataTable = PricingDataTable;
                        if (UpdateResult == false)
                        {
                            ErrorMessages.Append(CUDConstants.UpdateError);
                        }
                        else
                        {
                            SuccessMessages.Append(CUDConstants.UpdateSuccess);
                        }
                    }
                    catch (Exception e)
                    {
                        ErrorMessages.Append(CUDConstants.UpdateError);
                    }
                    if (!String.IsNullOrEmpty(SuccessMessages.ToString()))
                    {
                        managePricing_IndexViewModel.SuccessMessage = SuccessMessages.ToString();
                    }
                    if (!String.IsNullOrEmpty(ErrorMessages.ToString()))
                    {
                        managePricing_IndexViewModel.ErrorMessage = ErrorMessages.ToString();
                    }

                    return(PartialView("PricingDataTable", managePricing_IndexViewModel));
                }
                else
                {
                    return(RedirectToAction("Index", "Home"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }