示例#1
0
        //
        // GET: /ReleaseNoteBusinessDifficulty/
        public ActionResult Index(string searchString, int?page, int?pageSize)
        {
            var obj = new DBProjectNameDataModel();

            obj.Name = searchString;

            var list = DBProjectNameDataManager.GetEntityDetails(obj, SessionVariables.RequestProfile);

            if (pageSize.HasValue)
            {
                SessionVariables.DefaultRowCount = pageSize.Value;
            }

            var pageNumber = (page - 1 ?? 0);

            ViewBag.searchString = searchString;

            ViewBag.CurrentPage = list.Count > 0 ? pageNumber + 1 : 0;
            ViewBag.TotalPages  = list.Count / SessionVariables.DefaultRowCount;
            if (list.Count % SessionVariables.DefaultRowCount != 0)
            {
                ViewBag.TotalPages = (list.Count / SessionVariables.DefaultRowCount) + 1;
            }

            list = list.Count > 0 ? list.Skip(pageNumber * SessionVariables.DefaultRowCount).Take(SessionVariables.DefaultRowCount).ToList() : list;

            return(View(list));
        }
示例#2
0
        public ActionResult Create(DBProjectNameDataModel obj)
        {
            if (ModelState.IsValid)
            {
                DBProjectNameDataManager.Create(obj, SessionVariables.RequestProfile);
                return(RedirectToAction("Index"));
            }

            return(View(obj));
        }
示例#3
0
        public ActionResult Delete(DBProjectNameDataModel obj)
        {
            if (ModelState.IsValid)
            {
                DBProjectNameDataManager.Delete(obj, SessionVariables.AuditId);
                return(RedirectToAction("Index"));
            }

            return(View(obj));
        }
示例#4
0
        public DBProjectNameDataModel GetById(int id)
        {
            var obj = new DBProjectNameDataModel();

            obj.DBProjectNameId = id;
            var list = DBProjectNameDataManager.GetEntityDetails(obj, SessionVariables.RequestProfile);

            if (list == null || list.Count == 0)
            {
                return(null);
            }
            return(list[0]);
        }