public ActionResult Delete(int Id) { Book.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); int result = bll.Delete(Id); return(RedirectToAction("Index")); }
public ActionResult UpdateSave(Book.Model.T_Base_Admin Admin) { Book.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); int result = bll.Update(Admin); return(Redirect("Index")); }
/// <summary> /// 检测账号密码 /// </summary> /// <param name="Num"></param> /// <param name="Password"></param> /// <returns></returns> public JsonResult Check(string Num, string Password) { int result = new BLL.Home().Check(Num, Password); int role = 0; if (result == -2 || result == -3) { if (result == -2) { role = new BLL.T_Base_User().GetUser(Num).Role; } else if (result == -3) { role = new BLL.T_Base_Admin().GetAdmin(Num).Role; } //记录票据 FormsAuthentication.SetAuthCookie(Num, false); //简单授权 var authTicket = new FormsAuthenticationTicket( role, //角色 "" + Num, //登录用户Id DateTime.Now, //当前时间 DateTime.Now.AddDays(30), //保存时间 true, // 如果为 true,则创建持久 Cookie(跨浏览器会话保存的 Cookie);否则为 false。 "" //存储在票证中的用户特定的数据 ); HttpCookie authCookie = new HttpCookie( FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(authTicket)); Response.Cookies.Add(authCookie); } return(Json(role)); }
public ActionResult Update(int Id) { Book.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); Book.Model.T_Base_Admin Admin; Admin = bll.GetModal(Id); ViewBag.Admin = Admin; return(View()); }
public JsonResult GetSearch(string Name = "", int matchCount = 10) { Name = Name.Trim(); Book.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); List <Book.Model.T_Base_Admin> lst = bll.GetSearch(Name, matchCount); return(Json(lst)); }
public JsonResult EPDelete(string [] Ids) { FindJob.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); bll.EPDelete(Ids); return(Json(new FindJob.Model.Message() { Code = 1, Content = "删除成功" })); }
public ActionResult AddSave(string LoginName, string PWD, int RoleId) { Book.Model.T_Base_Admin Admin = new Model.T_Base_Admin(); Admin.LoginName = LoginName; Admin.PWD = PWD; Admin.RoleId = RoleId; Book.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); bll.Add(Admin); return(Redirect("Index")); }
public JsonResult GetList(int currentPage, String Name = "") { Book.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); //List<Book.Model.T_Base_Admin> lst = bll.GetAll(); List <Book.Model.T_Base_Admin> lst = bll.GetList(currentPage, PageSize, Name); ViewBag.Name = Name; int c = bll.GetCount(Name); return(Json(new { count = c, result = Json(lst) })); }
public ActionResult Index(String Name = "") { Book.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); Book.Model.T_Base_Admin_Page page = bll.GetListPage(1, PageSize, Name); //List<Book.Model.T_Base_Admin> lst = bll.GetAll(); ViewBag.MaxPageIndex = MaxPageIndex; ViewBag.PageSize = PageSize; ViewBag.lst = page.list; ViewBag.count = page.count; return(View()); }
public ActionResult Index() { Book.BLL.T_Base_Admin admin = new BLL.T_Base_Admin(); ViewBag.admin = admin.GetCount(); Book.BLL.T_Base_Book book = new BLL.T_Base_Book(); ViewBag.book = book.GetCount(); Book.BLL.T_Base_Provider provider = new BLL.T_Base_Provider(); ViewBag.provider = provider.GetCount(); Book.BLL.T_Base_Customer customer = new BLL.T_Base_Customer(); ViewBag.customer = provider.GetCount(); Book.BLL.T_Stock_Report stock = new BLL.T_Stock_Report(); ViewBag.stock = stock.GetCount(); return(View()); }
public JsonResult DeleteJson(int Id) { Book.BLL.T_Base_Admin bll = new BLL.T_Base_Admin(); int result = bll.Delete(Id); Book.Model.Message msg; if (result > 0) { msg = new Book.Model.Message() { Code = 200, Content = "删除成功" }; } else { msg = new Book.Model.Message() { Code = 500, Content = "删除失败" }; } return(Json(msg)); }