/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWtrrarlineadd(ref DataRow row, Wtrrarlineadd entity) { row.SetField("reportno", entity.reportno); row.SetField("lineno", entity.lineno); row.SetField("shipprod", entity.shipprod); row.SetField("qtyord", entity.qtyord); row.SetField("unit", entity.unit); row.SetField("origunit", entity.origunit); row.SetField("prodcost", entity.prodcost); row.SetField("rushfl", entity.rushfl); row.SetField("specnstype", entity.specnstype); row.SetField("restrictovrfl", entity.restrictovrfl); row.SetField("restricterrmess", entity.restricterrmess); row.SetField("userfield", entity.userfield); }
public static Wtrrarlineadd BuildWtrrarlineaddFromRow(DataRow row) { Wtrrarlineadd entity = new Wtrrarlineadd(); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.origunit = row.IsNull("origunit") ? string.Empty : row.Field <string>("origunit"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost"); entity.rushfl = row.Field <bool>("rushfl"); entity.specnstype = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype"); entity.restrictovrfl = row.Field <bool>("restrictovrfl"); entity.restricterrmess = row.IsNull("restricterrmess") ? string.Empty : row.Field <string>("restricterrmess"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }