public ActionResult CustomerTabEditor(int Id, MobSocialCustomerModel model) { //check if the customer exist var customer = _customerService.GetCustomerById(Id); if (customer == null) { return(Json(new { Success = false })); } //set the attributes _genericAttributeService.SaveAttribute(customer, "hideProfile", model.HideProfile); return(Json(new { Success = true })); }
public ActionResult CustomerTabEditor(int Id = 0) { if (Id == 0) { return(null); } var visibleAttribute = _genericAttributeService.GetAttributesForEntity(Id, "Customer").FirstOrDefault(x => x.Key == "hideProfile"); var model = new MobSocialCustomerModel { CustomerId = Id, HideProfile = visibleAttribute != null && visibleAttribute.Value == "True" }; return(View(ViewHelpers.GetCorrectViewPath("Views/Customer/CustomerTabContents.cshtml"), model)); }