/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcsprcaddchg(ref DataRow row, Icsprcaddchg entity) { row.SetField("cono", entity.cono); row.SetField("updatetype", entity.updatetype); row.SetField("recordtype", entity.recordtype); row.SetField("srcrowpointer", entity.srcrowpointer); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("startdt", entity.startdt); row.SetField("expiredt", entity.expiredt); row.SetField("restrictcd", entity.restrictcd); row.SetField("certcode", entity.certcode); row.SetField("activefl", entity.activefl); row.SetField("certaccptdt", entity.certaccptdt); row.SetField("certaccptuser", entity.certaccptuser); row.SetField("certauthuser", entity.certauthuser); row.SetField("createdt", entity.createdt); row.SetField("user1", entity.user1); row.SetField("user2", entity.user2); row.SetField("user3", entity.user3); row.SetField("user4", entity.user4); row.SetField("user5", entity.user5); row.SetField("user6", entity.user6); row.SetField("user7", entity.user7); row.SetField("user8", entity.user8); row.SetField("user9", entity.user9); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Icsprcaddchg BuildIcsprcaddchgFromRow(DataRow row) { Icsprcaddchg entity = new Icsprcaddchg(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.updatetype = row.IsNull("updatetype") ? string.Empty : row.Field <string>("updatetype"); entity.recordtype = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype"); entity.srcrowpointer = row.IsNull("srcrowpointer") ? string.Empty : row.Field <string>("srcrowpointer"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.startdt = row.Field <DateTime?>("startdt"); entity.expiredt = row.Field <DateTime?>("expiredt"); entity.restrictcd = row.IsNull("restrictcd") ? string.Empty : row.Field <string>("restrictcd"); entity.certcode = row.IsNull("certcode") ? string.Empty : row.Field <string>("certcode"); entity.activefl = row.Field <bool>("activefl"); entity.certaccptdt = row.Field <DateTime?>("certaccptdt"); entity.certaccptuser = row.IsNull("certaccptuser") ? string.Empty : row.Field <string>("certaccptuser"); entity.certauthuser = row.IsNull("certauthuser") ? string.Empty : row.Field <string>("certauthuser"); entity.createdt = row.Field <DateTime?>("createdt"); entity.user1 = row.IsNull("user1") ? string.Empty : row.Field <string>("user1"); entity.user2 = row.IsNull("user2") ? string.Empty : row.Field <string>("user2"); entity.user3 = row.IsNull("user3") ? string.Empty : row.Field <string>("user3"); entity.user4 = row.IsNull("user4") ? string.Empty : row.Field <string>("user4"); entity.user5 = row.IsNull("user5") ? string.Empty : row.Field <string>("user5"); entity.user6 = row.Field <decimal?>("user6"); entity.user7 = row.Field <decimal?>("user7"); entity.user8 = row.Field <DateTime?>("user8"); entity.user9 = row.Field <DateTime?>("user9"); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }