//Metodo para modifiMark vehiculo
 public void UpdateMarks(Mark pMark)
 {
     using (var db = new DAL.DBCommon())
     {
         db.Entry(pMark).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
示例#2
0
 //Metodos para Eliminar logicamente y restaurar
 public void UpdateItem(User pItem)
 {
     using (var db = new DAL.DBCommon())
     {
         db.Entry(pItem).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
示例#3
0
 //Metodo para modificar vehiculo
 public void UpdateCars(Car pCar)
 {
     using (var db = new DAL.DBCommon())
     {
         db.Entry(pCar).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
        //metodo para buscar Reservation un trabajador
        //busca por codigo , nombre y apellido
        //public List<Reservation> Search(Reservation pReservation)
        //{
        //    var Reservations = from s in Db.Reservations
        //                  select s;
        //    Reservations = Db.Reservations.Where(
        //        s => s.Date.ToUpper().Contains(pReservation.Name.ToUpper()) ||
        //        s.Department.ToUpper().Contains(pReservation.Department.ToUpper()) ||
        //        s.Name.ToLower().Contains(pReservation.Name.ToLower()) ||
        //        s.Department.ToLower().Contains(pReservation.Department.ToLower()) ||
        //        s.Code.ToUpper().Contains(pReservation.Code.ToUpper()) ||
        //         s.Code.ToLower().Contains(pReservation.Code.ToLower())
        //        );
        //    return Reservations.ToList();
        //}

        //Metodos para Eliminar logicamente y restaurar
        public void UpdateItem(Reservation pItem)
        {
            try
            {
                using (var db = new DAL.DBCommon())
                {
                    db.Entry(pItem).State = EntityState.Modified;
                    db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception: {0}", ex);
            }
        }