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(); } }
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 { }; }
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); }
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(); } }
//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; } }