Ejemplo n.º 1
0
        public StudentViewModel()
        {
            _deleteCommand     = new Command(OnDelete);
            _updateCommand     = new Command(OnUpdate);
            _addCommand        = new Command(OnAdd);
            _pageChangeCommand = new Command(OnPageChange);

            _firstpage  = 1; _secondpage = 2; _thirdpage = 3;
            _prev       = "‹"; _next = "";
            _firstcolor = _secondcolor = _thirdcolor = Brushes.Black;
            _total      = (int)studentDAO.Count();
            _pageSize   = _total / _limit;
            _count      = $"{_total} adet kayıt var";
            List.Clear();
            foreach (var item in studentDAO.Find(1, _limit, _pageSize))
            {
                List.Add(item);
            }

            //BindData();
        }
Ejemplo n.º 2
0
        public JsonResult Gets(string key = "", int status = 2, int page = 1, int pageSize = 5)
        {
            try
            {
                List <Student> data     = dao.Gets(key, status, page, pageSize);
                int            totalRow = dao.Count(key, status);

                return(Json(new
                {
                    data = data,
                    totalRow = totalRow
                }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(new
                {
                    data = DBNull.Value.ToString()
                }, JsonRequestBehavior.AllowGet));
            }
        }