Ejemplo n.º 1
0
        private static void UpdateFlightSearchBatch(DatabaseHandlerMain db, FlightSearchBatch f, SqlCommand command)
        {
            try
            {
                var searchConditionUpdateQuery = "Exec [Report].[usp_FlightSearchBatchUpdate] @BatchID ,@FROM, @TO";
                searchConditionUpdateQuery += ",@SeachStayDuration, @SeachPeriodFrom ,@SeachPeriodTo ,@PreferredAirlineCode ,@TotalAdult";
                searchConditionUpdateQuery += ",@TotalChild ,@TotalInfant ,@CabinClass ,@IsGetCorporateFare ,@IsActive";

                command.CommandText = searchConditionUpdateQuery;

                command.Parameters.Clear();

                command.Parameters.Add(new SqlParameter("BatchID", f.BatchID));
                command.Parameters.Add(new SqlParameter("FROM", f.FROM ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("TO", f.TO ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("SeachStayDuration", f.SeachStayDuration ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("SeachPeriodFrom", f.SeachPeriodFrom ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("SeachPeriodTo", f.SeachPeriodTo ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("PreferredAirlineCode", f.PreferredAirlineCode ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("TotalAdult", f.TotalAdult ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("TotalChild", f.TotalChild ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("TotalInfant", f.TotalInfant ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("CabinClass", f.CabinClass ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("IsGetCorporateFare", f.IsGetCorporateFare ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("IsActive", f.IsActive));

                db.UpdateDataByStoredProcedure(command);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        private static void InsertFlightSearchResult(DatabaseHandlerMain db, FlightSearchResult searchresult, SqlCommand command)
        {
            try
            {
                var searchResultInsertQuery = "Exec [Report].[usp_FlightSearchResultInsert]  @BatchID,@OutboundDepartureDate,@InboundDepartureDate,@AirlineCode,@TotalPrice,@ResBookDesignCode";

                command.CommandText = searchResultInsertQuery;

                command.Parameters.Clear();

                command.Parameters.Add(new SqlParameter("BatchID", searchresult.BatchID ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("OutboundDepartureDate", searchresult.OutboundDepartureDate ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("InboundDepartureDate", searchresult.InboundDepartureDate ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("AirlineCode", searchresult.AirlineCode ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("TotalPrice", searchresult.TotalPrice ?? (object)DBNull.Value));
                command.Parameters.Add(new SqlParameter("ResBookDesignCode", searchresult.ResBookDesignCode ?? (object)DBNull.Value));

                db.UpdateDataByStoredProcedure(command);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }