private Result GetLogin() { var userName = GetPostBack.GetPostBackValue("userName"); var password = GetPostBack.GetPostBackValue("password"); var dateList = BLL.People.People.Login(userName, password).AsEnumerable().Select(t => new { UserName = t.Field <string>("UserName"), Name = t.Field <string>("Name"), Password = t.Field <string>("Powd"), CompanyId = t.Field <string>("CompanyId"), }).ToList(); if (dateList.Count > 0) { //CurUserInfo.Username = dateList[0].UserName; //CurUserInfo.CompanyID= return(new Result() { state = state.success, msg = "登录成功!" }); } else { return(new Result() { state = state.error, msg = "账号或密码错误!" }); } }
private Result GetStudentList() { var aaaa = GetPostBack.GetPostBackValue("aaa"); var dateList = BLL.Student.Student.BinddateList(); return(new Result() { state = state.success, data = new { DataList = dateList, TotalRowNum = dateList.Rows } }); }
protected override Result SwitchCmd(HttpRequest Request) { string sCmd = GetPostBack.GetPostBackValue("cmd"); Result result = new Result(); switch (sCmd) { case "getStudentList": result = GetStudentList(); break; } return(result); }