/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPoeidetailtotal(ref DataRow row, Poeidetailtotal entity) { row.SetField("totlineamt", entity.totlineamt); row.SetField("totrcvamt", entity.totrcvamt); row.SetField("totqtyord", entity.totqtyord); row.SetField("totqtyrcv", entity.totqtyrcv); row.SetField("totweight", entity.totweight); row.SetField("totqtycost", entity.totqtycost); row.SetField("totcubes", entity.totcubes); row.SetField("userfield", entity.userfield); }
public static Poeidetailtotal BuildPoeidetailtotalFromRow(DataRow row) { Poeidetailtotal entity = new Poeidetailtotal(); entity.totlineamt = row.IsNull("totlineamt") ? decimal.Zero : row.Field <decimal>("totlineamt"); entity.totrcvamt = row.IsNull("totrcvamt") ? decimal.Zero : row.Field <decimal>("totrcvamt"); entity.totqtyord = row.IsNull("totqtyord") ? decimal.Zero : row.Field <decimal>("totqtyord"); entity.totqtyrcv = row.IsNull("totqtyrcv") ? decimal.Zero : row.Field <decimal>("totqtyrcv"); entity.totweight = row.IsNull("totweight") ? decimal.Zero : row.Field <decimal>("totweight"); entity.totqtycost = row.IsNull("totqtycost") ? decimal.Zero : row.Field <decimal>("totqtycost"); entity.totcubes = row.IsNull("totcubes") ? decimal.Zero : row.Field <decimal>("totcubes"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }