/// <summary>
        /// Kullanıcı Tanımları formunda kulanılıyor.
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="jqGridAjax"></param>
        /// <returns></returns>
        public ActionResult FormUserRightSetByUser(int Id, JqGridAjaxPostModel jqGridAjax)
        {
            var userrightlist = _formUserRightSetService.GetAllFormUserRightsByUserId(Id);
            var result        = from a in userrightlist.Take(jqGridAjax.page * jqGridAjax.rows)
                                .Skip((jqGridAjax.page - 1) * jqGridAjax.rows).OrderByDescending(k => k.Id).ToList()
                                select new[] {
                a.Id.ToString(),
                a.FormId.ToString(),
                a.FormName,
                a.ViewRight == true ? "Var" : "Yok",
                a.InsertRight == true ? "Var" : "Yok",
                a.UpdateRight == true ? "Var" : "Yok",
                a.DeleteRight == true ? "Var" : "Yok",
                a.UserId.ToString(),
                a.Id.ToString(),
            };

            return(Json(new
            {
                total = userrightlist.Count == 0 ? 0 :
                        (int)Math.Ceiling((decimal)userrightlist.Count / jqGridAjax.rows),
                jqGridAjax.page,
                records = userrightlist.Count(),
                rows = result
            }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public ActionResult PositionListByDepartment(int Id, JqGridAjaxPostModel jqGridAjax)
        {
            var positionList = _positionService.GetAllPositionsByDepartmentId(Id);
            var result       = from a in positionList.Take(jqGridAjax.page * jqGridAjax.rows)
                               .Skip((jqGridAjax.page - 1) * jqGridAjax.rows).OrderByDescending(k => k.Id).ToList()
                               select new[] {
                a.Id.ToString(),
                a.Name,
                a.Description,
                a.DepartmentId.ToString(),
                a.Id.ToString(),
            };

            return(Json(new
            {
                total = positionList.Count == 0 ? 0 :
                        (int)Math.Ceiling((decimal)positionList.Count / jqGridAjax.rows),
                jqGridAjax.page,
                records = _positionService.GetPositionViewCount(),
                rows = result
            }, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public ActionResult UserPositionListByPositionId(int Id, JqGridAjaxPostModel jqGridAjax)
        {
            var userpositionList = _userpositionService.GetAllUserPositions(k => k.PositionId == Id);
            var result           = from a in userpositionList.Take(jqGridAjax.page * jqGridAjax.rows)
                                   .Skip((jqGridAjax.page - 1) * jqGridAjax.rows).OrderByDescending(k => k.Id).ToList()
                                   select new[] {
                a.Id.ToString(),
                a.PositionName,
                a.UserName,
                a.PositionId.ToString(),
                a.UserId.ToString(),
                a.Id.ToString(),
            };

            return(Json(new
            {
                total = userpositionList.Count == 0 ? 0 :
                        (int)Math.Ceiling((decimal)userpositionList.Count / jqGridAjax.rows),
                jqGridAjax.page,
                records = userpositionList.Count(),
                rows = result
            }, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        public ActionResult UserListByCustomer(int Id, JqGridAjaxPostModel jqGridAjax)
        {
            var userlist = _userService.GetUserByCustomerId(Id);
            var result   = from a in userlist.Take(jqGridAjax.page * jqGridAjax.rows)
                           .Skip((jqGridAjax.page - 1) * jqGridAjax.rows).OrderByDescending(k => k.Id).ToList()
                           select new[] {
                a.Id.ToString(),
                a.FirstName,
                a.LastName,
                a.Email,
                a.Password,
                a.CustomerId.ToString(),
                a.Id.ToString(),
            };

            return(Json(new
            {
                total = userlist.Count == 0 ? 0 :
                        (int)Math.Ceiling((decimal)userlist.Count / jqGridAjax.rows),
                jqGridAjax.page,
                records = userlist.Count(),
                rows = result
            }));
        }