public bool InsertFlightScheduld(BO_FlightScheduld BOFlight)
    {
        DL_FlightScheduld dl = new DL_FlightScheduld();

        AirlineConnect con = new AirlineConnect();

        try
        {
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_InsertFlightScheduld", con.Connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@FlightId", BOFlight.FlightId);
            cmd.Parameters.AddWithValue("@Date", BOFlight.Date);
            cmd.Parameters.AddWithValue("@Time", BOFlight.Time);
            cmd.Parameters.AddWithValue("@SourceId", BOFlight.Source);
            cmd.Parameters.AddWithValue("@DestinationId", BOFlight.Destination);

            cmd.Parameters.AddWithValue("@BFare", BOFlight.BFare);
            cmd.Parameters.AddWithValue("@EFare", BOFlight.EFare);
            cmd.Parameters.AddWithValue("@EXFare", BOFlight.EXFare);


            int result = cmd.ExecuteNonQuery();
            dl.insert(BOFlight);
            if (result == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.CloseConnection();
        }
    }
Exemple #2
0
    public bool DeleteFlightTarrif(BOFlightTarrif BOFlight)
    {
        AirlineConnect con = new AirlineConnect();

        try
        {
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_DeleteFlightTarrif", con.Connection);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Id", BOFlight.Id);
            cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
        }
        finally
        {
            con.CloseConnection();
        }

        return(true);
    }
Exemple #3
0
    public bool CancelTicket(BO_Booking BoObj)
    {
        AirlineConnect con = new AirlineConnect();

        try
        {
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_CancelTicket", con.Connection);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@TicketNo", BoObj.TicketNo);
            cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
        }
        finally
        {
            con.CloseConnection();
        }

        return(true);
    }
Exemple #4
0
    public bool userinsert(Register reg)
    {
        AirlineConnect con = new AirlineConnect();

        try
        {
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_userinsert", con.Connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@FirstName", reg.FirstName);
            cmd.Parameters.AddWithValue("@LastName", reg.LastName);
            cmd.Parameters.AddWithValue("@MobileNo", reg.Mobile);
            cmd.Parameters.AddWithValue("@Email", reg.Email);
            cmd.Parameters.AddWithValue("@Address", reg.City);
            cmd.Parameters.AddWithValue("@Gender", reg.Gender);
            cmd.Parameters.AddWithValue("@Password", reg.Password);



            int result = cmd.ExecuteNonQuery();
            if (result == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.CloseConnection();
        }
    }
Exemple #5
0
    public DataTable GetAllFlightTarrifInfo()
    {
        AirlineConnect con = new AirlineConnect();

        try
        {
            DataTable dt = new DataTable();
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_GetAllFlightTarrifInfo", con.Connection);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dt);
            return(dt);
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.CloseConnection();
        }
    }
Exemple #6
0
    public bool InsertFlightTarrif(BOFlightTarrif BOFlight)
    {
        DALFlightTarrif dal = new DALFlightTarrif();

        AirlineConnect con = new AirlineConnect();

        try
        {
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_InsertFlightTarrif", con.Connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Flight", BOFlight.Flight);
            cmd.Parameters.AddWithValue("@Class", BOFlight.Class);
            cmd.Parameters.AddWithValue("@Seats", BOFlight.Seats);
            cmd.Parameters.AddWithValue("@Fare", BOFlight.Fare);

            dal.insert(BOFlight);
            int result = cmd.ExecuteNonQuery();
            if (result == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.CloseConnection();
        }
    }
Exemple #7
0
    public DataSet GetFlightInfo(BO_Booking BalObj)
    {
        AirlineConnect con = new AirlineConnect();

        try
        {
            DataSet ds = new DataSet();
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_FlightInfoForBook", con.Connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@FlightId", BalObj.FlightId);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(ds);
            return(ds);
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.CloseConnection();
        }
    }
Exemple #8
0
    public DataTable GetUpdateData(BO_Booking BALObj)
    {
        AirlineConnect con = new AirlineConnect();

        try
        {
            DataTable dt = new DataTable();
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_GetBookedTickts", con.Connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@UserId", BALObj.UserId);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dt);
            return(dt);
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.CloseConnection();
        }
    }