public DataTable GetDataBySD(BO_FlightScheduld BALObj) { AirlineConnect con = new AirlineConnect(); try { DataTable dt = new DataTable(); con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_GetDataBySD", con.Connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SourceId", BALObj.Source); cmd.Parameters.AddWithValue("@DestinationId", BALObj.Destination); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); return(dt); } catch (Exception ex) { throw ex; } finally { con.CloseConnection(); } }
public bool SubmitFeedBack() { AirlineConnect con = new AirlineConnect(); try { con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_SubmitFeedBack", con.Connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Name", this.Name); cmd.Parameters.AddWithValue("@MobileNo", this.MobileNo); cmd.Parameters.AddWithValue("@Subject", this.Subject); cmd.Parameters.AddWithValue("@Message", this.Message); int result = cmd.ExecuteNonQuery(); if (result == 1) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } finally { con.CloseConnection(); } }
//UpdateAccountGroup public bool UpdateFlightScheduld(BO_FlightScheduld BOFlight) { AirlineConnect con = new AirlineConnect(); try { con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_UpdateFlightScheduld", 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); cmd.Parameters.AddWithValue("@Id", BOFlight.Id); cmd.ExecuteNonQuery(); return(true); } catch (Exception ex) { throw ex; } }
public bool InsertCity(City City) { AirlineConnect con = new AirlineConnect(); try { con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_InsertCity", con.Connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CityName", City.CityName); cmd.Parameters.AddWithValue("@CityCode", City.CityCode); DALCity Dal = new DALCity(); Dal.insert(City); int result = cmd.ExecuteNonQuery(); if (result == 1) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } finally { con.CloseConnection(); } }
public DataTable GetUserId(Register Reg) { AirlineConnect con = new AirlineConnect(); try { DataTable dt = new DataTable(); con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_getUserId", con.Connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Email", Reg.Email); cmd.Parameters.AddWithValue("@Password", Reg.Password); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); return(dt); } catch (Exception ex) { throw ex; } finally { con.CloseConnection(); } }
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 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 bool BookTickets(BO_Booking BalObj) { DAL_BookedTicket DalObj = new DAL_BookedTicket(); AirlineConnect con = new AirlineConnect(); try { con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_BookTicket", con.Connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@FlightId", BalObj.FlightId); cmd.Parameters.AddWithValue("@FlightName", BalObj.FlightName); cmd.Parameters.AddWithValue("@FlightNumber", BalObj.FlightNumber); cmd.Parameters.AddWithValue("@Date", BalObj.DepartureDate); cmd.Parameters.AddWithValue("@Time", BalObj.Departuretime); cmd.Parameters.AddWithValue("@SourceId", BalObj.Source); cmd.Parameters.AddWithValue("@DestinationId", BalObj.Destination); cmd.Parameters.AddWithValue("@Class", BalObj.Class); cmd.Parameters.AddWithValue("@Passangers", BalObj.NoOfPassangers); cmd.Parameters.AddWithValue("@Amount", BalObj.AmountPayable); cmd.Parameters.AddWithValue("@TicketNo", BalObj.TicketNo); cmd.Parameters.AddWithValue("@UserId", BalObj.UserId); DalObj.insert(BalObj); int result = cmd.ExecuteNonQuery(); if (result == 1) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } finally { con.CloseConnection(); } }
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(); } }
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 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); }
//UpdateAccountGroup public bool UpdateFinancialYear(City city) { AirlineConnect con = new AirlineConnect(); try { con.GetConnection(); SqlCommand cmd = new SqlCommand("usp_UpdateCity", con.Connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CityName", city.CityName); cmd.Parameters.AddWithValue("@CityCode", city.CityCode); cmd.Parameters.AddWithValue("@Id", city.Id); cmd.ExecuteNonQuery(); return(true); } catch (Exception ex) { throw ex; } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
//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; } }
//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; } }