示例#1
0
        /// <summary>
        /// Insert GdsAirportDal detail.
        /// </summary>
        /// <param name="xmlData">Data that converted into xml format.</param>
        /// <returns>Returns 1 and 0; (1 indicates successful operation).</returns>
        public int UpdateAirLineMap(AirlineMapBDto objGdsAirportBDto)
        {
            Database db = null;
            DbCommand dbCmd = null;
            int Result = 0;
            try
            {
                db = DatabaseFactory.CreateDatabase(DALHelper.CRM_CONNECTION_STRING);
                dbCmd = db.GetStoredProcCommand(DALHelper.USP_FARE_AIRLINE_AIRPORT_MAP_UPDATE);

                db.AddInParameter(dbCmd, "@SR_NO", DbType.Int32, objGdsAirportBDto.srNo);
                db.AddInParameter(dbCmd, "@AIRPORT_ID", DbType.Int32, objGdsAirportBDto.AirportId);
                db.AddInParameter(dbCmd, "@AIRLINE_ID", DbType.Int32, objGdsAirportBDto.AirLineID);
                db.AddInParameter(dbCmd, "@DESTINATION_CITY_ID", DbType.Int32, objGdsAirportBDto.DestinationCityId);
                db.AddInParameter(dbCmd, "@BAGGAGE_ALLOWANCE", DbType.String, objGdsAirportBDto.BaggageAllowance);
				db.AddInParameter(dbCmd, "@CANCELLATION", DbType.String, objGdsAirportBDto.Cancellation);
				db.AddInParameter(dbCmd, "@DATE_CHANGE", DbType.String, objGdsAirportBDto.DateChange);
				db.AddInParameter(dbCmd, "@PAYMENT_POLICY", DbType.String, objGdsAirportBDto.PaymentPolicy);

                Result = db.ExecuteNonQuery(dbCmd);
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                {
                    throw ex;
                }
            }
            finally
            {
                DALHelper.Destroy(ref dbCmd);
            }
            return Result;
        }
示例#2
0
		/// <summary>
		/// Insert GdsAirportDal detail.
		/// </summary>
		/// <param name="xmlData">Data that converted into xml format.</param>
		/// <returns>Returns 1 and 0; (1 indicates successful operation).</returns>
		public int InsertAirLineMapDocument(AirlineMapBDto objGdsAirportBDto)
		{
			Database db = null;
			DbCommand dbCmd = null;
			int Result = 0;
			try
			{
				db = DatabaseFactory.CreateDatabase(DALHelper.CRM_CONNECTION_STRING);
				dbCmd = db.GetStoredProcCommand("USP_COMMON_DOCUMENT_MASTER_INSERT");
				if (objGdsAirportBDto.FaqDocument != null)
					db.AddInParameter(dbCmd, "@FAQ_DOC", DbType.Binary, objGdsAirportBDto.FaqDocument);
				else
					db.AddInParameter(dbCmd, "@FAQ_DOC", DbType.Binary, DBNull.Value);

				if (!String.IsNullOrEmpty(objGdsAirportBDto.FaqDocType))
					db.AddInParameter(dbCmd, "@FAQ_DOC_CONTENT_TYPE", DbType.String, objGdsAirportBDto.FaqDocType);
				else
					db.AddInParameter(dbCmd, "@FAQ_DOC_CONTENT_TYPE", DbType.String, DBNull.Value);

				if (!String.IsNullOrEmpty(objGdsAirportBDto.FaqDocFileName))
					db.AddInParameter(dbCmd, "@FAQ_DOC_FILE_NAME", DbType.String, objGdsAirportBDto.FaqDocFileName);
				else
					db.AddInParameter(dbCmd, "@FAQ_DOC_FILE_NAME", DbType.String, DBNull.Value);

				if (objGdsAirportBDto.TermsDocument != null)
					db.AddInParameter(dbCmd, "@T_C_DOC", DbType.Binary, objGdsAirportBDto.TermsDocument);
				else
					db.AddInParameter(dbCmd, "@T_C_DOC", DbType.Binary, DBNull.Value);

				if (!String.IsNullOrEmpty(objGdsAirportBDto.TermsDocType))
					db.AddInParameter(dbCmd, "@T_C_DOC_CONTENT_TYPE", DbType.String, objGdsAirportBDto.TermsDocType);
				else
					db.AddInParameter(dbCmd, "@T_C_DOC_CONTENT_TYPE", DbType.String, DBNull.Value);

				if (!String.IsNullOrEmpty(objGdsAirportBDto.TermsDocFileName))
					db.AddInParameter(dbCmd, "@T_C_DOC_FILE_NAME", DbType.String, objGdsAirportBDto.TermsDocFileName);
				else
					db.AddInParameter(dbCmd, "@T_C_DOC_FILE_NAME", DbType.String, DBNull.Value);

				Result = db.ExecuteNonQuery(dbCmd);
			}
			catch (Exception ex)
			{
				bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
				if (rethrow)
				{
					throw ex;
				}
			}
			finally
			{
				DALHelper.Destroy(ref dbCmd);
			}
			return Result;
		}