public ActionResult ChangePassword(string username, string newpwd, string comfirmpwd)
 {
     ViewBag.MenuGroup = "AI";
     ViewBag.MenuTitle = "修改密码";
     if (string.IsNullOrWhiteSpace(newpwd) && string.IsNullOrWhiteSpace(comfirmpwd))
     {
         return(View());
     }
     if (!BLLMEnterpriseAdmin.IsLogin())
     {
         return(Redirect("~/AdminHome/Index"));
     }
     if (string.IsNullOrEmpty(newpwd))
     {
         ViewBag.Newpwderror = "请输入新密码";
     }
     if (string.IsNullOrEmpty(comfirmpwd))
     {
         ViewBag.Comfirmerror = "请输入确认密码";
     }
     else if (newpwd.Trim() != comfirmpwd.Trim())
     {
         ViewBag.Comfirmerror = "密码不一致";
     }
     if (BLLMEnterpriseAdmin.ChangeAdminPwd(username, newpwd))
     {
         ViewBag.SaveResult = "修改成功";
     }
     else
     {
         ViewBag.SaveResult = "修改失败";
     }
     return(View());
 }
        //
        // GET: /Account/

        public ActionResult Login(string adminname, string password)
        {
            if (string.IsNullOrWhiteSpace(adminname) && string.IsNullOrWhiteSpace(password))
            {
                return(View());
            }
            if (string.IsNullOrEmpty(adminname))
            {
                ViewBag.Message = "请输入用户名";
            }
            else if (string.IsNullOrEmpty(password))
            {
                ViewBag.Message = "请输入密码";
            }
            if (BLLMEnterpriseAdmin.Login(adminname, password))
            {
                return(Redirect("~/AdminHome/Index"));
            }
            else
            {
                ViewBag.Message = "用户名密码错误";
            }

            return(Redirect("~/AdminHome/Index"));
        }
Example #3
0
        //
        // GET: /Home/

        public ActionResult Index(int?pageindex)
        {
            ViewBag.MenuGroup = "EI";
            if (!BLLMEnterpriseAdmin.IsLogin())
            {
                return(Redirect("~/AdminAccount/Login"));
            }
            ViewBag.MenuTitle = "企业列表";


            PageHelper page = new PageHelper();

            if (!pageindex.HasValue)
            {
                pageindex = 1;
            }
            page.TotalCount  = BLLEnterprise.GetEnterprise().Count;
            page.PageNext    = pageindex.Value + 1;
            page.PageCurrent = pageindex.Value;
            page.PagePre     = pageindex.Value - 1;
            ViewBag.Page     = page;
            List <Enterprise> EnterpriseList = BLLEnterprise.GetEnterpriseList(page.PageCurrent - 1, page.PageSize);

            return(View(EnterpriseList));
        }
Example #4
0
 protected void Application_BeginRequest(Object sender, EventArgs e)
 {
     if (Request.Url.ToString().Contains("/AdminAccount/Login") && !Request.Url.ToString().Contains("?"))
     {
     }
     else
     {
         if (!BLLMEnterpriseAdmin.IsLogin() || BLLMEnterpriseAdmin.Current == null)
         {
             Response.Redirect("/AdminAccount/Login");
         }
     }
 }
Example #5
0
        public ActionResult MessageList(int?pageindex)
        {
            ViewBag.MenuGroup = "MI";
            if (!BLLMEnterpriseAdmin.IsLogin())
            {
                return(Redirect("~/AdminAccount/Login"));
            }
            ViewBag.MenuTitle = "留言列表";
            PageHelper page = new PageHelper();

            if (!pageindex.HasValue)
            {
                pageindex = 1;
            }
            page.TotalCount  = BLLMEnterpriseMessage.GetMEnterriseMessage().Count;
            page.PageNext    = pageindex.Value + 1;
            page.PageCurrent = pageindex.Value;
            page.PagePre     = pageindex.Value - 1;
            List <MEnterpriseMessage> messageList = BLLMEnterpriseMessage.GetPageMessage(page, pageindex.Value);

            ViewBag.Page = page;
            return(View(messageList));
        }
 public ActionResult Logout()
 {
     BLLMEnterpriseAdmin.Logout();
     return(Redirect("~/AdminAccount/Login"));
 }