public ActionResult AccountAdd() { IDomainService domainService = new DomainService(); var domainList = domainService.GetListDomain(new DomainParam() { }); List<SelectListItem> domainSelectList = new List<SelectListItem>() { new SelectListItem(){ Text="请选择",Value="0",Selected=true } }; foreach (var domain in domainList) { SelectListItem item = new SelectListItem() { Text=domain.DomainName, Value=domain.DomainCode }; domainSelectList.Add(item); } this.ViewData["SubmitDomainCode"] = domainSelectList; return View(); }
public ActionResult AccountList() { #region 域选择 IDomainService domainService = new DomainService(); var domainList = domainService.GetListDomain(new DomainParam() { }); List<SelectListItem> domainSelectList = new List<SelectListItem>() { new SelectListItem(){ Text="全部",Value="0",Selected=true } }; foreach (var domain in domainList) { SelectListItem item = new SelectListItem() { Text = domain.DomainName, Value = domain.DomainId.ToString(), }; domainSelectList.Add(item); } this.ViewData["submitDomainId"] = domainSelectList; #endregion int submitDomainId = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.HtmlEncode(Request["submitDomainId"]), 0); string openId = HttpUtility.HtmlEncode(Request["openId"]); string loginName = HttpUtility.HtmlEncode(Request["loginName"]); string mobile = HttpUtility.HtmlEncode(Request["mobile"]); string email = HttpUtility.HtmlEncode(Request["email"]); IAccountService accountService = new AccountService(); AccountParam parameter = new AccountParam() { PageIndex = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.UrlEncode(Request["page"]), 1), PageSize = 12, SubmitDomainId = submitDomainId, IsPaging = true, OpenId = openId, LoginName=loginName, Mobile=mobile, Email=email, AccountId = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.UrlEncode(Request["accountId"]), 0) }; var model = accountService.GetPagingAccount(parameter); return View(model); }
public ActionResult LoadLevelDomain(int level) { IDomainService service = new DomainService(); var domainList = service.GetListDomain(new DomainParam() { DomainLevel=level }); return Json(domainList, JsonRequestBehavior.AllowGet); }
public ActionResult DomainEdit(int domainId) { IDomainService service = new DomainService(); var model = service.GetEditModel(domainId); //域级别select List<SelectListItem> levelSelectList = new List<SelectListItem>() { new SelectListItem(){ Text="一级域名",Value="1",Selected=(model.DomainLevel==1)}, new SelectListItem(){ Text="二级域名",Value="2",Selected=(model.DomainLevel==2)}, new SelectListItem(){ Text="三级域名",Value="3",Selected=(model.DomainLevel==3)}, }; //上级域名select List<SelectListItem> parentSelectList = new List<SelectListItem>() { new SelectListItem(){ Text="无",Value="0",Selected=(model.ParentDomainId==0)} }; if (model.DomainLevel > 1) { var domainList = service.GetListDomain(new DomainParam() { DomainLevel = model.DomainLevel - 1 }); foreach (var domain in domainList) { SelectListItem item = new SelectListItem() { Text = domain.DomainName, Value = domain.DomainId.ToString(), Selected = (model.ParentDomainId == domain.DomainId) }; parentSelectList.Add(item); } } //单点登录池的select List<SelectListItem> poolSelectList = new List<SelectListItem>(); ISSOPoolService ssoPoolService = new SSOPoolService(); var poolList = ssoPoolService.GetSSOPoolList(); foreach (var pool in poolList) { SelectListItem item = new SelectListItem() { Text=pool.PoolName, Value=pool.PoolId.ToString(), Selected=(model.SSOPoolPoolId==pool.PoolId) }; poolSelectList.Add(item); } this.ViewData["DomainLevel"] = levelSelectList; this.ViewData["ParentDomainId"] = parentSelectList; this.ViewData["SSOPoolPoolId"] = poolSelectList; return View(model); }