ZoneConnection.cs 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using WebApplication3.Models;
  6. namespace WebApplication3.Clases
  7. {
  8. public class ZoneConnection
  9. {
  10. public uint Id { get; set; }
  11. public string From { get; set; }
  12. public string To { get; set; }
  13. public string Value { get; set; }
  14. public ZoneConnection()
  15. {
  16. }
  17. public ZoneConnection(ConexionZonasIn connectionIn)
  18. {
  19. Id = connectionIn.Id;
  20. From = connectionIn.From;
  21. To = connectionIn.To;
  22. Value = connectionIn.Value;
  23. }
  24. public ZoneConnection(ConexionZonasOut connectionOut)
  25. {
  26. Id = connectionOut.Id;
  27. From = connectionOut.From;
  28. To = connectionOut.To;
  29. Value = connectionOut.Value;
  30. }
  31. public ConexionZonasIn ToConexionIn(uint? idBalanceIn)
  32. {
  33. ConexionZonasIn conexionIn = new ConexionZonasIn();
  34. conexionIn.From = this.From;
  35. conexionIn.To = this.To;
  36. conexionIn.Value = this.Value;
  37. conexionIn.IdDatosBalanceIn = idBalanceIn;
  38. return conexionIn;
  39. }
  40. public ConexionZonasOut ToConexionOut(uint? idBalanceOut)
  41. {
  42. ConexionZonasOut conexionOut = new ConexionZonasOut();
  43. conexionOut.From = this.From;
  44. conexionOut.To = this.To;
  45. conexionOut.Value = this.Value;
  46. conexionOut.IdDatosBalanceOut = idBalanceOut;
  47. return conexionOut;
  48. }
  49. }
  50. }