コード例 #1
0
        // GET: Positions
        public ActionResult Positions(int?page)
        {
            PositionModel model = new PositionModel();

            model.pageNumber = (page == null ? 1 : Convert.ToInt32(page));
            int currentPage                    = model.pageNumber;
            int pageSize                       = Common.pagesize;
            int totalRowCount                  = 0;
            List <PositionModel> lst           = dal.BindData(currentPage, pageSize, out totalRowCount);
            List <PositionModel> chkdeleteList = new List <PositionModel>();

            foreach (var p in lst)
            {
                bool enable = dal.CheckDelete(p.Pos_ID);
                p.IsDelete = enable;
                chkdeleteList.Add(p);
            }
            model.positions = chkdeleteList;
            if (lst.Count > 0)
            {
                List <ListItem> pager = Common.generatePager(totalRowCount, pageSize, currentPage);
                model.dlPager = pager;
            }
            return(View(model));
        }