public ActionResult UpdateAgent(AgentDetailsModel model) { var result = agentServices.UpdateAgentDetails( model.Id, model.First_Name, model.Last_Name, model.Phone, model.Country, model.Email, model.Username, model.Password ); switch (result) { case (int)OutputResult.Successful: ViewBag.result = "Successfull"; break; case (int)OutputResult.UnSucessful: ViewBag.result = "Can't Update Sub Agent"; break; case (int)OutputResult.EmailExists: ViewBag.result = "Email Alredy Exists"; break; case (int)OutputResult.UsernameExists: ViewBag.result = "This username alredy in use"; break; } return View("~/Areas/Agent/Views/Home/UpdateSubAgent.cshtml", model); }
/// <summary> /// List Agent /// </summary> /// <returns></returns> public ActionResult ListAgent() { var model = new AgentDetailsModel(agentServices.GetAgent("All_Agent",System.Web.HttpContext.Current.User.Identity.Name.ToString())); ViewBag.result = TempData["result"]; return View("~/Areas/Agent/Views/SubAgent/ListAgent.cshtml", model); }
/// <summary> /// Show Login Agent Details details /// </summary> /// <returns></returns> public ActionResult MyAccount() { var model = new AgentDetailsModel(agentServices.GetAgent("SelectOnId",System.Web.HttpContext.Current.User.Identity.Name.ToString())); return View("~/Areas/Agent/Views/Home/UpdateAgent.cshtml", model); }
/// <summary> /// Edit Agent /// </summary> /// <param name="id">Agent id</param> /// <returns></returns> public ActionResult EditAgent(string _ag) { var model = new AgentDetailsModel(agentServices.GetAgent("SelectOnId", _ag)); return View("~/Areas/Agent/Views/SubAgent/UpdateSubAgent.cshtml", model); }
/// <summary> /// List Agent /// </summary> /// <returns></returns> public ActionResult ListAgent() { var model = new AgentDetailsModel(agentServices.GetAgent("All_Agent", null)); ViewBag.result = TempData["result"]; return View("~/Areas/Promoter/Views/Agent/ListAgent.cshtml", model); }