public ActionResult Index(AccountViewModel account) { string name = Account.AllowAccount(account); if (name != null) { SessionHelp.Set("UserName", name); return(RedirectToAction("Index", "Home")); } ViewBag.error = "账号密码有误"; return(View()); }
public string GetAllOperate(string User, string Password) { try { string name = Account.AllowAccount(new AccountViewModel { User = User, Password = Password }); if (name != null) { DateTime date = DateTime.Now.AddDays(-5); var data = (from a in operate.GetAll("OperationNews_tb") where Convert.ToDateTime(a.createdAt) > date && a.User != name orderby a.createdAt descending select a).ToList(); return(JsonConvert.SerializeObject(data)); } else { return(null); } } catch (Exception e) { return(e.Message); } }