/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSleeprodlistresults(ref DataRow row, Sleeprodlistresults entity) { row.SetField("sortseqno", entity.sortseqno); row.SetField("sledrowid", entity.sledrowid.ToByteArray()); row.SetField("imptype", entity.imptype); row.SetField("slupdtno", entity.slupdtno); row.SetField("statustype", entity.statustype); row.SetField("statuscd", entity.statuscd); row.SetField("prod", entity.prod); row.SetField("notesfl", entity.notesfl); row.SetField("whse", entity.whse); row.SetField("slgroup", entity.slgroup); row.SetField("numfield1", entity.numfield1); row.SetField("numfield1enabled", entity.numfield1enabled); row.SetField("numfield2", entity.numfield2); row.SetField("numfield2enabled", entity.numfield2enabled); row.SetField("prodcat", entity.prodcat); row.SetField("prodcatenabled", entity.prodcatenabled); row.SetField("pricetype", entity.pricetype); row.SetField("supersedefl", entity.supersedefl); row.SetField("descrip1", entity.descrip1); row.SetField("descrip2", entity.descrip2); row.SetField("descrip3", entity.descrip3); row.SetField("newtext", entity.newtext); row.SetField("prodline", entity.prodline); row.SetField("vendno", entity.vendno); row.SetField("vendorname", entity.vendorname); row.SetField("userfield", entity.userfield); }
public static Sleeprodlistresults BuildSleeprodlistresultsFromRow(DataRow row) { Sleeprodlistresults entity = new Sleeprodlistresults(); entity.sortseqno = row.IsNull("sortseqno") ? 0 : row.Field <int>("sortseqno"); entity.sledrowid = row.Field <byte[]>("sledrowid").ToStringEncoded(); entity.imptype = row.IsNull("imptype") ? string.Empty : row.Field <string>("imptype"); entity.slupdtno = row.IsNull("slupdtno") ? string.Empty : row.Field <string>("slupdtno"); entity.statustype = row.Field <bool>("statustype"); entity.statuscd = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.slgroup = row.IsNull("slgroup") ? string.Empty : row.Field <string>("slgroup"); entity.numfield1 = row.IsNull("numfield1") ? decimal.Zero : row.Field <decimal>("numfield1"); entity.numfield1enabled = row.Field <bool>("numfield1enabled"); entity.numfield2 = row.IsNull("numfield2") ? decimal.Zero : row.Field <decimal>("numfield2"); entity.numfield2enabled = row.Field <bool>("numfield2enabled"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.prodcatenabled = row.Field <bool>("prodcatenabled"); entity.pricetype = row.IsNull("pricetype") ? string.Empty : row.Field <string>("pricetype"); entity.supersedefl = row.IsNull("supersedefl") ? string.Empty : row.Field <string>("supersedefl"); entity.descrip1 = row.IsNull("descrip1") ? string.Empty : row.Field <string>("descrip1"); entity.descrip2 = row.IsNull("descrip2") ? string.Empty : row.Field <string>("descrip2"); entity.descrip3 = row.IsNull("descrip3") ? string.Empty : row.Field <string>("descrip3"); entity.newtext = row.IsNull("newtext") ? string.Empty : row.Field <string>("newtext"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendorname = row.IsNull("vendorname") ? string.Empty : row.Field <string>("vendorname"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }