// GET: Admin/SubAgentManagement public ActionResult Index(string Search = "", int Pagesize = 10) { string username = ApplicationUtilities.GetSessionValue("username").ToString(); var UserType = Session["UserType"].ToString(); string AgentId = "", IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString(); AgentId = Session["AgentId"].ToString(); //string username = ApplicationUtilities.GetSessionValue("UserName").ToString(); var SubAgentCommon = buss.GetSubAgentList(AgentId, username); //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("AgentName", "Agent Name"); param.Add("AgentOperationType", "Operation Type"); param.Add("AgentCreditLimit", "Credit Limit"); param.Add("AgentMobileNumber", "Contact Number"); param.Add("AgentStatus", "Agent Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends foreach (var item in SubAgentCommon) { item.Action = StaticData.GetActions("ClientSubAgent", item.AgentID.EncryptParameter(), this, "", "", username.EncryptParameter(), item.AgentStatus); item.AgentStatus = "<span class='badge badge-" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "success" : "danger") + "'>" + (item.AgentStatus.Trim().ToUpper() == "Y" ? "Active" : "Blocked") + "</span>"; } var grid = ProjectGrid.MakeGrid(SubAgentCommon, "Sub Agent List ", "", 0, true, "", "", "Home", "Agent", "/Client/SubAgent/Index", String.IsNullOrEmpty(IsPrimary) == false && IsPrimary.ToUpper().Trim() == "Y" ? "/Client/SubAgent/ManageSubAgent?parentid=" + AgentId.EncryptParameter() : ""); ViewData["grid"] = grid; SubAgentCreditLimitModel sam = new SubAgentCreditLimitModel(); sam.ParentId = AgentId; return(View(sam)); }
// GET: Admin/SubAgentManagement public ActionResult Index(string agentId = "", string UserName = "", string Search = "", int Pagesize = 10) { string username = ApplicationUtilities.GetSessionValue("username").ToString(); var UserType = Session["UserType"].ToString(); string AgentId = "", IsPrimary = ApplicationUtilities.GetSessionValue("IsPrimaryUser").ToString(); //if (UserType.ToUpper() == "SUB-AGENT") //{ // return RedirectToAction("Index", "SubAgentManagement"); //} //else if (UserType.ToUpper() == "AGENT") //{ // AgentId = Session["AgentId"].ToString(); //} if (!string.IsNullOrEmpty(agentId)) { AgentId = agentId.DecryptParameter(); } //string username = ApplicationUtilities.GetSessionValue("UserName").ToString(); var SubAgentCommon = buss.GetSubAgentList(AgentId, username); //Column Creator IDictionary <string, string> param = new Dictionary <string, string>(); param.Add("AgentName", "Agent Name"); param.Add("AgentOperationType", "Operation Type"); param.Add("AgentCreditLimit", "Credit Limit"); param.Add("AgentMobileNumber", "Contact Number"); param.Add("AgentStatus", "Agent Status"); param.Add("Action", "Action"); ProjectGrid.column = param; //Ends foreach (var item in SubAgentCommon) { item.Action = StaticData.GetActions("SubAgentManagement", item.AgentID.EncryptParameter(), this, "", "", username.EncryptParameter(), item.AgentStatus); } var grid = ProjectGrid.MakeGrid(SubAgentCommon, "Sub Agent List ", "", 0, true, "", "", "Home", "Agent", "/Admin/SubAgentManagement/Index", String.IsNullOrEmpty(IsPrimary) == false && IsPrimary.ToUpper().Trim() == "Y" ? "/Admin/SubAgentManagement/ManageSubAgent?parentid=" + AgentId.EncryptParameter() : ""); ViewData["grid"] = grid; SubAgentCreditLimitModel sam = new SubAgentCreditLimitModel(); sam.ParentId = agentId; return(View(sam)); }