You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ValuesController.cs 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Web.Http;
  3. using iiie.WebApiUtils.BusinessManager;
  4. using iiie.WebApiUtils.DBO;
  5. using WebAPiUtils_test.BusinessManager;
  6. using WebAPiUtils_test.DBO;
  7. namespace WebAPiUtils_test.Controllers
  8. {
  9. public class ValuesController : BMRHandler
  10. {
  11. [HttpGet]
  12. [Route("api/values/{id}")]
  13. public ValuesDboGet Get(int id)
  14. {
  15. return Handle(ValuesBusiness.Get(id));
  16. }
  17. [HttpGet]
  18. [Route("api/values/contains")]
  19. public DboGetMultiple<ValuesDboGet> Contains(string text, int page = 0, int perPage = Int32.MaxValue)
  20. {
  21. return Handle(ValuesBusiness.Contains(text, page, perPage));
  22. }
  23. [HttpPost]
  24. [Route("api/values/edit/{id}")]
  25. public DboGetSingle<bool> Edit(long id, ValuesDboEdit obj)
  26. {
  27. return HandleSingle(ValuesBusiness.Edit(obj, id));
  28. }
  29. [HttpPost]
  30. [Route("api/values/add")]
  31. public DboGetSingle<long> Add(ValuesDboAdd obj)
  32. {
  33. return HandleSingle(ValuesBusiness.Add(obj));
  34. }
  35. [HttpPost]
  36. [Route("api/values/adddbo")]
  37. public ValuesDboGet AddDbo(ValuesDboAdd obj)
  38. {
  39. return Handle(ValuesBusiness.AddDbo(obj));
  40. }
  41. [HttpPost]
  42. [Route("api/values/upload")]
  43. public DboGetSingle<string> Upload()
  44. {
  45. return HandleSingle(SaveFileToTemp().Result);
  46. }
  47. }
  48. }