예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            NewDriver newDriver = db.NewDrivers.Find(id);

            db.NewDrivers.Remove(newDriver);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "DriverId,Id,DriverFullName,Email,contactNumber,DriverStatus,DriverLocation,DriverDestination")] NewDriver newDriver)
 {
     if (ModelState.IsValid)
     {
         db.Entry(newDriver).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(newDriver));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "DriverId,Id,DriverFullName,Email,contactNumber,DriverStatus,DriverLocation,DriverDestination")] NewDriver newDriver)
        {
            if (ModelState.IsValid)
            {
                db.NewDrivers.Add(newDriver);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(newDriver));
        }
예제 #4
0
        // GET: NewDrivers/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NewDriver newDriver = db.NewDrivers.Find(id);

            if (newDriver == null)
            {
                return(HttpNotFound());
            }
            return(View(newDriver));
        }
예제 #5
0
 /**
  * {@inheritDoc}
  */
 public void TestStarted()
 {
     if (GetBasedir() != null && GetBasedir().Length > 0)
     {
         try
         {
             FileServer.getFileServer().setBasedir(FileServer.getFileServer().GetBasedir() + GetBasedir());
         }
         catch (IllegalStateException e)
         {
             log.Error("Failed to set file server base dir with " + GetBasedir(), e);
         }
     }
     // we set the classpath
     String[] paths = this.getTestPlanClasspathArray();
     for (int idx = 0; idx < paths.Length; idx++)
     {
         NewDriver.addURL(paths[idx]);
         log.Info("add " + paths[idx] + " to classpath");
     }
 }
예제 #6
0
 /// <summary>
 /// Returns a description of the Task.
 /// </summary>
 /// <returns></returns>
 public override string ToString() =>
 $"change the WebDriver instance to a new '{NewDriver.GetType()}'";