public HttpResponseMessage DeletePriceMargin(int id) { SuccessResponse response = new SuccessResponse(); PriceMarginsService.DeletePriceMargin(id); return(Request.CreateResponse(response)); }
public HttpResponseMessage GetPriceMargin(int id) { ItemResponse <PriceMargins> response = new ItemResponse <PriceMargins>(); response.Item = PriceMarginsService.GetPriceMargin(id); return(Request.CreateResponse(response)); }
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)); }
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)); }
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)); }