/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOeoriglinehistresults(ref DataRow row, Oeoriglinehistresults entity) { row.SetField("ordersuf", entity.ordersuf); row.SetField("lineno", entity.lineno); row.SetField("origlineno", entity.origlineno); row.SetField("chgtolineno", entity.chgtolineno); row.SetField("edilineno", entity.edilineno); row.SetField("specnstype", entity.specnstype); row.SetField("lostreason", entity.lostreason); row.SetField("shipprod", entity.shipprod); row.SetField("description", entity.description); row.SetField("qtyord", entity.qtyord); row.SetField("qtyship", entity.qtyship); row.SetField("unit", entity.unit); row.SetField("chgqtyfl", entity.chgqtyfl); row.SetField("userfield", entity.userfield); }
public static Oeoriglinehistresults BuildOeoriglinehistresultsFromRow(DataRow row) { Oeoriglinehistresults entity = new Oeoriglinehistresults(); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.origlineno = row.IsNull("origlineno") ? 0 : row.Field <int>("origlineno"); entity.chgtolineno = row.IsNull("chgtolineno") ? 0 : row.Field <int>("chgtolineno"); entity.edilineno = row.IsNull("edilineno") ? string.Empty : row.Field <string>("edilineno"); entity.specnstype = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype"); entity.lostreason = row.IsNull("lostreason") ? string.Empty : row.Field <string>("lostreason"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.description = row.IsNull("description") ? string.Empty : row.Field <string>("description"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.qtyship = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.chgqtyfl = row.Field <bool>("chgqtyfl"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }