public int Update( int eventAttendeeID, int packageID, string customerNumber, DateTime dateOfBirth) { StringBuilder validationErrorReport = new StringBuilder(); ValidateParameterLength( "customerNumber", customerNumber.Length, 25, validationErrorReport); if (validationErrorReport.Length > 0) { throw new ApplicationException(validationErrorReport.ToString()); } int retVal; SWPGenericDbParameter eventAttendeeIDGenericDbParameter = new SWPGenericDbParameter( "@EventAttendeeID", DbType.Int32, ParameterDirection.Input, 0, eventAttendeeID); SWPGenericDbParameter packageIDGenericDbParameter = new SWPGenericDbParameter( "@PackageID", DbType.Int32, ParameterDirection.Input, 0, packageID); SWPGenericDbParameter customerNumberGenericDbParameter = new SWPGenericDbParameter( "@CustomerNumber", DbType.StringFixedLength, ParameterDirection.Input, 25, customerNumber); SWPGenericDbParameter dateOfBirthGenericDbParameter = new SWPGenericDbParameter( "@DateOfBirth", DbType.DateTime, ParameterDirection.Input, 0, dateOfBirth); if (_dbTransactionConnection == null) { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbConnectionName, "uspEventAttendeeUpdate", eventAttendeeIDGenericDbParameter, packageIDGenericDbParameter, customerNumberGenericDbParameter, dateOfBirthGenericDbParameter); } else { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbTransactionConnection, "uspEventAttendeeUpdate", eventAttendeeIDGenericDbParameter, packageIDGenericDbParameter, customerNumberGenericDbParameter, dateOfBirthGenericDbParameter); } return(retVal); }
public int Insert( string venueName, string venueDescription, string venueStreet, string venueCity, string venueState, string venuePostalCode, byte [] venueGeographicMap, byte [] venueFacilityMap, byte [] venueImage, out int venueID) { StringBuilder validationErrorReport = new StringBuilder(); ValidateParameterLength( "venueName", venueName.Length, 255, validationErrorReport); ValidateParameterLength( "venueDescription", venueDescription.Length, 4000, validationErrorReport); ValidateParameterLength( "venueStreet", venueStreet.Length, 255, validationErrorReport); ValidateParameterLength( "venueCity", venueCity.Length, 255, validationErrorReport); ValidateParameterLength( "venueState", venueState.Length, 255, validationErrorReport); ValidateParameterLength( "venuePostalCode", venuePostalCode.Length, 25, validationErrorReport); ValidateParameterLength( "venueGeographicMap", venueGeographicMap.Length, 2147483647, validationErrorReport); ValidateParameterLength( "venueFacilityMap", venueFacilityMap.Length, 2147483647, validationErrorReport); ValidateParameterLength( "venueImage", venueImage.Length, 2147483647, validationErrorReport); if (validationErrorReport.Length > 0) { throw new ApplicationException(validationErrorReport.ToString()); } int retVal; SWPGenericDbParameter venueNameGenericDbParameter = new SWPGenericDbParameter( "@VenueName", DbType.String, ParameterDirection.Input, 255, venueName); SWPGenericDbParameter venueDescriptionGenericDbParameter = new SWPGenericDbParameter( "@VenueDescription", DbType.String, ParameterDirection.Input, 4000, venueDescription); SWPGenericDbParameter venueStreetGenericDbParameter = new SWPGenericDbParameter( "@VenueStreet", DbType.String, ParameterDirection.Input, 255, venueStreet); SWPGenericDbParameter venueCityGenericDbParameter = new SWPGenericDbParameter( "@VenueCity", DbType.String, ParameterDirection.Input, 255, venueCity); SWPGenericDbParameter venueStateGenericDbParameter = new SWPGenericDbParameter( "@VenueState", DbType.String, ParameterDirection.Input, 255, venueState); SWPGenericDbParameter venuePostalCodeGenericDbParameter = new SWPGenericDbParameter( "@VenuePostalCode", DbType.StringFixedLength, ParameterDirection.Input, 25, venuePostalCode); SWPGenericDbParameter venueGeographicMapGenericDbParameter = new SWPGenericDbParameter( "@VenueGeographicMap", DbType.Binary, ParameterDirection.Input, 2147483647, venueGeographicMap); SWPGenericDbParameter venueFacilityMapGenericDbParameter = new SWPGenericDbParameter( "@VenueFacilityMap", DbType.Binary, ParameterDirection.Input, 2147483647, venueFacilityMap); SWPGenericDbParameter venueImageGenericDbParameter = new SWPGenericDbParameter( "@VenueImage", DbType.Binary, ParameterDirection.Input, 2147483647, venueImage); SWPGenericDbParameter venueIDGenericDbParameter = new SWPGenericDbParameter( "@VenueID", DbType.Int32, ParameterDirection.Output, 0); if (_dbTransactionConnection == null) { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbConnectionName, "uspVenueInsert", venueNameGenericDbParameter, venueDescriptionGenericDbParameter, venueStreetGenericDbParameter, venueCityGenericDbParameter, venueStateGenericDbParameter, venuePostalCodeGenericDbParameter, venueGeographicMapGenericDbParameter, venueFacilityMapGenericDbParameter, venueImageGenericDbParameter, venueIDGenericDbParameter); } else { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbTransactionConnection, "uspVenueInsert", venueNameGenericDbParameter, venueDescriptionGenericDbParameter, venueStreetGenericDbParameter, venueCityGenericDbParameter, venueStateGenericDbParameter, venuePostalCodeGenericDbParameter, venueGeographicMapGenericDbParameter, venueFacilityMapGenericDbParameter, venueImageGenericDbParameter, venueIDGenericDbParameter); } venueID = (int)venueIDGenericDbParameter.Value; return(retVal); }
public int Update( int eventAttendeeAgencyMapID, int eventAttendeeID, int eventID, string agencyNumber, string tripNumber) { StringBuilder validationErrorReport = new StringBuilder(); ValidateParameterLength( "agencyNumber", agencyNumber.Length, 16, validationErrorReport); ValidateParameterLength( "tripNumber", tripNumber.Length, 16, validationErrorReport); if (validationErrorReport.Length > 0) { throw new ApplicationException(validationErrorReport.ToString()); } int retVal; SWPGenericDbParameter eventAttendeeAgencyMapIDGenericDbParameter = new SWPGenericDbParameter( "@EventAttendeeAgencyMapID", DbType.Int32, ParameterDirection.Input, 0, eventAttendeeAgencyMapID); SWPGenericDbParameter eventAttendeeIDGenericDbParameter = new SWPGenericDbParameter( "@EventAttendeeID", DbType.Int32, ParameterDirection.Input, 0, eventAttendeeID); SWPGenericDbParameter eventIDGenericDbParameter = new SWPGenericDbParameter( "@EventID", DbType.Int32, ParameterDirection.Input, 0, eventID); SWPGenericDbParameter agencyNumberGenericDbParameter = new SWPGenericDbParameter( "@AgencyNumber", DbType.String, ParameterDirection.Input, 16, agencyNumber); SWPGenericDbParameter tripNumberGenericDbParameter = new SWPGenericDbParameter( "@TripNumber", DbType.String, ParameterDirection.Input, 16, tripNumber); if (_dbTransactionConnection == null) { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbConnectionName, "uspEventAttendeeAgencyMapUpdate", eventAttendeeAgencyMapIDGenericDbParameter, eventAttendeeIDGenericDbParameter, eventIDGenericDbParameter, agencyNumberGenericDbParameter, tripNumberGenericDbParameter); } else { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbTransactionConnection, "uspEventAttendeeAgencyMapUpdate", eventAttendeeAgencyMapIDGenericDbParameter, eventAttendeeIDGenericDbParameter, eventIDGenericDbParameter, agencyNumberGenericDbParameter, tripNumberGenericDbParameter); } return(retVal); }
public int Update( string carrID, string counterNumber, string airport) { StringBuilder validationErrorReport = new StringBuilder(); ValidateParameterLength( "carrID", carrID.Length, 3, validationErrorReport); ValidateParameterLength( "counterNumber", counterNumber.Length, 8, validationErrorReport); ValidateParameterLength( "airport", airport.Length, 3, validationErrorReport); if (validationErrorReport.Length > 0) { throw new ApplicationException(validationErrorReport.ToString()); } int retVal; SWPGenericDbParameter carrIDGenericDbParameter = new SWPGenericDbParameter( "@CarrID", DbType.AnsiStringFixedLength, ParameterDirection.Input, 3, carrID); SWPGenericDbParameter counterNumberGenericDbParameter = new SWPGenericDbParameter( "@CounterNumber", DbType.AnsiStringFixedLength, ParameterDirection.Input, 8, counterNumber); SWPGenericDbParameter airportGenericDbParameter = new SWPGenericDbParameter( "@Airport", DbType.AnsiStringFixedLength, ParameterDirection.Input, 3, airport); if (_dbTransactionConnection == null) { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbConnectionName, "uspRefCounterUpdate", carrIDGenericDbParameter, counterNumberGenericDbParameter, airportGenericDbParameter); } else { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbTransactionConnection, "uspRefCounterUpdate", carrIDGenericDbParameter, counterNumberGenericDbParameter, airportGenericDbParameter); } return(retVal); }
public int Update( int packageID, string packageName, string packageDescription, byte [] packageImage) { StringBuilder validationErrorReport = new StringBuilder(); ValidateParameterLength( "packageName", packageName.Length, 255, validationErrorReport); ValidateParameterLength( "packageDescription", packageDescription.Length, 4000, validationErrorReport); ValidateParameterLength( "packageImage", packageImage.Length, 2147483647, validationErrorReport); if (validationErrorReport.Length > 0) { throw new ApplicationException(validationErrorReport.ToString()); } int retVal; SWPGenericDbParameter packageIDGenericDbParameter = new SWPGenericDbParameter( "@PackageID", DbType.Int32, ParameterDirection.Input, 0, packageID); SWPGenericDbParameter packageNameGenericDbParameter = new SWPGenericDbParameter( "@PackageName", DbType.String, ParameterDirection.Input, 255, packageName); SWPGenericDbParameter packageDescriptionGenericDbParameter = new SWPGenericDbParameter( "@PackageDescription", DbType.String, ParameterDirection.Input, 4000, packageDescription); SWPGenericDbParameter packageImageGenericDbParameter = new SWPGenericDbParameter( "@PackageImage", DbType.Binary, ParameterDirection.Input, 2147483647, packageImage); if (_dbTransactionConnection == null) { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbConnectionName, "uspPackageUpdate", packageIDGenericDbParameter, packageNameGenericDbParameter, packageDescriptionGenericDbParameter, packageImageGenericDbParameter); } else { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbTransactionConnection, "uspPackageUpdate", packageIDGenericDbParameter, packageNameGenericDbParameter, packageDescriptionGenericDbParameter, packageImageGenericDbParameter); } return(retVal); }
public int Update( int eventTypeID, string eventTypeName, string eventTypeDescription) { StringBuilder validationErrorReport = new StringBuilder(); ValidateParameterLength( "eventTypeName", eventTypeName.Length, 255, validationErrorReport); ValidateParameterLength( "eventTypeDescription", eventTypeDescription.Length, 4000, validationErrorReport); if (validationErrorReport.Length > 0) { throw new ApplicationException(validationErrorReport.ToString()); } int retVal; SWPGenericDbParameter eventTypeIDGenericDbParameter = new SWPGenericDbParameter( "@EventTypeID", DbType.Int32, ParameterDirection.Input, 0, eventTypeID); SWPGenericDbParameter eventTypeNameGenericDbParameter = new SWPGenericDbParameter( "@EventTypeName", DbType.String, ParameterDirection.Input, 255, eventTypeName); SWPGenericDbParameter eventTypeDescriptionGenericDbParameter = new SWPGenericDbParameter( "@EventTypeDescription", DbType.String, ParameterDirection.Input, 4000, eventTypeDescription); if (_dbTransactionConnection == null) { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbConnectionName, "uspEventTypeUpdate", eventTypeIDGenericDbParameter, eventTypeNameGenericDbParameter, eventTypeDescriptionGenericDbParameter); } else { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbTransactionConnection, "uspEventTypeUpdate", eventTypeIDGenericDbParameter, eventTypeNameGenericDbParameter, eventTypeDescriptionGenericDbParameter); } return(retVal); }
public int Update( int eventID, int venueID, int eventTypeID, string eventName, string eventDescription, byte [] eventPhoto, DateTime eventDate, decimal goldPackagePrice, decimal silverPackagePrice, decimal bronzePackagePrice, decimal goldPackageTrueCost, decimal silverPackageTrueCost, decimal bronzePackageTrueCost, decimal eventTotalCost) { StringBuilder validationErrorReport = new StringBuilder(); ValidateParameterLength( "eventName", eventName.Length, 255, validationErrorReport); ValidateParameterLength( "eventDescription", eventDescription.Length, 4000, validationErrorReport); ValidateParameterLength( "eventPhoto", eventPhoto.Length, 2147483647, validationErrorReport); if (validationErrorReport.Length > 0) { throw new ApplicationException(validationErrorReport.ToString()); } int retVal; SWPGenericDbParameter eventIDGenericDbParameter = new SWPGenericDbParameter( "@EventID", DbType.Int32, ParameterDirection.Input, 0, eventID); SWPGenericDbParameter venueIDGenericDbParameter = new SWPGenericDbParameter( "@VenueID", DbType.Int32, ParameterDirection.Input, 0, venueID); SWPGenericDbParameter eventTypeIDGenericDbParameter = new SWPGenericDbParameter( "@EventTypeID", DbType.Int32, ParameterDirection.Input, 0, eventTypeID); SWPGenericDbParameter eventNameGenericDbParameter = new SWPGenericDbParameter( "@EventName", DbType.String, ParameterDirection.Input, 255, eventName); SWPGenericDbParameter eventDescriptionGenericDbParameter = new SWPGenericDbParameter( "@EventDescription", DbType.String, ParameterDirection.Input, 4000, eventDescription); SWPGenericDbParameter eventPhotoGenericDbParameter = new SWPGenericDbParameter( "@EventPhoto", DbType.Binary, ParameterDirection.Input, 2147483647, eventPhoto); SWPGenericDbParameter eventDateGenericDbParameter = new SWPGenericDbParameter( "@EventDate", DbType.DateTime, ParameterDirection.Input, 0, eventDate); SWPGenericDbParameter goldPackagePriceGenericDbParameter = new SWPGenericDbParameter( "@GoldPackagePrice", DbType.Currency, ParameterDirection.Input, 0, goldPackagePrice); SWPGenericDbParameter silverPackagePriceGenericDbParameter = new SWPGenericDbParameter( "@SilverPackagePrice", DbType.Currency, ParameterDirection.Input, 0, silverPackagePrice); SWPGenericDbParameter bronzePackagePriceGenericDbParameter = new SWPGenericDbParameter( "@BronzePackagePrice", DbType.Currency, ParameterDirection.Input, 0, bronzePackagePrice); SWPGenericDbParameter goldPackageTrueCostGenericDbParameter = new SWPGenericDbParameter( "@GoldPackageTrueCost", DbType.Currency, ParameterDirection.Input, 0, goldPackageTrueCost); SWPGenericDbParameter silverPackageTrueCostGenericDbParameter = new SWPGenericDbParameter( "@SilverPackageTrueCost", DbType.Currency, ParameterDirection.Input, 0, silverPackageTrueCost); SWPGenericDbParameter bronzePackageTrueCostGenericDbParameter = new SWPGenericDbParameter( "@BronzePackageTrueCost", DbType.Currency, ParameterDirection.Input, 0, bronzePackageTrueCost); SWPGenericDbParameter eventTotalCostGenericDbParameter = new SWPGenericDbParameter( "@EventTotalCost", DbType.Currency, ParameterDirection.Input, 0, eventTotalCost); if (_dbTransactionConnection == null) { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbConnectionName, "uspEventUpdate", eventIDGenericDbParameter, venueIDGenericDbParameter, eventTypeIDGenericDbParameter, eventNameGenericDbParameter, eventDescriptionGenericDbParameter, eventPhotoGenericDbParameter, eventDateGenericDbParameter, goldPackagePriceGenericDbParameter, silverPackagePriceGenericDbParameter, bronzePackagePriceGenericDbParameter, goldPackageTrueCostGenericDbParameter, silverPackageTrueCostGenericDbParameter, bronzePackageTrueCostGenericDbParameter, eventTotalCostGenericDbParameter); } else { retVal = SWPDBHelper.StoredProcExecuteNonQuery( _dbTransactionConnection, "uspEventUpdate", eventIDGenericDbParameter, venueIDGenericDbParameter, eventTypeIDGenericDbParameter, eventNameGenericDbParameter, eventDescriptionGenericDbParameter, eventPhotoGenericDbParameter, eventDateGenericDbParameter, goldPackagePriceGenericDbParameter, silverPackagePriceGenericDbParameter, bronzePackagePriceGenericDbParameter, goldPackageTrueCostGenericDbParameter, silverPackageTrueCostGenericDbParameter, bronzePackageTrueCostGenericDbParameter, eventTotalCostGenericDbParameter); } return(retVal); }