public ActionResult EditSearchUser(string UserId = "") { UserCommon commonModel = new UserCommon(); if (!string.IsNullOrEmpty(UserId)) { var id = UserId.DecryptParameter(); if (string.IsNullOrEmpty(id)) { return(RedirectToAction("SearchUser")); } string username = Session["username"].ToString(); commonModel = buss.GetSearchUserList(id, "userid", username).FirstOrDefault(); //commonModel = buss.GetUserById(id); commonModel.UserID = commonModel.UserID.EncryptParameter(); var rol = LoadDropdownList("ManageUser"); ViewBag.Roles = ApplicationUtilities.SetDDLValue(LoadDropdownList("ManageUser") as Dictionary <string, string>, commonModel.RoleId, "--Select Role--"); return(View(commonModel)); } else { ApplicationUtilities.ShowPopup(this, 1, "Something Went Wrong! "); return(RedirectToAction("SearchUser")); } //ViewBag.Roles = LoadDropdownList("ManageUser"); }
public ActionResult ManageAgentUser(string AgentId, string UserId = "") { AgentUserModel Agentmodel = new AgentUserModel(); var Agent_id = AgentId.DecryptParameter(); var user_id = UserId.DecryptParameter(); if (string.IsNullOrEmpty(Agent_id)) { return(RedirectToAction("Index")); } if (!string.IsNullOrEmpty(UserId)) { if (string.IsNullOrEmpty(user_id)) { return(RedirectToAction("ViewAgentUser", new { AgentId = AgentId })); } AgentManagementCommon amc = new AgentManagementCommon(); amc.AgentID = Agent_id; amc.ActionUser = Session["UserName"].ToString(); amc.UserID = user_id; var agentUserList = buss.GetUserList(amc);//.FirstOrDefault(); if (agentUserList.Count > 0) { var agentm = agentUserList.FirstOrDefault(); Agentmodel.UserID = agentm.UserID.EncryptParameter(); Agentmodel.FullName = agentm.FullName; Agentmodel.UserEmail = agentm.UserEmail; Agentmodel.UserMobileNumber = agentm.UserMobileNumber; Agentmodel.UserStatus = agentm.UserStatus; Agentmodel.UserName = agentm.UserName; } else { ApplicationUtilities.ShowPopup(this, 1, "User Not Found!"); return(RedirectToAction("ViewAgentUser", new { AgentId = AgentId })); } } Agentmodel.AgentID = AgentId; return(View(Agentmodel)); }