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.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 DboUploadFile Upload()
  44. {
  45. return Handle(SaveFileToTemp().Result);
  46. }
  47. [HttpPost]
  48. [Route("api/values/upload2")]
  49. public DboUploadFile Upload2()
  50. {
  51. return Handle(SaveFileToTemp("file").Result);
  52. }
  53. }
  54. }