Esempio n. 1
0
 public ActionResult UsersList(string name, string RoleType, string DEPAR_ID, string StatusIS, int page = 1, int limit = 10)
 {
     try
     {
         db.Configuration.LazyLoadingEnabled   = false;
         db.Configuration.ProxyCreationEnabled = false;
         var query = db.Users.Where(x => 1 == 1);
         if (!string.IsNullOrEmpty(name))
         {
             query = db.Users.Where(x => x.NAME.Contains(name));
         }
         if (!string.IsNullOrEmpty(RoleType))
         {
             query = db.Users.Where(x => x.ROLEID.ToString() == RoleType);
         }
         if (!string.IsNullOrEmpty(DEPAR_ID))
         {
             query = db.Users.Where(x => x.DEPAR_ID.ToString() == DEPAR_ID);
         }
         if (!string.IsNullOrEmpty(StatusIS))
         {
             query = db.Users.Where(x => x.STATUS.ToString() == StatusIS);
         }
         var list  = query.OrderBy(x => x.Id).Skip((page - 1) * limit).Take(limit).ToList();
         int total = query.Count();
         var str   = PagerDate.PagedData <User>(list, total);
         return(Content(str));
     }
     catch (Exception ex)
     {
         return(Json(new UIResult(false, ex.Message)));
     }
 }
Esempio n. 2
0
        public ActionResult WelCome(int Page = 1, int PageSize = 10)
        {
            var query = db.Plants.Where(x => x.CARRY_USER == User.Identity.Name && x.IN_FLAG == 0);
            var total = query.Count();
            var list  = query.OrderBy(x => true).Skip((Page - 1) * PageSize).Take(PageSize).ToList();
            var str   = PagerDate.PagedData <Plant>(list, total);

            return(Content(str));
        }
Esempio n. 3
0
        public ActionResult RolepermissonList(string RolType, int Page, int limit)
        {
            string sqldb   = "select DISTINCT (b.ActionTitle),b.ID ,b.href,RoleName,c.Title ,b.Update_time from Role a, ControllerAction b,Controller c where b.ParentID <> 0 and a.ID = b.RoleID and b.ControllID = c.ID and a.ID like '" + RolType + "%'";
            var    sqllist = db.Database.SqlQuery <PersonView>(sqldb).ToList();
            int    total   = sqllist.Count();
            var    list    = sqllist.OrderBy(x => x.ID).Skip((Page - 1) * limit).Take(limit).ToList();
            var    str     = PagerDate.PagedData <PersonView>(list, total);

            return(Content(str));
        }
Esempio n. 4
0
        public ActionResult ExtraWorkList(string CHECK_FLAG, int Page, int limit)
        {
            db.Configuration.LazyLoadingEnabled   = false;
            db.Configuration.ProxyCreationEnabled = false;
            var query = db.OverTimes.Where(x => x.NAME == User.Identity.Name);

            if (!string.IsNullOrWhiteSpace(CHECK_FLAG))
            {
                query = query.Where(x => x.CHECK_FLAG.ToString() == CHECK_FLAG);
            }
            int total = query.Count();
            var list  = query.OrderBy(x => x.ID).Skip((Page - 1) * limit).Take(limit).ToList();
            var str   = PagerDate.PagedData <OverTime>(list, total);

            return(Content(str));
        }
Esempio n. 5
0
        public ActionResult CustomerList(string Name, string CType, int Page = 1, int PageSize = 10)
        {
            db.Configuration.LazyLoadingEnabled   = false;
            db.Configuration.ProxyCreationEnabled = false;
            var query = db.Clients.Where(x => x.CLIENT_USER == User.Identity.Name);

            if (!string.IsNullOrEmpty(Name))
            {
                query = db.Clients.Where(x => x.CLIENT_NAME.Contains(Name));
            }
            if (!string.IsNullOrEmpty(CType))
            {
                query = query.Where(x => x.CLIENT_TYPE_ID.ToString() == CType);
            }
            int total = query.Count();
            var list  = query.OrderBy(x => x.ID).Skip((Page - 1) * PageSize).Take(PageSize).ToList();
            var str   = PagerDate.PagedData <Client>(list, total);

            return(Content(str));
        }
