예제 #1
0
        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 } };
            }
        }
예제 #2
0
        //
        // 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);
        }
예제 #3
0
        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 } };
            }
        }