public static Pdspcustprodinitextresults BuildPdspcustprodinitextresultsFromRow(DataRow row) { Pdspcustprodinitextresults entity = new Pdspcustprodinitextresults(); entity.minqty = row.IsNull("minqty") ? decimal.Zero : row.Field <decimal>("minqty"); entity.maxqty = row.IsNull("maxqty") ? decimal.Zero : row.Field <decimal>("maxqty"); entity.actqty = row.IsNull("actqty") ? decimal.Zero : row.Field <decimal>("actqty"); entity.maxqtytyli = row.IsNull("maxqtytyli") ? string.Empty : row.Field <string>("maxqtytyli"); entity.maxqtytypd = row.IsNull("maxqtytypd") ? string.Empty : row.Field <string>("maxqtytypd"); entity.maxqtytysv = row.IsNull("maxqtytysv") ? string.Empty : row.Field <string>("maxqtytysv"); entity.hardmaxfl = row.Field <bool>("hardmaxfl"); entity.proundli = row.IsNull("proundli") ? string.Empty : row.Field <string>("proundli"); entity.proundpd = row.IsNull("proundpd") ? string.Empty : row.Field <string>("proundpd"); entity.proundsv = row.IsNull("proundsv") ? string.Empty : row.Field <string>("proundsv"); entity.ptargetli = row.IsNull("ptargetli") ? string.Empty : row.Field <string>("ptargetli"); entity.ptargetpd = row.IsNull("ptargetpd") ? string.Empty : row.Field <string>("ptargetpd"); entity.ptargetsv = row.IsNull("ptargetsv") ? 0 : row.Field <int>("ptargetsv"); entity.usertarget = row.IsNull("usertarget") ? decimal.Zero : row.Field <decimal>("usertarget"); entity.hardsysprfl = row.Field <bool>("hardsysprfl"); entity.lastuseddt = row.Field <DateTime?>("lastuseddt"); entity.lastuseddtenabled = row.Field <bool>("lastuseddtenabled"); entity.overridepctup = row.IsNull("overridepctup") ? decimal.Zero : row.Field <decimal>("overridepctup"); entity.overridepctdown = row.IsNull("overridepctdown") ? decimal.Zero : row.Field <decimal>("overridepctdown"); 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 UpdateRowFromPdspcustprodinitextresults(ref DataRow row, Pdspcustprodinitextresults entity) { row.SetField("minqty", entity.minqty); row.SetField("maxqty", entity.maxqty); row.SetField("actqty", entity.actqty); row.SetField("maxqtytyli", entity.maxqtytyli); row.SetField("maxqtytypd", entity.maxqtytypd); row.SetField("maxqtytysv", entity.maxqtytysv); row.SetField("hardmaxfl", entity.hardmaxfl); row.SetField("proundli", entity.proundli); row.SetField("proundpd", entity.proundpd); row.SetField("proundsv", entity.proundsv); row.SetField("ptargetli", entity.ptargetli); row.SetField("ptargetpd", entity.ptargetpd); row.SetField("ptargetsv", entity.ptargetsv); row.SetField("usertarget", entity.usertarget); row.SetField("hardsysprfl", entity.hardsysprfl); row.SetField("lastuseddt", entity.lastuseddt); row.SetField("lastuseddtenabled", entity.lastuseddtenabled); row.SetField("overridepctup", entity.overridepctup); row.SetField("overridepctdown", entity.overridepctdown); row.SetField("userfield", entity.userfield); }