// GET: Customers/Details/5 public ActionResult IndexSingle(int?CustomerId, int?ShippingId) { var singleSelectList = new SelectedInfoModel(); singleSelectList.Customers = db.Customers.ToList(); if (CustomerId == null) { if (Session["CustomerId"] != null) { CustomerId = Convert.ToInt32(Session["CustomerId"].ToString()); } } if (CustomerId != null) { Session["CustomerId"] = CustomerId; singleSelectList.Orders = db.Orders.Where(w => w.CustomerId == CustomerId.Value).ToList(); } if (ShippingId != null) { singleSelectList.ShippingInfos = db.ShippingInfoes.Include(i => i.DeliveryBoy).Where(w => w.ShippingId == ShippingId.Value).ToList(); } return(View(singleSelectList)); }
public ActionResult IndexSingle(int?PassengerId, int?CountryId) { var singleSelectList = new SelectedInfoModel(); singleSelectList.passengers = db.PassengerInfoes.ToList(); if (PassengerId == null) { if (Session["PassengerId"] != null) { PassengerId = Convert.ToInt32(Session["PassengerId"].ToString()); } } if (PassengerId != null) { Session["PassengerId"] = PassengerId; singleSelectList.bookingFlights = db.BookingFlights.Where(w => w.PassengerID == PassengerId.Value).ToList(); } if (CountryId != null) { singleSelectList.countries = db.Countries.Include(i => i.BookingFlights).Where(w => w.CountryID == CountryId.Value).ToList(); } return(View(singleSelectList)); }
public IActionResult IndexSingle(int?CustomerId, int?ShippingId) { var singleSelectList = new SelectedInfoModel(); singleSelectList.Customers = _context.Customers.ToList(); if (CustomerId == null) { byte[] kkk = HttpContext.Session.Get("CustomerId"); if (kkk != null) { string someString = Encoding.ASCII.GetString(kkk); CustomerId = Convert.ToInt32(someString); } } if (CustomerId != null) { HttpContext.Session.SetString("CustomerId", CustomerId.ToString()); //geustFoodOrder.OrderFoods = _context.OrderFood.Where(w => w.GuestId == GuestId.Value).ToList(); //Session["CustomerId"] = CustomerId; singleSelectList.Orders = _context.Orders.Where(w => w.CustomerId == CustomerId.Value).ToList(); } if (ShippingId != null) { singleSelectList.ShippingInfos = _context.ShippingInfoes.Include(i => i.DeliveryBoy).Where(w => w.ShippingId == ShippingId.Value).ToList(); } return(View(singleSelectList)); }
public ActionResult IndexSingle(int?CustomerId, int?OrderId) { var singleSelectList = new SelectedInfoModel(); singleSelectList.Customers = db.Orders.Include(i => i.Customer).Select(s => s.Customer).ToList(); if (CustomerId == null) { if (Session["CustomerId"] != null) { CustomerId = Convert.ToInt32(Session["CustomerId"].ToString()); } } if (CustomerId != null) { Session["CustomerId"] = CustomerId; singleSelectList.Order = db.Orders.Where(s => s.CustomerID == CustomerId.Value).ToList(); } if (OrderId != null) { singleSelectList.Product = db.Orders.Include(i => i.Product).Where(w => w.OrderID == OrderId).Select(s => s.Product).ToList(); } return(View(singleSelectList)); }
public ActionResult IndexSingle(int?PassengerId, int?CountryId) { var singleSelectList = new SelectedInfoModel(); singleSelectList.passengers = _context.passengerInfoes.ToList(); if (PassengerId == null) { byte[] kkk = HttpContext.Session.Get("PassengerId"); if (kkk != null) { string someString = Encoding.ASCII.GetString(kkk); PassengerId = Convert.ToInt32(someString); //PassengerId = Convert.ToInt32(Session["PassengerId"].ToString()); } } if (PassengerId != null) { HttpContext.Session.SetString("PassengerId", PassengerId.ToString()); singleSelectList.bookingFlights = _context.bookingFlights.Where(w => w.PassengerID == PassengerId.Value).ToList(); } if (CountryId != null) { singleSelectList.countries = _context.countries.Include(i => i.BookingFlights).Where(w => w.CountryID == CountryId.Value).ToList(); } return(View(singleSelectList)); }