コード例 #1
0
        public HttpResponseMessage DeletePriceMargin(int id)
        {
            SuccessResponse response = new SuccessResponse();

            PriceMarginsService.DeletePriceMargin(id);
            return(Request.CreateResponse(response));
        }
コード例 #2
0
        public HttpResponseMessage GetPriceMargin(int id)
        {
            ItemResponse <PriceMargins> response = new ItemResponse <PriceMargins>();

            response.Item = PriceMarginsService.GetPriceMargin(id);
            return(Request.CreateResponse(response));
        }
コード例 #3
0
        public HttpResponseMessage GetListOfPriceMargins(int clientId)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            ItemsResponse <PriceMargins> response = new ItemsResponse <PriceMargins>();

            response.Items = PriceMarginsService.GetPriceMarginsByAdmin(clientId);
            return(Request.CreateResponse(response));
        }
コード例 #4
0
        public HttpResponseMessage UpdatePriceMargin(UpdatePriceMarginRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            SuccessResponse response = new SuccessResponse();

            PriceMarginsService.UpdatePriceMargin(model);
            return(Request.CreateResponse(response));
        }
コード例 #5
0
        public HttpResponseMessage AddPriceMargin(AddPriceMarginRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            ItemResponse <int> response = new ItemResponse <int>();

            response.Item = PriceMarginsService.UpdatePriceMargin(model);
            return(Request.CreateResponse(response));
        }