public string Get(string date, string source, string destination, string temp) { RegBL bl = new RegBL(); string price = bl.GetPrice(date, source, destination, temp); return(price); }
public ActionResult Registration(RegistrationModel register) { RegBL bl = new RegBL(); if (ModelState.IsValid) { try { if (bl.Insert_userBl(register.FirstName, register.LastName, register.DateOfBirth, register.Nationality, register.Phonenumber, register.Gender, register.Email, register.Password)) { ViewBag.Message = string.Format("Registered sucessfully Go Back and Login"); } else { ViewBag.Message = "Not registered try again!!!"; } } catch (Exception ex) { if (ex.Message.Contains("PRIMARY KEY")) { ViewBag.Message = "Mail id Already exists!!! Try Again!!!"; return(View()); } } } return(View()); }
public ActionResult Login(LoginModel login) { RegBL bl = new RegBL(); if (ModelState.IsValid) { try { if (bl.Login(login.Gmail, login.Password)) { // ViewBag.Message = " Invalid phone password right"; return(RedirectToAction("Search", "FlightSearch")); //View("Search", "FlightSearch"); } else { ViewBag.Message = "Invalid gmail address or password"; } } catch (Exception e) { ViewBag.Message = "Invalid username and password !!!please try again"; } } return(View()); }
// GET: api/SearchFlight public IEnumerable <string> Get() { RegBL bl = new RegBL(); List <string> list = new List <string>(); list = bl.FetchPlaceNames(); return(list); }
// GET: api/SearchFlight/5 public List <SearchFlight> Get(string date, string source, string destination) { RegBL bl = new RegBL(); List <SearchFlight> list = new List <SearchFlight>(); list = bl.getDetails(date, source, destination); return(list); }
// POST: api/SearchFlight public bool Post(int value, string value1) { RegBL bl = new RegBL(); try { return(bl.postDetails(value, value1)); } catch (Exception e) { return(false); } }
public string addPassenger(PassengersList passengersList) { RegBL bl = new RegBL(); //List<PassangerModel> pl = passengers; foreach (PassangerModel item in passengersList.Passangers) { if (bl.Insert_Passenger(item.Pa_name, item.Ps_age, item.Gender)) { ViewBag.message = "passanger details added"; // RedirectToAction("addPaddPassenger"); } else { ViewBag.message = "not added"; } } return(ViewBag.message); }
public ActionResult Login(LoginModel login) { RegBL bl = new RegBL(); if (ModelState.IsValid) { if (bl.Login(login.Gmail, login.Password)) { // ViewBag.Message = " Invalid phone password right"; return(RedirectToAction("Search", "FlightSearch")); //View("Search", "FlightSearch"); } else { ViewBag.Message = "Invalid phone or password"; } } return(View()); }
public ActionResult addPassenger(PassengersList passengersList) { RegBL bl = new RegBL(); //List<PassangerModel> pl = passengers; // int id =Convert.ToInt32(Session["un"].ToString()) ; foreach (PassangerModel item in passengersList.Passangers) { if (bl.Insert_Passenger(item.Pa_name, item.Ps_age, item.Gender)) { ViewBag.message = "passanger details added"; return(RedirectToAction("DisplayPassengerDetails", "Preview")); } else { ViewBag.message = "not added"; } } return(View()); }
public ActionResult Registration(RegistrationModel register) { RegBL bl = new RegBL(); if (ModelState.IsValid) { if (bl.Insert_userBl(register.FirstName, register.LastName, register.DateOfBirth, register.Nationality, register.Phonenumber, register.Gender, register.Email, register.Password)) { ViewBag.Message = "Registered sucessfully"; //return View(); } else { ViewBag.Message = "Not registered try again!!!"; } } //return RedirectToAction("Login", "Login"); return(View("Registration")); }
private List <PreviewModel> GetUserPreviewDetails() { RegBL bl = new RegBL(); List <PreviewModel> users = new List <PreviewModel>(); PreviewModel user = null; List <PreviewDetailsModel> modelUsers = bl.PrintPreviewDetails(); foreach (PreviewDetailsModel item in modelUsers) { user = new PreviewModel(); user.S_Id = item.S_Id; user.Des_Id = item.Des_Id; user.Departure_Time = item.Departure_Time; user.Arrival_Time = item.Arrival_Time; user.Passenger = item.Passenger; user.Booked_Date = item.Booked_Date; user.Fare = item.Fare; users.Add(user); } return(users); }
// GET: api/Admin public AdminController() { bl = new RegBL(); }
public RegisterController() { bl = new RegBL(); }