Beispiel #1
0
    public DataTable GetUpdateInfo(BOFlightTarrif BO)
    {
        AirlineConnect con = new AirlineConnect();

        try
        {
            DataTable dt = new DataTable();
            con.GetConnection();
            SqlCommand cmd = new SqlCommand("usp_GetAllFlightTarrifInfoForUpdate", con.Connection);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Id", BO.Id);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dt);
            return(dt);
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            con.CloseConnection();
        }
    }
Beispiel #2
0
 public void insert(BOFlightTarrif Flig)
 {
     DAL();
     try
     {
         MongoCollection <City> collection = emptbl.GetCollection <City>("ManageFlight");
         BsonDocument           citycol    = new BsonDocument {
             { "FlightName", Flig.Flight },
             { "Class", Flig.Class },
             { "Seats", Flig.Seats },
             { "Fare", Flig.Fare.ToString() }
         };
         collection.Insert(citycol);
     }
     catch { };
 }
Beispiel #3
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);
    }
Beispiel #4
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();
        }
    }
Beispiel #5
0
    //UpdateAccountGroup
    public bool UpdateFlightTarrif(BOFlightTarrif BOFlight)
    {
        AirlineConnect con = new AirlineConnect();

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

            cmd.ExecuteNonQuery();

            return(true);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }