Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOeerdetail(ref DataRow row, Oeerdetail entity)
 {
     row.SetField("shipreqno", entity.shipreqno);
     row.SetField("notesfl", entity.notesfl);
     row.SetField("name", entity.name);
     row.SetField("reqinit", entity.reqinit);
     row.SetField("addr1", entity.addr1);
     row.SetField("addr2", entity.addr2);
     row.SetField("addr3", entity.addr3);
     row.SetField("city", entity.city);
     row.SetField("state", entity.state);
     row.SetField("zipcd", entity.zipcd);
     row.SetField("shipdt", entity.shipdt);
     row.SetField("transdt", entity.transdt);
     row.SetField("transtm", entity.transtm);
     row.SetField("sendtoinfo", entity.sendtoinfo);
     row.SetField("PMESRecid", entity.pMESRecid);
     row.SetField("PMESRowid", entity.pMESRowid.ToByteArray());
     row.SetField("prtreqno", entity.prtreqno);
     row.SetField("prtdetail", entity.prtdetail);
     row.SetField("prtother", entity.prtother);
     row.SetField("prtnotes", entity.prtnotes);
     row.SetField("sendtype", entity.sendtype);
     row.SetField("sendno", entity.sendno);
     row.SetField("apprinit", entity.apprinit);
     row.SetField("shipviaty", entity.shipviaty);
     row.SetField("descrip1", entity.descrip1);
     row.SetField("descrip2", entity.descrip2);
     row.SetField("userfield", entity.userfield);
 }
Пример #2
0
        public static Oeerdetail BuildOeerdetailFromRow(DataRow row)
        {
            Oeerdetail entity = new Oeerdetail();

            entity.shipreqno  = row.IsNull("shipreqno") ? 0 : row.Field <int>("shipreqno");
            entity.notesfl    = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            entity.name       = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.reqinit    = row.IsNull("reqinit") ? string.Empty : row.Field <string>("reqinit");
            entity.addr1      = row.IsNull("addr1") ? string.Empty : row.Field <string>("addr1");
            entity.addr2      = row.IsNull("addr2") ? string.Empty : row.Field <string>("addr2");
            entity.addr3      = row.IsNull("addr3") ? string.Empty : row.Field <string>("addr3");
            entity.city       = row.IsNull("city") ? string.Empty : row.Field <string>("city");
            entity.state      = row.IsNull("state") ? string.Empty : row.Field <string>("state");
            entity.zipcd      = row.IsNull("zipcd") ? string.Empty : row.Field <string>("zipcd");
            entity.shipdt     = row.Field <DateTime?>("shipdt");
            entity.transdt    = row.Field <DateTime?>("transdt");
            entity.transtm    = row.IsNull("transtm") ? string.Empty : row.Field <string>("transtm");
            entity.sendtoinfo = row.IsNull("sendtoinfo") ? string.Empty : row.Field <string>("sendtoinfo");
            entity.pMESRecid  = row.IsNull("PMESRecid") ? 0 : row.Field <long>("PMESRecid");
            entity.pMESRowid  = row.Field <byte[]>("PMESRowid").ToStringEncoded();
            entity.prtreqno   = row.IsNull("prtreqno") ? 0 : row.Field <int>("prtreqno");
            entity.prtdetail  = row.Field <bool>("prtdetail");
            entity.prtother   = row.Field <bool>("prtother");
            entity.prtnotes   = row.Field <bool>("prtnotes");
            entity.sendtype   = row.IsNull("sendtype") ? string.Empty : row.Field <string>("sendtype");
            entity.sendno     = row.IsNull("sendno") ? decimal.Zero : row.Field <decimal>("sendno");
            entity.apprinit   = row.IsNull("apprinit") ? string.Empty : row.Field <string>("apprinit");
            entity.shipviaty  = row.IsNull("shipviaty") ? string.Empty : row.Field <string>("shipviaty");
            entity.descrip1   = row.IsNull("descrip1") ? string.Empty : row.Field <string>("descrip1");
            entity.descrip2   = row.IsNull("descrip2") ? string.Empty : row.Field <string>("descrip2");
            entity.userfield  = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }