Beispiel #1
0
        public HttpResponseMessage Index(string sortProperty, int pageNumber, int pageSize)
        {
            int    totalCount;
            string realSortProperty;

            var messages = _uow.GetRepository <IMessageThreadRepository>().GetUserThreads(User.Identity.GetUserId <int>(), sortProperty, pageNumber, pageSize, out totalCount, out realSortProperty);
            var response = Request.CreateResponse(HttpStatusCode.OK, messages);

            // Set headers for paging
            response.Headers.Add("X-Paging-PageNo", pageNumber.ToString());
            response.Headers.Add("X-Paging-PageSize", pageSize.ToString());
            response.Headers.Add("X-RealSortProperty", realSortProperty);
            response.Headers.Add("X-Paging-TotalRecordCount", totalCount.ToString());

            return(response);
        }
Beispiel #2
0
        public HttpResponseMessage Index(string blogName, string sortProperty, int pageNumber, int pageSize)
        {
            int    totalCount;
            string realSortProperty;

            IEnumerable <Blog> blogs = _uow.GetRepository <IBlogRepository>().GetList(blogName, sortProperty, pageNumber, pageSize, out totalCount, out realSortProperty);
            var response             = Request.CreateResponse(HttpStatusCode.OK, blogs);

            // Set headers for paging
            response.Headers.Add("X-Paging-PageNo", pageNumber.ToString());
            response.Headers.Add("X-Paging-PageSize", pageSize.ToString());
            response.Headers.Add("X-RealSortProperty", realSortProperty);
            response.Headers.Add("X-Paging-TotalRecordCount", totalCount.ToString());

            return(response);
        }
        public IHttpActionResult Index(MessageThreadReceiver messageReceiver)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            _uow.GetRepository <IMessageThreadReceiverRepository>().Add(messageReceiver);

            _uow.Commit();

            return(Ok(messageReceiver));
        }
Beispiel #4
0
 public List <BlogPost> GetUserBlogPosts(int limit = 10)
 {
     return
         (_uow.GetRepository <IBlogPostRepository>()
          .GetDashBoardFavoriteBlogBlogPosts(User.Identity.GetUserId <int>(), limit));
 }
 // GET: UserLogins
 public ActionResult Index()
 {
     return(View(_uow.GetRepository <IUserLoginIntRepository>().GetAllIncludeUser()));
 }
 // GET: UserRoles/Create
 public ActionResult Create()
 {
     ViewBag.RoleId = new SelectList(_uow.GetRepository <IRoleIntRepository>().All, "Id", "Name");
     ViewBag.UserId = new SelectList(_uow.GetRepository <IUserIntRepository>().All, "Id", "Email");
     return(View());
 }
Beispiel #7
0
 public List <Message> UserThreadMessages(int threadId)
 {
     return(_uow.GetRepository <IMessageRepository>()
            .GetAllByThreadIdAndUserId(threadId, Convert.ToInt32(User.Identity.GetUserId())));
 }
Beispiel #8
0
 public IHttpActionResult Index(string answer)
 {
     return(Ok((new AnswerService(_uow.GetRepository <IAnswerRepository>())).GetListByAnswerText(answer)));
 }
        public IHttpActionResult Index(string name = "", string description = "")
        {
            QuestionService service = new QuestionService(_uow.GetRepository <IQuestionRepository>());

            return(Ok(service.GetQuestions(name, description)));
        }
Beispiel #10
0
 // GET: Questions
 public ActionResult Index(string name = "", string description = "")
 {
     return(View(_uow.GetRepository <IQuestionRepository>().GetList(name, description).ToList()));
 }
Beispiel #11
0
        public HttpResponseMessage Index(string sortProperty, int pageNumber, int pageSize)
        {
            int    totalCount;
            string realSortProperty;

            VehicleService           service  = new VehicleService(_uow.GetRepository <IVehicleRepository>());
            List <IndexVehicleModel> vehicles = service.GetUserVehiclesList(User.Identity.GetUserId <int>(), sortProperty,
                                                                            pageNumber, pageSize, out totalCount, out realSortProperty);

            var response = Request.CreateResponse(HttpStatusCode.OK, vehicles);

            // Set headers for paging
            response.Headers.Add("X-Paging-PageNo", pageNumber.ToString());
            response.Headers.Add("X-Paging-PageSize", pageSize.ToString());
            response.Headers.Add("X-RealSortProperty", realSortProperty);
            response.Headers.Add("X-Paging-TotalRecordCount", totalCount.ToString());

            return(response);
        }