/src/FormsView/Popups/Adapters/CarModelEditorViewToPopupAdapter.cs

https://bitbucket.org/tkestowicz/solidworkshop · C# · 62 lines · 50 code · 8 blank · 4 comment · 0 complexity · 1eae21cf83dbb4bc5489f92b5e46c174 MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using AppLogic.Interfaces.Editors;
  6. using AppLogic.Interfaces;
  7. namespace FormsView.Popups.Adapters
  8. {
  9. /// <summary cref="ICarModelEditorView">
  10. /// Klasa adoptuje widok dodawania modelu samochodów do szablonu wsadzonego w wyskakujące okienko.
  11. /// Stanowi nakładke na szablon <cref="ICarModelEditorView"> żeby logika dodawania modelu mogła odwoływać się do właściwości widoku.
  12. /// </summary>
  13. public class CarModelEditorViewToPopupAdapter : BasePopupViewAdapter, ICarModelEditorView
  14. {
  15. #region ICarModelEditorView
  16. public string ModelName
  17. {
  18. get
  19. {
  20. return View.Value;
  21. }
  22. set
  23. {
  24. View.Value = value;
  25. }
  26. }
  27. public int? BrandId
  28. {
  29. get
  30. {
  31. return View.CategoryId;
  32. }
  33. set
  34. {
  35. View.CategoryId = value;
  36. }
  37. }
  38. public string BrandName
  39. {
  40. set
  41. {
  42. View.ByName = value;
  43. }
  44. }
  45. public List<Model.Projection.ComboBox> CarBrands
  46. {
  47. set
  48. {
  49. View.DropdownList = value;
  50. }
  51. }
  52. #endregion
  53. }
  54. }