Esempio n. 1
0
        public ActionResult Index2(string searchString, int?page, int?pageSize)
        {
            var obj = new ReleaseNoteTechnicalDifficultyDataModel();

            obj.Name = searchString;
            var list = ReleaseNoteTechnicalDifficultyDataManager.GetEntitySearch(obj, SessionVariables.RequestProfile);

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

            int 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));
        }
Esempio n. 2
0
        public JsonResult IndexResult(string name, int?page, int?pageSize)
        {
            var obj = new ReleaseNoteTechnicalDifficultyDataModel();

            obj.Name = name;
            var list = ReleaseNoteTechnicalDifficultyDataManager.GetEntitySearch(obj, SessionVariables.RequestProfile);

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public ActionResult Create(ReleaseNoteTechnicalDifficultyDataModel obj)
        {
            if (ModelState.IsValid)
            {
                ReleaseNoteTechnicalDifficultyDataManager.Create(obj, SessionVariables.RequestProfile);
                return(RedirectToAction("Index"));
            }

            return(View(obj));
        }
Esempio n. 4
0
        public ActionResult Delete(List <ReleaseNoteTechnicalDifficultyDataModel> items)
        {
            if (ModelState.IsValid)
            {
                foreach (var item in items)
                {
                    ReleaseNoteTechnicalDifficultyDataManager.Delete(item, SessionVariables.RequestProfile);
                }
                return(RedirectToAction("Index"));
            }

            return(View(items));
        }
Esempio n. 5
0
        public ReleaseNoteTechnicalDifficultyDataModel GetById(int id)
        {
            var obj = new ReleaseNoteTechnicalDifficultyDataModel();

            obj.ReleaseNoteTechnicalDifficultyId = id;
            var list = ReleaseNoteTechnicalDifficultyDataManager.GetEntityDetails(obj, SessionVariables.RequestProfile);

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