public bool InsertFlight(BO_Flight BOFlight) { AirlineConnect con = new AirlineConnect(); try { con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_InsertFlight", con.Connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@FlightName", BOFlight.FlightName); cmd.Parameters.AddWithValue("@FlightNumber", BOFlight.FlightNumber); cmd.Parameters.AddWithValue("@FlightSP", BOFlight.FlightSP); DALFlightNames dal = new DALFlightNames(); dal.insert(BOFlight); int result = cmd.ExecuteNonQuery(); if (result == 1) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } finally { con.CloseConnection(); } }
public void DeleteCity(BO_Flight id) { DAL(); MongoCollection <City> collection = emptbl.GetCollection <City>("ManageFlight"); IMongoQuery query = Query.EQ("_id", id._id); collection.Remove(query); }
public void updateCity(BO_Flight emp) { DAL(); MongoCollection <Flight> collection = emptbl.GetCollection <Flight>("ManageFlight"); IMongoQuery query = Query.EQ("_id", emp._id); IMongoUpdate update = MongoDB.Driver.Builders.Update.Set("FlightName", emp.FlightName) .Set("FlightNumber", emp.FlightNumber) .Set("FlightSp", emp.FlightSP); collection.Update(query, update); }
public void insert(BO_Flight flg) { DAL(); try { MongoCollection <City> collection = emptbl.GetCollection <City>("Flight"); BsonDocument citycol = new BsonDocument { { "FlightName", flg.FlightName }, { "FlightNumber", flg.FlightNumber }, { "FlightSp", flg.FlightSP } }; collection.Insert(citycol); } catch { }; }
public bool DeleteFlight(BO_Flight BOFlight) { AirlineConnect con = new AirlineConnect(); try { con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_DeleteFlight", con.Connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id", BOFlight.Id); cmd.ExecuteNonQuery(); } catch (Exception ex) { } finally { con.CloseConnection(); } return(true); }
//UpdateAccountGroup public bool UpdateFlightDeatils(BO_Flight BOFlight) { AirlineConnect con = new AirlineConnect(); try { con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_UpdateFlightDeatils", con.Connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@FlightName", BOFlight.FlightName); cmd.Parameters.AddWithValue("@FlightNumber", BOFlight.FlightNumber); cmd.Parameters.AddWithValue("@FlightSP", BOFlight.FlightSP); cmd.Parameters.AddWithValue("@Id", BOFlight.Id); cmd.ExecuteNonQuery(); return(true); } catch (Exception ex) { throw ex; } }