Ejemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromAretlist(ref DataRow row, Aretlist entity)
 {
     row.SetField("custno", entity.custno);
     row.SetField("custnotesfl", entity.custnotesfl);
     row.SetField("transcddesc", entity.transcddesc);
     row.SetField("invno", entity.invno);
     row.SetField("invsuf", entity.invsuf);
     row.SetField("notesfl", entity.notesfl);
     row.SetField("amount", entity.amount);
     row.SetField("shipto", entity.shipto);
     row.SetField("divno", entity.divno);
     row.SetField("invdt", entity.invdt);
     row.SetField("termstype", entity.termstype);
     row.SetField("refer", entity.refer);
     row.SetField("slsytdfl", entity.slsytdfl);
     row.SetField("dispseq", entity.dispseq);
     row.SetField("aretid", entity.aretid.ToByteArray());
     row.SetField("transcd", entity.transcd);
     row.SetField("userfield", entity.userfield);
 }
Ejemplo n.º 2
0
        public static Aretlist BuildAretlistFromRow(DataRow row)
        {
            Aretlist entity = new Aretlist();

            entity.custno      = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.custnotesfl = row.IsNull("custnotesfl") ? string.Empty : row.Field <string>("custnotesfl");
            entity.transcddesc = row.IsNull("transcddesc") ? string.Empty : row.Field <string>("transcddesc");
            entity.invno       = row.IsNull("invno") ? 0 : row.Field <int>("invno");
            entity.invsuf      = row.IsNull("invsuf") ? 0 : row.Field <int>("invsuf");
            entity.notesfl     = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            entity.amount      = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount");
            entity.shipto      = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.divno       = row.IsNull("divno") ? 0 : row.Field <int>("divno");
            entity.invdt       = row.Field <DateTime?>("invdt");
            entity.termstype   = row.IsNull("termstype") ? string.Empty : row.Field <string>("termstype");
            entity.refer       = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.slsytdfl    = row.Field <bool>("slsytdfl");
            entity.dispseq     = row.IsNull("dispseq") ? 0 : row.Field <int>("dispseq");
            entity.aretid      = row.Field <byte[]>("aretid").ToStringEncoded();
            entity.transcd     = row.IsNull("transcd") ? 0 : row.Field <int>("transcd");
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }