/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPorrarreptadjcalc(ref DataRow row, Porrarreptadjcalc entity) { row.SetField("reportno", entity.reportno); row.SetField("percent", entity.percent); row.SetField("newtotqtyord", entity.newtotqtyord); row.SetField("newtotlineamt", entity.newtotlineamt); row.SetField("newtotweight", entity.newtotweight); row.SetField("newtotcubes", entity.newtotcubes); row.SetField("pctstock", entity.pctstock); row.SetField("pctnonstock", entity.pctnonstock); row.SetField("pctspecials", entity.pctspecials); row.SetField("shortamt", entity.shortamt); row.SetField("shorttext", entity.shorttext); }
public static Porrarreptadjcalc BuildPorrarreptadjcalcFromRow(DataRow row) { Porrarreptadjcalc entity = new Porrarreptadjcalc(); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); entity.percent = row.IsNull("percent") ? decimal.Zero : row.Field <decimal>("percent"); entity.newtotqtyord = row.IsNull("newtotqtyord") ? decimal.Zero : row.Field <decimal>("newtotqtyord"); entity.newtotlineamt = row.IsNull("newtotlineamt") ? decimal.Zero : row.Field <decimal>("newtotlineamt"); entity.newtotweight = row.IsNull("newtotweight") ? decimal.Zero : row.Field <decimal>("newtotweight"); entity.newtotcubes = row.IsNull("newtotcubes") ? decimal.Zero : row.Field <decimal>("newtotcubes"); entity.pctstock = row.IsNull("pctstock") ? decimal.Zero : row.Field <decimal>("pctstock"); entity.pctnonstock = row.IsNull("pctnonstock") ? decimal.Zero : row.Field <decimal>("pctnonstock"); entity.pctspecials = row.IsNull("pctspecials") ? decimal.Zero : row.Field <decimal>("pctspecials"); entity.shortamt = row.IsNull("shortamt") ? decimal.Zero : row.Field <decimal>("shortamt"); entity.shorttext = row.IsNull("shorttext") ? string.Empty : row.Field <string>("shorttext"); return(entity); }