public static Iclotlookupresults BuildIclotlookupresultsFromRow(DataRow row) { Iclotlookupresults entity = new Iclotlookupresults(); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.lotno = row.IsNull("lotno") ? string.Empty : row.Field <string>("lotno"); entity.opendt = row.Field <DateTime?>("opendt"); entity.qty = row.IsNull("qty") ? decimal.Zero : row.Field <decimal>("qty"); entity.qtyunavail = row.IsNull("qtyunavail") ? decimal.Zero : row.Field <decimal>("qtyunavail"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.qtyonhand = row.IsNull("qtyonhand") ? decimal.Zero : row.Field <decimal>("qtyonhand"); 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.rowidIcsel = row.Field <byte[]>("rowid-icsel").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIclotlookupresults(ref DataRow row, Iclotlookupresults entity) { row.SetField("whse", entity.whse); row.SetField("prod", entity.prod); row.SetField("notesfl", entity.notesfl); row.SetField("lotno", entity.lotno); row.SetField("opendt", entity.opendt); row.SetField("qty", entity.qty); row.SetField("qtyunavail", entity.qtyunavail); row.SetField("statustype", entity.statustype); row.SetField("qtyonhand", entity.qtyonhand); 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-icsel", entity.rowidIcsel.ToByteArray()); row.SetField("userfield", entity.userfield); }