/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPorrarlinetotals(ref DataRow row, Porrarlinetotals entity) { row.SetField("reportno", entity.reportno); row.SetField("targetbuy", entity.targetbuy); row.SetField("currencydesc", entity.currencydesc); row.SetField("purchprio", entity.purchprio); row.SetField("totqtyorderedtarget", entity.totqtyorderedtarget); row.SetField("totlineamounttarget", entity.totlineamounttarget); row.SetField("totweighttarget", entity.totweighttarget); row.SetField("totcubestarget", entity.totcubestarget); row.SetField("totqtyordered", entity.totqtyordered); row.SetField("totlineamount", entity.totlineamount); row.SetField("totweight", entity.totweight); row.SetField("totcubes", entity.totcubes); }
public static Porrarlinetotals BuildPorrarlinetotalsFromRow(DataRow row) { Porrarlinetotals entity = new Porrarlinetotals(); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); entity.targetbuy = row.IsNull("targetbuy") ? decimal.Zero : row.Field <decimal>("targetbuy"); entity.currencydesc = row.IsNull("currencydesc") ? string.Empty : row.Field <string>("currencydesc"); entity.purchprio = row.IsNull("purchprio") ? string.Empty : row.Field <string>("purchprio"); entity.totqtyorderedtarget = row.IsNull("totqtyorderedtarget") ? string.Empty : row.Field <string>("totqtyorderedtarget"); entity.totlineamounttarget = row.IsNull("totlineamounttarget") ? string.Empty : row.Field <string>("totlineamounttarget"); entity.totweighttarget = row.IsNull("totweighttarget") ? string.Empty : row.Field <string>("totweighttarget"); entity.totcubestarget = row.IsNull("totcubestarget") ? string.Empty : row.Field <string>("totcubestarget"); 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"); return(entity); }