public static Porrarlineadd BuildPorrarlineaddFromRow(DataRow row) { Porrarlineadd entity = new Porrarlineadd(); 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.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.priceoverfl = row.Field <bool>("priceoverfl"); entity.rushfl = row.Field <bool>("rushfl"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.vendquote = row.IsNull("vendquote") ? string.Empty : row.Field <string>("vendquote"); entity.pdsvfl = row.Field <bool>("pdsvfl"); entity.pdsvcrecno = row.IsNull("pdsvcrecno") ? 0 : row.Field <int>("pdsvcrecno"); entity.seasontype = row.IsNull("seasontype") ? string.Empty : row.Field <string>("seasontype"); 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.rowidPoeral = row.Field <byte[]>("rowid-poeral").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPorrarlineadd(ref DataRow row, Porrarlineadd 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("price", entity.price); row.SetField("priceoverfl", entity.priceoverfl); row.SetField("rushfl", entity.rushfl); row.SetField("contractno", entity.contractno); row.SetField("vendquote", entity.vendquote); row.SetField("pdsvfl", entity.pdsvfl); row.SetField("pdsvcrecno", entity.pdsvcrecno); row.SetField("seasontype", entity.seasontype); row.SetField("specnstype", entity.specnstype); row.SetField("restrictovrfl", entity.restrictovrfl); row.SetField("restricterrmess", entity.restricterrmess); row.SetField("rowid-poeral", entity.rowidPoeral.ToByteArray()); row.SetField("userfield", entity.userfield); }