Example #1
0
        public List <ClassInfo> GetClaName()
        {
            XITDataModel1    db     = new XITDataModel1();
            List <ClassInfo> result = db.ClassInfo.ToList();

            return(result);
        }
Example #2
0
        public int UpdateUser(StuInfo stu)
        {
            XITDataModel1 db = new XITDataModel1();

            db.Entry(stu).State = System.Data.Entity.EntityState.Modified;
            return(db.SaveChanges());
        }
Example #3
0
        public int AddUser(StuInfo stu)
        {
            XITDataModel1 db = new XITDataModel1();

            db.StuInfo.Add(stu);
            return(db.SaveChanges());
        }
Example #4
0
        public List <StuInfo> GetUserList()
        {
            XITDataModel1  db     = new XITDataModel1();
            List <StuInfo> result = db.StuInfo.ToList();

            return(result);
        }
Example #5
0
        public object GetPageData(SearchModel <StuInfo> search, out int count)
        {
            GetPageListParameter <StuInfo, int> parameter = new GetPageListParameter <StuInfo, int>();

            parameter.isAsc         = true;
            parameter.orderByLambda = t => t.StuID;
            parameter.pageIndex     = search.PageIndex;
            parameter.pageSize      = search.PageSize;
            parameter.whereLambda   = t => t.StuID != 0;
            XITDataModel1  indsentes   = new XITDataModel1();
            DBBaseService  baseService = new DBBaseService(indsentes);
            List <StuInfo> list        = baseService.GetSimplePagedData <StuInfo, int>(parameter, out count);

            return(list);
        }
Example #6
0
        public LoginInfo LoginMember(string username, string password)
        {
            //string sql = @"select * from(select m. RealName, m. Mobile, m. Email,r.Category, r . FullName,r . Description,r .0rganizeId
            //            ,o.FullName as oFullName , o. Address ,.Manager ,o.Mobile as oMobile , ma. Password
            //            from Member m
            //            left join RoleInfo r on m.RoleId = r.Id
            //            left join Organize on m.OrganizeId = o.Id
            //            left join MemberAccount ma on ma.Id = m.MemberAccountId) t where t. username = @username and t.password = @password";
            //            LoginInfo stu = new LoginInfo();
            //stu.LogNum = username;
            //stu.LogPwd = Md5Encrypt.Md5(password);
            //XITDataModel1.Default.WriteInfo(stu.LogNum + "--- " + stu.LogPwd);
            //List<LoginInfo> result = DapperDBHelper.Instance.ExcuteQuery<LoginInfo>(sql, stu).ToList();
            XITDataModel1    model = new XITDataModel1();
            List <LoginInfo> list  = model.LoginInfo.ToList();

            return(list.FirstOrDefault(p => p.LogNum == username && p.LogPwd == password));
        }
Example #7
0
        public StuInfo GetUserByID(int id)
        {
            XITDataModel1 db = new XITDataModel1();

            return(db.StuInfo.FirstOrDefault(p => p.StuID == id));
        }