public JsonResult Create(EIApp.Models.UserInfo model) { if (bll.AddEntity(model).ID > 0) { return(Json(1, JsonRequestBehavior.AllowGet)); } else { return(Json(0, JsonRequestBehavior.AllowGet)); } }
public JsonResult UserLogin(EIApp.Models.UserInfo model) { int intret = 0; if (model != null && !string.IsNullOrEmpty(model.UName) && !string.IsNullOrEmpty(model.UName)) { var LoginUser = bll.LoadEntities(m => m.UName.Equals(model.UName)).FirstOrDefault(); if (LoginUser != null && LoginUser.Pwd.Equals(model.Pwd)) { Session["UserInfo"] = model; intret = 1; } } return(Json(intret, JsonRequestBehavior.AllowGet)); }
private static void Main(string[] args) { //Pop3Helper pop3 = new Pop3Helper(); //pop3.pop3Server = "172.27.3.94"; //pop3.pop3Port = 110; //pop3.username = "******"; //pop3.password = "******"; //pop3.FetchAllMessages(); EIApp.BLL.UserInfoService UBll = new EIApp.BLL.UserInfoService(); var model = new EIApp.Models.UserInfo() { ID = 1, UName = "wwwwwwwwd", Pwd = "11111" }; UBll.AddEntity(model); // var models = UBll.LoadEntities(m => m.ID > 2); //var m = UBll.DeleteEntity(model); //foreach (var model in models) //{ // Console.WriteLine(model.ID); //} Console.ReadLine(); }