CustomerInfoController.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using System.Web;
  6. using System.Web.Mvc;
  7. using Abp.Application.Services.Dto;
  8. using Abp.Extensions;
  9. using Abp.UI;
  10. using ShwasherSys.BaseSysInfo.States;
  11. using ShwasherSys.CustomerInfo;
  12. namespace ShwasherSys.Controllers
  13. {
  14. public class CustomerInfoController : ShwasherControllerBase
  15. {
  16. protected CustomersAppService CustomersAppService;
  17. public CustomerInfoController(CustomersAppService customersAppService,IStatesAppService statesAppService)
  18. {
  19. CustomersAppService = customersAppService;
  20. StatesAppService = statesAppService;
  21. }
  22. // GET: CustomerInfo
  23. public ActionResult Customers()
  24. {
  25. ViewBag.SaleType = StatesAppService.GetSelectLists("Customer", "SaleType");
  26. return View();
  27. }
  28. public async Task<ActionResult> CustomerDetail(string id)
  29. {
  30. if (id.IsNullOrEmpty())
  31. {
  32. throw new UserFriendlyException("未找到对应的客户!");
  33. }
  34. var loCustomer =await CustomersAppService.Get(new EntityDto<string>() {Id = id});
  35. return View(loCustomer);
  36. }
  37. }
  38. }