Esempio n. 6
0
        public ActionResult Project(string Title, string Status, int page, int limit)
        {
            db.Configuration.LazyLoadingEnabled   = false;
            db.Configuration.ProxyCreationEnabled = false;
            var query = db.Plants.Where(x => x.CARRY_USER == User.Identity.Name.ToString());

            if (!string.IsNullOrEmpty(Title))
            {
                query = query.Where(x => x.PLANT_NAME.Contains(Title));
            }
            if (!string.IsNullOrEmpty(Status))
            {
                query = query.Where(x => x.IN_FLAG.ToString() == Status);
            }
            var list  = query.OrderBy(x => x.ID).Skip((page - 1) * limit).Take(limit).ToList();
            int total = query.Count();
            var str   = PagerDate.PagedData <Plant>(list, total);

            return(Content(str));
        }
Esempio n. 7
0
 public ActionResult LeaveList(string LEAVE_TYPE, int Page = 1, int PageSize = 10)
 {
     try
     {
         db.Configuration.LazyLoadingEnabled   = false;
         db.Configuration.ProxyCreationEnabled = false;
         var query = db.Leaves.Where(x => x.LEAVE_NAME == User.Identity.Name);
         if (!string.IsNullOrEmpty(LEAVE_TYPE))
         {
             query = query.Where(x => x.LEAVE_TYPE.ToString() == LEAVE_TYPE);
         }
         int total = query.Count();
         var list  = query.OrderBy(x => x.ID).Skip((Page - 1) * PageSize).Take(PageSize).ToList();
         var str   = PagerDate.PagedData <Leave>(list, total);
         return(Content(str));
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 8
0
        public ActionResult DeptmentList(string name, int page = 1, int limit = 10)
        {
            try
            {
                db.Configuration.LazyLoadingEnabled   = false;
                db.Configuration.ProxyCreationEnabled = false;
                var query = db.Departments.Where(x => 1 == 1);
                if (!string.IsNullOrEmpty(name))
                {
                    query = db.Departments.Where(x => x.DepNAME.Contains(name));
                }

                var list  = query.OrderBy(x => x.ID).Skip((page - 1) * limit).Take(limit).ToList();
                int total = query.Count();
                var str   = PagerDate.PagedData <Department>(list, total);
                return(Content(str));
            }
            catch (Exception ex)
            {
                return(Json(new UIResult(false, ex.Message)));
            }
        }
Esempio n. 9
0
        public ActionResult ExtraWorkPass(string NAME, string DEPART_ID, string CHECK_FLAG, int Page = 1, int PageSize = 10)
        {
            db.Configuration.LazyLoadingEnabled   = false;
            db.Configuration.ProxyCreationEnabled = false;
            var query = db.OverTimes.Where(x => x.ID > 0);

            if (!string.IsNullOrEmpty(NAME))
            {
                query = db.OverTimes.Where(x => x.NAME.Contains(NAME));
            }
            if (!string.IsNullOrEmpty(DEPART_ID))
            {
                query = query.Where(x => x.DEPART_ID.ToString() == DEPART_ID);
            }
            if (!string.IsNullOrEmpty(CHECK_FLAG))
            {
                query = query.Where(x => x.CHECK_FLAG.ToString() == CHECK_FLAG);
            }
            int total = query.Count();
            var list  = query.OrderBy(x => x.ID).Skip((Page - 1) * PageSize).Take(PageSize).ToList();
            var str   = PagerDate.PagedData <OverTime>(list, total);

            return(Content(str));
        }
Esempio n. 10
0
        public ActionResult LeavePass(string DEPART_ID, string LEAVE_TYPE, string LEAVE_NAME, int Page = 1, int PageSize = 10)
        {
            db.Configuration.LazyLoadingEnabled   = false;
            db.Configuration.ProxyCreationEnabled = false;
            var query = db.Leaves.Where(x => true);

            if (!string.IsNullOrEmpty(LEAVE_NAME))
            {
                query = db.Leaves.Where(x => x.LEAVE_NAME.Contains(LEAVE_NAME));
            }
            if (!string.IsNullOrEmpty(DEPART_ID))
            {
                query = query.Where(x => x.DEPART_ID.ToString() == DEPART_ID);
            }
            if (!string.IsNullOrEmpty(LEAVE_TYPE))
            {
                query = query.Where(x => x.LEAVE_TYPE.ToString() == LEAVE_TYPE);
            }
            int total = query.Count();
            var list  = query.OrderBy(x => x.ID).Skip((Page - 1) * PageSize).Take(PageSize).ToList();
            var str   = PagerDate.PagedData <Leave>(list, total);

            return(Content(str));
        }