Example #1
0
        public List <mis_manager> GetManagerList(int pageIndex, int pageSize)
        {
            helpsEntities helps = new helpsEntities();
            string        sql   = "declare @pagesize int declare @pageindex int set @pageindex=" + pageIndex + " set @pagesize=" + pageSize + " select* from(select ROW_NUMBER() OVER(ORDER BY ID desc) as num,*from[mis_manager]) temp where num between @pageIndex* @pagesize-(@pageSize - 1) and @pageIndex*@pageSize";

            return(helps.mis_manager.SqlQuery(sql).ToList());
        }
Example #2
0
        public List <mis_manager> GetManagerList(int pageIndex, int pageSize, string where)
        {
            helpsEntities helps = new helpsEntities();
            string        sql   = "declare @pagesize int declare @pageindex int set @pageindex=" + pageIndex + " set @pagesize=" + pageSize + " select* from(select ROW_NUMBER() OVER(ORDER BY ID desc) as num,*from[mis_manager] where CONCAT( [name],[addres],[phone] ,[subject],[class]) LIKE '%" + where + "%') temp where num between @pageIndex* @pagesize-(@pageSize - 1) and @pageIndex*@pageSize";

            return(helps.mis_manager.SqlQuery(sql).ToList());
        }
Example #3
0
        public List <mis_manager> ExportExcle(string where)
        {
            helpsEntities helps = new helpsEntities();
            string        sql   = "select * from mis_manager where CONCAT( [name],[addres],[phone] ,[subject],[class]) LIKE '%name%';";

            return(helps.mis_manager.SqlQuery(sql).ToList());
        }
Example #4
0
        public int AddManagerInfo(mis_manager misManager)
        {
            helpsEntities helps = new helpsEntities();

            helps.mis_manager.Add(misManager);
            helps.SaveChanges();
            return(1);
        }
Example #5
0
        public int GetManagerCount(string where)
        {
            helpsEntities helps = new helpsEntities();
//            return helps.mis_manager.Where(c=>c.name==name).Count();
            string             sql  = "SELECT * FROM mis_manager WHERE CONCAT( [name],[addres],[phone] ,[subject],[class]) LIKE '%" + where + "%'";
            List <mis_manager> list = helps.mis_manager.SqlQuery(sql).ToList();

            return(list.Count);
        }
Example #6
0
        public int LoginCheck(admin admin)
        {
            helpsEntities helps = new helpsEntities();
            List <admin>  list  = helps.admin.Where(u => u.username == admin.username && u.password == admin.password).ToList();

            if (list.Count >= 1)
            {
                return(list.Count);
            }
            else
            {
                return(-1);
            }
        }
Example #7
0
        public bool CheckAdmin(admin a)
        {
            helpsEntities helps = new helpsEntities();
//            string sql = "update  admin set password='******' where username='******'";
            //List<mis_manager> list= helps.Database.SqlQuery<mis_manager>(sql).ToList();
            List <admin> list = helps.admin.Where(m => m.username == a.username && m.password == a.password).ToList();

            if (list.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #8
0
        public bool UpdataAdmin(admin a)
        {
            helpsEntities helps = new helpsEntities();
//            string sql = "update  admin set password='******' where username='******'";
            admin admin = helps.admin.Where(c => c.username == a.username).FirstOrDefault();

            admin.password = a.password;
            if (helps.SaveChanges() > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #9
0
        public bool CheckManager(mis_manager mis)
        {
            helpsEntities helps = new helpsEntities();
//            string sql = "select * from mis_manager where name=@name and  addres=@phone";
            //List<mis_manager> list= helps.Database.SqlQuery<mis_manager>(sql).ToList();
            List <mis_manager> list = helps.mis_manager.Where(m => m.name == mis.name && m.phone == mis.phone).ToList();

            if (list.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #10
0
        public int GetManagerCount()
        {
            helpsEntities helps = new helpsEntities();

            return(helps.mis_manager.Count());
        }
Example #11
0
        public List <mis_manager> FindManagerList()
        {
            helpsEntities helps = new helpsEntities();

            return(helps.mis_manager.ToList());
        }
Example #12
0
        public List <mis_manager> ExportExcle()
        {
            helpsEntities helps = new helpsEntities();

            return(helps.mis_manager.ToList());
        }