DepsercDTO.cs
1 using System;
2 using System.Data;
3 
4 namespace sage.ew.serie.PoC
5 {
6  internal class DepsercDTO
7  {
8  public string Empresa { get; set; }
9  public string Albaran { get; set; }
10  public int Linea { get; set; }
11  public string Articulo { get; set; }
12  public bool Modelo { get; set; }
13  public string Numero { get; set; }
14  public string Serie { get; set; }
15  public bool Traspaso { get; set; }
16  public string Ubica { get; set; }
17  public string Lote { get; set; }
18  public DateTime? Fechalog { get; set; }
19  public bool Compra { get; set; }
20  public bool Vista { get; set; }
21  public string Guid_id { get; set; }
22  public DateTime Created { get; set; }
23  public DateTime Modified { get; set; }
24 
25  public DepsercDTO() { }
26 
27  public DepsercDTO(DataRow row) : this()
28  {
29  Empresa = Convert.ToString(row["Empresa"]).TrimEnd();
30  Albaran = Convert.ToString(row["Albaran"]).TrimEnd();
31  Linea = Convert.ToInt32(row["Linea"]);
32  Articulo = Convert.ToString(row["Articulo"]).TrimEnd();
33  Modelo = Convert.ToBoolean(row["Modelo"]);
34  Numero = Convert.ToString(row["Numero"]).TrimEnd();
35  Serie = Convert.ToString(row["Serie"]).TrimEnd();
36  Traspaso = Convert.ToBoolean(row["Traspaso"]);
37  Ubica = Convert.ToString(row["Ubica"]).TrimEnd();
38  Lote = Convert.ToString(row["Lote"]).TrimEnd();
39  Fechalog = row["Fechalog"] is DBNull ? null : (DateTime?)Convert.ToDateTime(row["Fechalog"]);
40  Compra = Convert.ToBoolean(row["Compra"]);
41  Vista = Convert.ToBoolean(row["Vista"]);
42  Guid_id = Convert.ToString(row["guid_id"]).TrimEnd();
43  Created = Convert.ToDateTime(row["Created"]);
44  Modified = Convert.ToDateTime(row["Modified"]);
45  }
46  }
47 }