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

            obj.Name = searchString;
            var list = CustomTimeCategoryDataManager.GetEntityDetails(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));
        }
示例#2
0
        public ActionResult Create(CustomTimeCategoryDataModel obj)
        {
            if (ModelState.IsValid)
            {
                CustomTimeCategoryDataManager.Create(obj, SessionVariables.RequestProfile);
                return(RedirectToAction("Index"));
            }

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

            obj.CustomTimeCategoryId = id;
            var list = CustomTimeCategoryDataManager.GetEntityDetails(obj, SessionVariables.RequestProfile);

            if (list == null || list.Count == 0)
            {
                return(null);
            }
            return(list[0]);
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetUpDateRangeControl();


            if (!IsPostBack)
            {
                var auData1 = CustomTimeCategoryDataManager.GetList(SessionVariables.RequestProfile);

                UIHelper.LoadDropDown(auData1, drpCustomTimeCategory, CustomTimeCategoryDataModel.DataColumns.Name,
                                      CustomTimeCategoryDataModel.DataColumns.CustomTimeCategoryId);
                drpApplicationUser.Items.Insert(0, "All");

                var auData = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);

                UIHelper.LoadDropDown(auData, drpApplicationUser, ApplicationUserDataModel.DataColumns.ApplicationUserName,
                                      ApplicationUserDataModel.DataColumns.ApplicationUserId);
                drpApplicationUser.Items.Insert(0, "All");

                txtPersonId.Visible = false;
            }
        }
示例#5
0
        public IEnumerable <CustomTimeCategoryDataModel> GetCustomTimeCategoryList()
        {
            var items = CustomTimeCategoryDataManager.GetEntityDetails(CustomTimeCategoryDataModel.Empty, SessionVariables.RequestProfile);

            return(items);
        }
示例#6
0
        public IEnumerable <CustomTimeCategoryDataModel> GetListCustomTimeCategory()
        {
            var dataQuery = new CustomTimeCategoryDataModel();

            return(CustomTimeCategoryDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile));
        }