/*[Route("api/routing/{page:int}/{pageSize:int}")]
  * public IHttpActionResult GetAllFixed(int page, int pageSize)
  * {
  *  try
  *  {
  *      var routes = new WorkflowRouteCountDTO(Service.GetAllFixed(page, pageSize));
  *      if (routes.Routes.Count != 0)
  *      {
  *          return Ok(routes.Routes);
  *      }
  *      return ResponseMessage(new ResponseMessageService(HttpStatusCode.NotFound, "No invoice categories found.", Request.RequestUri.AbsoluteUri));
  *  }
  *  catch (Exception e)
  *  {
  *      return ExceptionMSG(e);
  *  }
  * }*/
 public IHttpActionResult Put([FromBody] ITS_WF_Route rut)
 {
     try
     {
         return(Utils.Response(new WorkflowRouteDTO(Service.Update(rut)), HttpStatusCode.NotFound, string.Format("Could not update route{0}.", rut.RoleTo), Request.RequestUri.AbsoluteUri));
     }
     catch (Exception e)
     {
         return(ExceptionMSG(e));
     }
 }
 public IHttpActionResult Get(int id)
 {
     try
     {
         return(Utils.Response(new InvoiceCategoriesDTO(Service.Get(id)), HttpStatusCode.NotFound, string.Format("Invoice category with Id {0} not found.", id), Request.RequestUri.AbsoluteUri));
     }
     catch (Exception e)
     {
         return(ExceptionMSG(e));
     }
 }
 public IHttpActionResult Get(int id)
 {
     try
     {
         return(Utils.Response(new ViewRoutesDTO(service.GetRoute(id)), HttpStatusCode.NotFound, string.Format("route with Id {0} not found.", id), Request.RequestUri.AbsoluteUri));
     }
     catch (Exception e)
     {
         return(ExceptionMSG(e));
     }
 }
        /*public IHttpActionResult Get(int id)
         * {
         *  try
         *  {
         *      return Util.Response(new UpdateSupplierInvoiceDTO( Service.Get(id)), HttpStatusCode.NotFound, string.Format("Supplier invoice with Id {0} not found.", id), Request.RequestUri.AbsoluteUri);
         *  }
         *  catch (Exception e)
         *  {
         *      return ExceptionMSG(e);
         *  }
         * }*/

        public IHttpActionResult Put([FromBody] ITS_SupplierInvoice invUpdate)
        {
            try
            {
                return(Util.Response(new UpdateSupplierInvoiceDTO(Service.Update(invUpdate)), HttpStatusCode.NotFound, string.Format("Could not update invoice {0}.", invUpdate.InvoiceNumber), Request.RequestUri.AbsoluteUri));
            }
            catch (Exception e)
            {
                return(ExceptionMSG(e));
            }
        }
 public IHttpActionResult Post([FromBody] ITS_Notes notes)
 {
     try
     {
         return(Util.Response(new NotesDTO(service.Add(notes)), HttpStatusCode.InternalServerError, string.Format("Could not create invoice notes {0}.", notes.SupplierInvoiceID), Request.RequestUri.AbsoluteUri));
     }
     catch (Exception e)
     {
         return(ExceptionMSG(e));
     }
 }
 public IHttpActionResult Get(int id)
 {
     return(util.Response(new RoleDTO(service.Get(id)), HttpStatusCode.NotFound, string.Format("Role with ID {0} not found.", id), Request.RequestUri.AbsoluteUri));
 }
Beispiel #7
0
 public IHttpActionResult Get(int id)
 {
     return(Utils.Response(MapService.MapOne <ITS_DocumentType, DocumentTypeDTO>(Service.Get(id)), HttpStatusCode.NotFound, string.Format("Document type with Id {0} not found.", id), Request.RequestUri.AbsoluteUri));
 }
Beispiel #8
0
 public IHttpActionResult PutLinkedDoctype([FromBody] DoctypesLinksDTO docTypeLink)
 {
     return(DtUtil.Response(Service.UpdateLink(docTypeLink), HttpStatusCode.NotFound, string.Format("Could not update link for document type {0}.", docTypeLink.DocumentType), Request.RequestUri.AbsoluteUri));
 }
Beispiel #9
0
 public IHttpActionResult Get(int id)
 {
     return(Utils.Response(Service.Get(id), HttpStatusCode.NotFound, string.Format("Status with Id {0} not found.", id), Request.RequestUri.AbsoluteUri));
 }
 public IHttpActionResult GetFindByInvoiceNumber(string InvNum)
 {
     return(InvUDto.Response(InvoiceService.GetInvoiceNumber(InvNum), HttpStatusCode.NotFound, string.Format("Supplier's Invoice with Invoice Number {0} not found.", InvNum), Request.RequestUri.AbsoluteUri));
 }
 // POST api/<controller>
 public IHttpActionResult Post([FromBody] ITS_Supplier supplier)
 {
     return(Utils.Response(Service.Add(supplier), HttpStatusCode.InternalServerError, string.Format("Could not create supplier {0}.", supplier.Name), Request.RequestUri.AbsoluteUri));
 }
 public IHttpActionResult Get(int id)
 {
     return(UDto.Response(new SupplierDTO(Service.Get(id)), HttpStatusCode.NotFound, string.Format("Supplier with Id {0} not found.", id), Request.RequestUri.AbsoluteUri));
 }