Esempio n. 1
0
        // GET: Follow
        public ActionResult Index(int?page)
        {
            if (Session["LoginName"] != null)
            {
                ILog logger     = LogManager.GetLogger(typeof(MvcApplication));
                var  lg         = ((TB_LoginOn)Session["LoginName"]).AId;
                int  pageSize   = GetPageSize.IsMobileRequest();
                var  pageNumber = page ?? 1;

                switch (lg)
                {
                case 2:
                    var listA = db.TB_Follow.Include(t => t.BugSubmit).Include(t => t.LoginOn).Where(t => t.BugSubmit.YN == "N").OrderByDescending(t => t.BId).ToList();
                    //return View(tb_Follow.ToList());
                    IPagedList <TB_Follow> pagedListA = listA.ToPagedList(pageNumber, pageSize);

                    return(View(pagedListA));

                case 3:
                    var lid   = ((TB_LoginOn)Session["LoginName"]).LId;
                    var listB = db.TB_Follow.Include(t => t.BugSubmit).Include(t => t.LoginOn).Where(t => t.LId == lid && t.BugSubmit.YN == "N").OrderByDescending(t => t.BId).ToList();
                    //return View(tB_Follow.ToList());


                    IPagedList <TB_Follow> pagedListB = listB.ToPagedList(pageNumber, pageSize);

                    return(View(pagedListB));
                }
            }
            return(Content("<script>alert('您无权限进入该窗体!!');window.location.href='/Home/Index';</script>"));
            //return RedirectToAction("Index", "Home");
        }
Esempio n. 2
0
        public ActionResult LateFollow(int?page)
        {
            var addDate = DateTime.Now.AddDays(-1);
            var list    = db.TB_Follow.Include(t => t.BugSubmit).Include(t => t.LoginOn).Where(t => t.BugSubmit.YN == "N" && t.FollowDate < addDate).OrderByDescending(t => t.BId).ToList();

            int pageSize   = GetPageSize.IsMobileRequest();
            var pageNumber = page ?? 1;

            IPagedList <TB_Follow> pagedList = list.ToPagedList(pageNumber, pageSize);

            return(View(pagedList));
        }
Esempio n. 3
0
        //public X.PagedList.IPagedList<TB_BugSubmit> BugSubmit { get; set; }
        public async Task <ActionResult> Index(int?page)
        {
            SubBugEntities db = new SubBugEntities();

            var list = await db.TB_BugSubmit.Where(t => t.YN == "N").OrderByDescending(d => d.BId).ToListAsync();


            //int pageSize = int.Parse(ConfigurationManager.AppSettings["pageSize"]);
            int pageSize   = GetPageSize.IsMobileRequest();
            var pageNumber = page ?? 1;

            IPagedList <TB_BugSubmit> pagedList = list.ToPagedList(pageNumber, pageSize);

            return(View(pagedList));
        }
Esempio n. 4
0
        // GET: Schedule
        public ActionResult Index(int?page)
        {
            if (Session["LoginName"] != null)
            {
                var lg = ((TB_LoginOn)Session["LoginName"]).AId;
                if (lg == 2)
                {
                    var list = db.TB_Schedule.Include(t => t.BugSubmit).Include(t => t.Follow).Where(t => t.BugSubmit.YN == "N").OrderByDescending(t => t.BId).ToList();
                    //return View(tb_Follow.ToList());
                    int pageSize   = GetPageSize.IsMobileRequest();
                    var pageNumber = page ?? 1;
                    IPagedList <TB_Schedule> pagedList = list.ToPagedList(pageNumber, pageSize);

                    return(View(pagedList));
                }
            }
            //return RedirectToAction("Index", "Home");
            return(Content("<script>alert('您无权限进入该窗体!!');window.location.href='/Home/Index';</script>"));
        }
Esempio n. 5
0
        // GET: SysAdmin
        public ActionResult Index(int?page)
        {
            if (Session["LoginName"] != null)
            {
                var lg     = ((TB_LoginOn)Session["LoginName"]).AId;
                var result = db.TB_LoginOn.Where(t => t.AId == lg);
                //Console.WriteLine(result);
                if (lg == 2)
                {
                    var list       = db.TB_BugSubmit.Include(t => t.LoginOn).Where(t => t.BId != t.Follow.FirstOrDefault().BId&& t.YN == "N").OrderByDescending(t => t.BId);
                    int pageSize   = GetPageSize.IsMobileRequest();
                    var pageNumber = page ?? 1;

                    IPagedList <TB_BugSubmit> pagedList = list.ToPagedList(pageNumber, pageSize);
                    return(View(pagedList));
                }
            }
            //ViewData["info"] = "您无权进入该窗体!";
            return(Content("<script>alert('您无权限进入该窗体!!');window.location.href='/Home/Index';</script>"));
            //return RedirectToAction("Index", "Home");
        }
