public ActionResult ManageAgent(string User_Name, string agentId = "", string ParentId = "") { AgentManagementModel AM = new AgentManagementModel(); if (!string.IsNullOrEmpty(ParentId) && string.IsNullOrEmpty(ParentId.DecryptParameter())) { return(RedirectToAction("Index", new { parent_id = ParentId })); } else { AM.ParentID = ParentId; } if (!string.IsNullOrEmpty(agentId)) { AM.AgentID = agentId.DecryptParameter(); if (!string.IsNullOrEmpty(AM.AgentID)) { AgentManagementCommon AC = buss.GetAgentById(AM.AgentID, User_Name.DecryptParameter()); AM = AC.MapObject <AgentManagementModel>(); AM.AgentID = AM.AgentID.EncryptParameter(); AM.UserID = AM.UserID.EncryptParameter(); AM.ParentID = AM.ParentID.EncryptParameter(); RemoveupdateValidation(AM); } } if (string.IsNullOrEmpty(agentId)) { AM.AgentCountry = "Nepal"; } LoadDropDownList(AM); return(View(AM)); }
public ActionResult ViewAgentDetail(string User_Name, string agentId = "", string ParentId = "") { AgentManagementModel AM = new AgentManagementModel(); if (!string.IsNullOrEmpty(ParentId) && string.IsNullOrEmpty(ParentId.DecryptParameter())) { return(RedirectToAction("Index", new { parent_id = ParentId })); } else { AM.ParentID = ParentId; } if (!string.IsNullOrEmpty(agentId)) { AM.AgentID = agentId.DecryptParameter(); if (!string.IsNullOrEmpty(AM.AgentID)) { AgentManagementCommon AC = buss.GetAgentById(AM.AgentID, User_Name.DecryptParameter()); AM = AC.MapObject <AgentManagementModel>(); AM.AgentID = AM.AgentID.EncryptParameter(); AM.UserID = AM.UserID.EncryptParameter(); AM.ParentID = AM.ParentID.EncryptParameter(); var pprovince = LoadDropdownList("province") as Dictionary <string, string>; AM.AgentProvince = pprovince.ContainsKey(AM.AgentProvince) ? pprovince.FirstOrDefault(x => x.Key == AM.AgentProvince).Value : AM.AgentProvince; return(View(AM)); } } this.ShowPopup(1, "Error"); return(RedirectToAction("Index")); }