コード例 #1
0
        public HttpResponseMessage SaveTicket([FromBody] TICKETS1_DTO Model)
        {
            bool SuccessfullSave = TICKETS1Helper.Save(Model);

            if (!SuccessfullSave)
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }
            return(Request.CreateResponse(HttpStatusCode.Created));
        }
コード例 #2
0
        public HttpResponseMessage UpdateTicket([FromBody] TICKETS1_DTO Model)
        {
            bool sucessfullUpdate = TICKETS1Helper.updateTicket(Model);

            if (!sucessfullUpdate)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }

            return(Request.CreateResponse(HttpStatusCode.Created));
        }
コード例 #3
0
        public HttpResponseMessage GetTicketById(int id)
        {
            TICKETS1_DTO ticket = TICKETS1Helper.GetTicketByPrimaryKey(id);

            bool TheresData = ticket != null;

            if (!TheresData)
            {
                throw new HttpResponseException(HttpStatusCode.NoContent);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, ticket));
        }
コード例 #4
0
        public HttpResponseMessage GetTicketByUser(string username)
        {
            List <Spc_Get_Ticket_By_Usr_Request> tickets = TICKETS1Helper.GetTicketByUserRequest(username);

            bool TheresData = tickets != null;

            if (!TheresData)
            {
                throw new HttpResponseException(HttpStatusCode.NoContent);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, tickets));
        }
コード例 #5
0
        public HttpResponseMessage GetAllTicketsUserFollowed(int UsrId)
        {
            List <Spc_Get_Tickets_User_Followed_Result> ticketsList = TICKETS1Helper.GetTicketsFromUsersFollowed(UsrId);

            bool TheresData = ticketsList.Count > 0;

            if (!TheresData)
            {
                throw new HttpResponseException(HttpStatusCode.NoContent);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, ticketsList));
        }
コード例 #6
0
        public HttpResponseMessage GetAllTicketsDescrip()
        {
            List <Spc_Get_All_Tickets_With_Descrip> ticketsList = TICKETS1Helper.GetAllWithDescrip();

            bool TheresData = ticketsList.Count > 0;

            if (!TheresData)
            {
                throw new HttpResponseException(HttpStatusCode.NoContent);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, ticketsList));
        }
コード例 #7
0
        public HttpResponseMessage GetAllTickets()
        {
            List <TICKETS1_DTO> ticketsList = TICKETS1Helper.GetAll();

            bool TheresData = ticketsList.Count > 0;

            if (!TheresData)
            {
                throw new HttpResponseException(HttpStatusCode.NoContent);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, ticketsList));
        }