Esempio n. 6
0
        // GET: LoginAccess
        public ActionResult Index(int?page)
        {
            if (Session["LoginName"] != null)
            {
                var lg     = ((TB_LoginOn)Session["LoginName"]).AId;
                var result = db.TB_LoginOn.Where(t => t.AId == lg);
                //Console.WriteLine(result);
                if (lg == 2)
                {
                    var list = db.TB_LoginOn.Include(t => t.UserAccess).OrderByDescending(t => t.LId).ToList();
                    //return View(tB_LoginOn.ToList());
                    int pageSize   = GetPageSize.IsMobileRequest();
                    var pageNumber = page ?? 1;

                    IPagedList <TB_LoginOn> pagedList = list.ToPagedList(pageNumber, pageSize);

                    return(View(pagedList));
                }
            }
            return(Content("<script>alert('您无权限进入该窗体!!');window.location.href='/Home/Index';</script>"));
            //return RedirectToAction("Index", "Home");
            //return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        }
Esempio n. 7
0
        public ActionResult SelectList(int?page, string searchString, string strST, string strET, string currentFilter, string currentST, string currentET)
        {
            SubBugEntities    db         = new SubBugEntities();
            List <TB_LoginOn> listSelect = db.TB_LoginOn.Where(t => t.AId != 1 && t.LoginName != "Guest").ToList();

            //ViewData["STime"] = strST;
            //ViewData["ETime"] = strET;
            //ViewData["LoginName"] = searchString;
            searchString = Request.Params["LoginName"];
            strST        = Request.Params["STime"];
            strET        = Request.Params["ETime"];

            var list       = new List <TB_Schedule>();
            int pageSize   = GetPageSize.IsMobileRequest();
            var pageNumber = page ?? 1;

            if (!string.IsNullOrWhiteSpace(searchString) || (strST != null && strET != null))
            {
                pageNumber = 1;
            }
            else
            {
                searchString = currentFilter;
                strST        = currentST;
                strET        = currentET;
            }
            SelectList selList = new SelectList(listSelect, "LoginName", "LoginName", searchString);

            ViewData["Select"]        = selList;
            ViewData["CurrentFilter"] = searchString;
            ViewData["CurrentST"]     = strST;
            ViewData["CurrentET"]     = strET;

            list = db.TB_Schedule.Include(t => t.Follow).Include(t => t.BugSubmit).Where(t => t.BugSubmit.YN == "Y").OrderByDescending(t => t.FinishDate).ToList();
            //int TotalCount = list.Count();
            if (!string.IsNullOrWhiteSpace(searchString) && !string.IsNullOrEmpty(strST) && !string.IsNullOrEmpty(strET))
            {
                //list = list.Where(t => t.Follow.LoginOn.LoginName.Contains(searchString)).ToList();
                list = list.Where(t => t.FinishDate >= Convert.ToDateTime(strST) && t.FinishDate <= Convert.ToDateTime(strET) && t.Follow.LoginOn.LoginName.Contains(searchString)).ToList();
                IPagedList <TB_Schedule> pagedListD = list.ToPagedList(pageNumber, pageSize);
                //TotalCount = list.Count();
                return(View(pagedListD));
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(searchString))
                {
                    list = list.Where(t => t.Follow.LoginOn.LoginName.Contains(searchString)).ToList();
                    IPagedList <TB_Schedule> pagedListA = list.ToPagedList(pageNumber, pageSize);
                    //TotalCount = list.Count();
                    return(View(pagedListA));
                }
                if (!string.IsNullOrEmpty(strST) && !string.IsNullOrEmpty(strET))
                {
                    list = list.Where(t => t.FinishDate >= Convert.ToDateTime(strST) && t.FinishDate <= Convert.ToDateTime(strET)).ToList();
                    IPagedList <TB_Schedule> pagedListB = list.ToPagedList(pageNumber, pageSize);
                    //TotalCount = list.Count();
                    return(View(pagedListB));
                }
            }
            IPagedList <TB_Schedule> pagedListC = list.ToPagedList(pageNumber, pageSize);

            return(View(pagedListC));
        }