/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcamrcalcmethodratesingle(ref DataRow row, Icamrcalcmethodratesingle entity) { row.SetField("cono", entity.cono); row.SetField("reportno", entity.reportno); row.SetField("whse", entity.whse); row.SetField("prod", entity.prod); row.SetField("currentmethod", entity.currentmethod); row.SetField("orderpt", entity.orderpt); row.SetField("linept", entity.linept); row.SetField("seasontype", entity.seasontype); row.SetField("orderqty", entity.orderqty); row.SetField("ordqtyout", entity.ordqtyout); row.SetField("ordqtyin", entity.ordqtyin); row.SetField("safeallamt", entity.safeallamt); row.SetField("usagegoal", entity.usagegoal); row.SetField("usagerate", entity.usagerate); row.SetField("percent", entity.percent); row.SetField("userfield", entity.userfield); }
public static Icamrcalcmethodratesingle BuildIcamrcalcmethodratesingleFromRow(DataRow row) { Icamrcalcmethodratesingle entity = new Icamrcalcmethodratesingle(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.currentmethod = row.IsNull("currentmethod") ? string.Empty : row.Field <string>("currentmethod"); entity.orderpt = row.IsNull("orderpt") ? decimal.Zero : row.Field <decimal>("orderpt"); entity.linept = row.IsNull("linept") ? decimal.Zero : row.Field <decimal>("linept"); entity.seasontype = row.IsNull("seasontype") ? string.Empty : row.Field <string>("seasontype"); entity.orderqty = row.IsNull("orderqty") ? decimal.Zero : row.Field <decimal>("orderqty"); entity.ordqtyout = row.IsNull("ordqtyout") ? decimal.Zero : row.Field <decimal>("ordqtyout"); entity.ordqtyin = row.IsNull("ordqtyin") ? decimal.Zero : row.Field <decimal>("ordqtyin"); entity.safeallamt = row.IsNull("safeallamt") ? decimal.Zero : row.Field <decimal>("safeallamt"); entity.usagegoal = row.IsNull("usagegoal") ? decimal.Zero : row.Field <decimal>("usagegoal"); entity.usagerate = row.IsNull("usagerate") ? decimal.Zero : row.Field <decimal>("usagerate"); entity.percent = row.IsNull("percent") ? decimal.Zero : row.Field <decimal>("percent"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }