/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWtrrarlinetotals(ref DataRow row, Wtrrarlinetotals entity) { row.SetField("reportno", entity.reportno); row.SetField("totqtyordered", entity.totqtyordered); row.SetField("totlineamount", entity.totlineamount); row.SetField("totweight", entity.totweight); row.SetField("totcubes", entity.totcubes); row.SetField("userfield", entity.userfield); }
public static Wtrrarlinetotals BuildWtrrarlinetotalsFromRow(DataRow row) { Wtrrarlinetotals entity = new Wtrrarlinetotals(); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); entity.totqtyordered = row.IsNull("totqtyordered") ? decimal.Zero : row.Field <decimal>("totqtyordered"); entity.totlineamount = row.IsNull("totlineamount") ? decimal.Zero : row.Field <decimal>("totlineamount"); entity.totweight = row.IsNull("totweight") ? decimal.Zero : row.Field <decimal>("totweight"); entity.totcubes = row.IsNull("totcubes") ? decimal.Zero : row.Field <decimal>("totcubes"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }