Пример #1
0
 public void Delete(int id)
 {
     var driver = new DriverDa(databasecontext);
     if (id > 0)
     {
         var currentOrder = GetById(id);
         driver.Delete(currentOrder);
     }
 }       
Пример #2
0
        public Driver Save(int id, string FullName)
        {
            var driver = id > 0 ? GetById(id) : new Driver();

            driver.FullName = FullName;

            var driverDa = new DriverDa(databasecontext);

            //if new
            if (id < 1) driver = driverDa.Add(driver);
            //update
            else driver = driverDa.Update(driver);
            return driver;
        }