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);
 }
 public ActionResult AccountAdd(AccountAddModel addModel)
 {
     IAccountService accountService = new AccountService();
     var jsonModel = accountService.AddAccount(addModel);
     if (jsonModel.Success)
     {
         return Json(new { success = true, msg = "添加成功", openId=jsonModel.Data.OpenId }, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(new { success = false, msg = jsonModel.ErrMsg }, JsonRequestBehavior.AllowGet);
     }
 }
 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);
     }
 }
        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);
        }