Exemplo n.º 1
0
 public ActionResult AccountDisplay()
 {
     int accountId = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.HtmlEncode(Request["accountId"]), 0);
     IAccountService service = new AccountService();
     var model = service.GetAccount(new AccountSingleParam() { AccountId = accountId });
     IDomainService domainService = new DomainService();
     var subdomain = domainService.GetDomain(new DomainSingleParam() { DomainId=model.SubmitDomainId });
     ViewBag.SubmitDomain = subdomain;
     return View(model);
 }
Exemplo n.º 2
0
 public ActionResult DomainAdd(DomainAddModel addModel)
 {
     IDomainService service = new DomainService();
     var jsonModel = service.AddDomain(addModel);
     if (jsonModel.Success)
     {
         return Json(new { success = true, msg = "添加成功" }, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(new { success = false, msg = jsonModel.ErrMsg }, JsonRequestBehavior.AllowGet);
     }
 }
Exemplo n.º 3
0
 public ActionResult AccountDelete(int accountId)
 {
     IDomainService domainService = new DomainService();
     IAccountService service = new AccountService();
     var jsonModel = service.DeleteAccount(new AccountDeleteModel() { AccountId = accountId });
     if (jsonModel.Success)
     {
         return Json(new { success = true, msg = "删除成功" }, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(new { success = false, msg = jsonModel.ErrMsg }, JsonRequestBehavior.AllowGet);
     }
 }
Exemplo n.º 4
0
 public ActionResult ChangeDomainEnabled()
 {
     int domainId = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.HtmlEncode(Request["domainId"]), 0);
     int isEnabled = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.HtmlEncode(Request["isEnabled"]), (int)IsEnabledEnum.Enabled);
     IDomainService service = new DomainService();
     var jsonModel = service.ChangeDomainEnabled(domainId, isEnabled);
     if (jsonModel.Success)
     {
         return Json(new { success = true, msg = "操作成功" }, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(new { success = true, msg = jsonModel.ErrMsg }, JsonRequestBehavior.AllowGet);
     }
 }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
0
 public ActionResult SSOPoolEdit(int poolId)
 {
     ISSOPoolService service = new SSOPoolService();
     var model = service.GetEditModel(poolId);
     //主要的域名验证的 select
     List<SelectListItem> domainSelectList = new List<SelectListItem>();
     IDomainService domainService = new DomainService();
     var domainList = domainService.GetPoolDomain(poolId);
     domainSelectList.Add(new SelectListItem()
     {
         Text="无",
         Value="0",
         Selected=(model.MainDomainId==0)
     });
     foreach (var domain in domainList)
     {
         SelectListItem item = new SelectListItem()
         {
             Text=domain.DomainName,
             Value=domain.DomainId.ToString(),
             Selected=(domain.DomainId==model.MainDomainId)
         };
         domainSelectList.Add(item);
     }
     this.ViewData["MainDomainId"] = domainSelectList.AsEnumerable();
     return View(model);
 }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 public ActionResult DomainAccountList()
 {
     IDomainService domainService = new DomainService();
     DomainParam parameter = new DomainParam()
     {
         PageIndex = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.UrlEncode(Request["page"]), 1),
         PageSize = 12,
         IsEnabled = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.UrlEncode(Request["isEnabled"]), 0),
         DomainName = HttpUtility.HtmlEncode(Request["domainName"]),
         IsPaging = true,
         DomainCode = HttpUtility.HtmlEncode(Request["domainCode"]),
         DomainLevel = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.UrlEncode(Request["domainLevel"]), 0),
         IsSSO = DotNet.Utils.Untility.ConvertFactory.ToInt32(HttpUtility.UrlEncode(Request["isSSO"]), 0),
         DomainUrl = HttpUtility.UrlEncode(Request["domainUrl"])
     };
     var pagingModel = domainService.GetPagingDomain(parameter);
     return View(pagingModel);
 }
Exemplo n.º 9
0
 public ActionResult DomainDisplay()
 {
     int domainId = DotNet.Utils.Untility.ConvertFactory.ToInt32(Request["domainId"], 0);
     IDomainService service = new DomainService();
     var domain = service.GetDomain(new DomainSingleParam() { DomainId=domainId });
     return View(domain);
 }
Exemplo n.º 10
0
 public ActionResult DomainDelete(int domainId)
 {
     IDomainService service = new DomainService();
     var jsonModel = service.DeleteDomain(domainId);
     if (jsonModel.Success)
     {
         return Json(new { success = true, msg = "删除成功" }, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(new { success = false, msg = jsonModel.ErrMsg }, JsonRequestBehavior.AllowGet);
     }
 }
Exemplo n.º 11
0
 public ActionResult LoadLevelDomain(int level)
 {
     IDomainService service = new DomainService();
     var domainList = service.GetListDomain(new DomainParam() { DomainLevel=level });
     return Json(domainList, JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 12
0
 public ActionResult DomainEdit(DomainEditModel editModel)
 {
     IDomainService service = new DomainService();
     var jsonModel = service.EditDomain(editModel);
     if (jsonModel.Success)
     {
         return Json(new { success = true, msg = "修改成功" }, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(new { success = false, msg = jsonModel.ErrMsg }, JsonRequestBehavior.AllowGet);
     }
 }
Exemplo n.º 13
0
        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);
        }