/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromCalcsubtotalsresults(ref DataRow row, Calcsubtotalsresults entity) { row.SetField("totlineamt", entity.totlineamt); row.SetField("totother", entity.totother); row.SetField("tottax", entity.tottax); row.SetField("totordamt", entity.totordamt); row.SetField("totmargpct", entity.totmargpct); row.SetField("totmargamt", entity.totmargamt); }
public static Calcsubtotalsresults BuildCalcsubtotalsresultsFromRow(DataRow row) { Calcsubtotalsresults entity = new Calcsubtotalsresults(); entity.totlineamt = row.IsNull("totlineamt") ? decimal.Zero : row.Field <decimal>("totlineamt"); entity.totother = row.IsNull("totother") ? decimal.Zero : row.Field <decimal>("totother"); entity.tottax = row.IsNull("tottax") ? decimal.Zero : row.Field <decimal>("tottax"); entity.totordamt = row.IsNull("totordamt") ? decimal.Zero : row.Field <decimal>("totordamt"); entity.totmargpct = row.IsNull("totmargpct") ? decimal.Zero : row.Field <decimal>("totmargpct"); entity.totmargamt = row.IsNull("totmargamt") ? decimal.Zero : row.Field <decimal>("totmargamt"); return(entity); }