public ActionResult SavePriceGroup(PriceGroupViewModel model)
        {
            if (!caSession.AuthoriseSession())
            {
                return(Redirect((string)Session["ErrorUrl"]));
            }

            var result = _productPriceService.SavePriceGroup(model.PriceGroupId, model.Name, model.Percent ?? 0, CurrentTenantId, CurrentUserId, model.ApplyDiscountOnTotal, model.ApplyDiscountOnSpecialPrice);

            return(Json(new { Success = result != null, Message = result != null ? "Success" : "Please make sure the price group name is unique." }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult _PriceGroupForm(int?id = null)
        {
            ViewData["PriceGroupID"] = id;
            var model = Mapper.Map <TenantPriceGroups, PriceGroupViewModel>(_productPriceService.GetTenantPriceGroupById(id ?? 0));

            if (model == null)
            {
                model = new PriceGroupViewModel()
                {
                    PriceGroupId = id ?? 0
                };
            }
            return(PartialView("_CreateEditPriceGroup", model));
        }