Пример #1
0
 public void FillRouteWithSameCities()
 {
     route = RouteCreator.WithSameCities();
     DepartureCity.SendKeys(route.DepartureCity);
     ArrivalCity.SendKeys(route.ArrivalCity);
     Body.Click(2);
 }
Пример #2
0
 public MainPage InputRouteDateAndClickSearch(string departureCity, string arrivalCity)
 {
     DepartureCity.SendKeys(departureCity);
     ArrivalCity.SendKeys(arrivalCity);
     SearchButton.Click();
     return(this);
 }
Пример #3
0
        public async Task <IActionResult> PutDepartureCity([FromRoute] int id, [FromBody] DepartureCity departureCity)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != departureCity.ID)
            {
                return(BadRequest());
            }

            _context.Entry(departureCity).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DepartureCityExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #4
0
        public void DepartureCity_returns_Seattle()
        {
            DepartureCity result      = DepartureCity.Find(1);
            string        finalResult = result.GetDepartureCity();

            Assert.AreEqual("Seattle", finalResult);
        }
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TransportOrderNo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderYear?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DocumentTransportNo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DepartureCustomerName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DepartureAddress?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DepartureCity?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DepartureState?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DestinationName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DestinationAddress?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DestinationCity?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DestinationState?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Qty?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderWeight?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Volume?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Pallet?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RetiredDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DeliveryDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Note?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CallCustomerBefore?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Telephone?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DayClosed?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Urgent?.GetHashCode() ?? 0);
            return(hashCode);
        }
Пример #6
0
        public ActionResult Create()
        {
            DepartureCity newDepartureCity = new DepartureCity(Request.Form["departure-city"]);

            newDepartureCity.Save();
            return(View("Success", "Home"));
        }
Пример #7
0
 public void EnterCustomerCardNumber(string number)
 {
     DepartureCity.Click();
     Body.Click();
     AddCustomerCardButton.Click();
     CustomerCardInput.SendKeys(number);
 }
Пример #8
0
        public ActionResult AddDepartureToArrival(int departureId)
        {
            ArrivalCity   arrival   = ArrivalCity.Find(departureId);
            DepartureCity departure = DepartureCity.Find(Int32.Parse(Request.Form["departure-id"]));

            arrival.SetDepartures(departure); //Want to run the join table method
            return(RedirectToAction("ViewArrivals", new { id = departureId }));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            DepartureCity departureCity = db.DepartureCities.Find(id);

            db.DepartureCities.Remove(departureCity);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #10
0
        public ActionResult AddArrivalToDeparture(int arrivalId)
        {
            DepartureCity departure = DepartureCity.Find(arrivalId);
            ArrivalCity   arrival   = ArrivalCity.Find(Int32.Parse(Request.Form["arrival-id"]));

            departure.SetArrivals(arrival); //Want to run the join table method
            return(RedirectToAction("ViewDepartures", new { id = arrivalId }));
        }
Пример #11
0
 public void FillRoute()
 {
     route = RouteCreator.WithAllProperties();
     DepartureCity.SendKeys(route.DepartureCity);
     ArrivalCity.SendKeys(route.ArrivalCity);
     Body.Click(2);
     CalendarInput.Click();
     GetTomorrow().Click();
 }
Пример #12
0
 public ListTicketsPage InputRouteDateAndClickSearch(Route route)
 {
     DepartureCity.SendKeys(route.DepartureCity);
     ArrivalCity.SendKeys(route.ArrivalCity);
     DateFiled.Clear();
     DateFiled.SendKeys(DateTime.Now.AddDays(1).ToString("dd.MM.yyyy"));
     SearchButton.Click();
     return(new ListTicketsPage(driver));
 }
Пример #13
0
        public void DepartureCityId_returns_all_ArrivalId()
        {
            DepartureCity result      = DepartureCity.Find(9);
            int           finalResult = result.GetArrivals()[0].GetId();

            Console.WriteLine(finalResult);

            Assert.AreEqual(1, finalResult);
        }
 public ActionResult Edit([Bind(Include = "CityID,Cities")] DepartureCity departureCity)
 {
     if (ModelState.IsValid)
     {
         db.Entry(departureCity).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(departureCity));
 }
        public ActionResult Create([Bind(Include = "CityID,Cities")] DepartureCity departureCity)
        {
            if (ModelState.IsValid)
            {
                db.DepartureCities.Add(departureCity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(departureCity));
        }
Пример #16
0
        public ActionResult ViewDepartures(int id)
        {
            Dictionary <string, object> model        = new Dictionary <string, object>();
            DepartureCity      selectedDepartureCity = DepartureCity.Find(id);
            List <ArrivalCity> flights     = selectedDepartureCity.GetArrivals();
            List <ArrivalCity> allArrivals = ArrivalCity.GetAll();

            model.Add("selectedDepartureCity", selectedDepartureCity);
            model.Add("flights", flights);
            model.Add("allArrivals", allArrivals);
            return(View(model));
        }
Пример #17
0
        public async Task <IActionResult> PostDepartureCity([FromBody] DepartureCity departureCity)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.DepartureCity.Add(departureCity);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetDepartureCity", new { id = departureCity.ID }, departureCity));
        }
Пример #18
0
        public ActionResult ViewArrivals(int id)
        {
            Dictionary <string, object> model        = new Dictionary <string, object>();
            ArrivalCity          selectedArrivalCity = ArrivalCity.Find(id);
            List <Flight>        flights             = selectedArrivalCity.GetInboundFlights();
            List <DepartureCity> allDepartures       = DepartureCity.GetAll();

            model.Add("selectedArrivalCity", selectedArrivalCity);
            model.Add("flights", flights);
            model.Add("allDepartures", allDepartures);
            return(View(model));
        }
        // GET: DepartureCities/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DepartureCity departureCity = db.DepartureCities.Find(id);

            if (departureCity == null)
            {
                return(HttpNotFound());
            }
            return(View(departureCity));
        }
        public ActionResult Index()
        {
            List <DepartureCity> allDepartureCities = DepartureCity.GetAll();

            return(View(allDepartureCities));
        }
Пример #21
0
 public void FillRouteWithoutDate()
 {
     route = RouteCreator.WithoutDate();
     DepartureCity.SendKeys(route.DepartureCity);
     ArrivalCity.SendKeys(route.ArrivalCity);
 }