/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcepelotmaster(ref DataRow row, Icepelotmaster entity) { row.SetField("prod", entity.prod); row.SetField("whse", entity.whse); row.SetField("lotno", entity.lotno); row.SetField("statusty", entity.statusty); row.SetField("qtyavail", entity.qtyavail); row.SetField("qtyadj", entity.qtyadj); row.SetField("qtyunavail", entity.qtyunavail); row.SetField("opendt", entity.opendt); row.SetField("closedt", entity.closedt); row.SetField("expiredt", entity.expiredt); row.SetField("binloc1", entity.binloc1); row.SetField("binloc2", entity.binloc2); row.SetField("prodcost", entity.prodcost); row.SetField("jrnlno", entity.jrnlno); row.SetField("adjtype", entity.adjtype); row.SetField("userfield", entity.userfield); }
public static Icepelotmaster BuildIcepelotmasterFromRow(DataRow row) { Icepelotmaster entity = new Icepelotmaster(); entity.prod = row.IsNull("prod") ? string.Empty : row.Field<string>("prod"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field<string>("whse"); entity.lotno = row.IsNull("lotno") ? string.Empty : row.Field<string>("lotno"); entity.statusty = row.IsNull("statusty") ? string.Empty : row.Field<string>("statusty"); entity.qtyavail = row.IsNull("qtyavail") ? decimal.Zero : row.Field<decimal>("qtyavail"); entity.qtyadj = row.IsNull("qtyadj") ? decimal.Zero : row.Field<decimal>("qtyadj"); entity.qtyunavail = row.IsNull("qtyunavail") ? decimal.Zero : row.Field<decimal>("qtyunavail"); entity.opendt = row.Field<DateTime?>("opendt"); entity.closedt = row.Field<DateTime?>("closedt"); entity.expiredt = row.Field<DateTime?>("expiredt"); entity.binloc1 = row.IsNull("binloc1") ? string.Empty : row.Field<string>("binloc1"); entity.binloc2 = row.IsNull("binloc2") ? string.Empty : row.Field<string>("binloc2"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field<decimal>("prodcost"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field<int>("jrnlno"); entity.adjtype = row.IsNull("adjtype") ? string.Empty : row.Field<string>("adjtype"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field<string>("userfield"); return entity; }