public JsonResult Deactivate(int Id) { try { Client Client = new Client(Id); Client.Active = false; Client.Save(); return new JsonResult { Data = new { success = true } }; // Return nothing as there are no errors } catch (Exception ex) { return new JsonResult { Data = new { success = false, error = ex.Message } }; } }
// // GET: /Clients/Edit public ActionResult Edit(int Id) { Client Client = new Client(Id); ViewData["Managers"] = new SelectList(ProfileProvider.AllProfiles().Where(p => p.RoleName == "Managers").ToList(), "ProviderUserKey", "UserName", Client.UserId); return View(Client); }
public JsonResult Save(Client Client) { try { Client.Save(); return new JsonResult { Data = new { success = true, id = Client.Id } }; // Return the client Id if there are no errors } catch (Exception ex) { return new JsonResult { Data = new { success = false, error = ex.Message } }; } }