Exemplo n.º 1
0
 public void Insert()
 {
     using (RentaCarContext db = new RentaCarContext())
     {
         db.Errores.Add(this);
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
 private void Update()
 {
     using (var db = new RentaCarContext())
     {
         db.Entry(this).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public void Delete()
 {
     using (RentaCarContext db = new RentaCarContext())
     {
         db.Fotos.Remove(this);
         db.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public void insert()
 {
     using (var db = new RentaCarContext())
     {
         db.NCF.Add(this);
         db.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public void Modificar()
 {
     using (var db = new RentaCarContext())
     {
         db.NCF.Attach(this);
         db.Entry(this).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public void Update()
 {
     this.Provincia = null;
     this.Municipio =null;
     using (var db = new RentaCarContext())
     {
         db.Sucursales.Attach(this);
         db.Entry(this).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 7
0
 public void Insert()
 {
     using (var db = new RentaCarContext())
     {
         db.Sucursales.Add(this);
         db.SaveChanges();
     }
 }
Exemplo n.º 8
0
 public void Update()
 {
     using (RentaCarContext db = new RentaCarContext())
     {
         db.Clientes.Attach(this);
         db.Entry(this).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 9
0
        public void Insert()
        {
            int insertardo = 0;
            using (RentaCarContext db = new RentaCarContext())
            {
                db.Clientes.Add(this);
                insertardo = db.SaveChanges();

                if (insertardo == 0)
                {
                    throw new Exception("Se ha producido un error al insertar el cliente, verifique el Log de errores");
                }
            }
        }
Exemplo n.º 10
0
        public void Guardar()
        {
            using (RentaCarContext db = new RentaCarContext())
            {
                db.AlquilerDetalle.Add(this);
                db.SaveChanges();
            }

            var v = RentaCarNewBll.Vehiculo.GetOne(this.IdVehiculo);
            v.IdEstado = EstadosVehiculo.ALQUILADO;
            v.Estado = null;
            v.Update();
        }
Exemplo n.º 11
0
        public void Update()
        {
            this.cliente = null;
            this.SucursalApertura = null;
            this.SucursalCierre = null;
            this.TipoPago = null;
            this.Estado = null;
            this.TipoFacturacion = null;
            this.UsuarioApertura = null;
            this.UsuarioCierre = null;
            this.AlquilerDetalle = null;

            using (RentaCarContext db = new RentaCarContext())
            {
                db.Alquileres.Attach(this);
                db.Entry(this).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }
        }
Exemplo n.º 12
0
 public void GuardarAlquiler()
 {
     using (RentaCarContext db = new RentaCarContext())
     {
         db.Alquileres.Add(this);
         db.SaveChanges();
     }
 }
Exemplo n.º 13
0
 private void Insert()
 {
     using (RentaCarContext db = new RentaCarContext())
     {
         db.Fotos.Add(this);
         db.SaveChanges();
     }
 }
Exemplo n.º 14
0
 public void Update()
 {
     this.Estado = null;
     this.Sucursal = null;
     using (RentaCarContext db = new RentaCarContext())
     {
         db.Vehiculos.Attach(this);
         db.Entry(this).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 15
0
 public void Update()
 {
     using (RentaCarContext db = new RentaCarContext())
     {
         db.SaveChanges();
     }
 }
Exemplo n.º 16
0
 public void GuardarCotizacion()
 {
     using (RentaCarContext db = new RentaCarContext())
     {
         db.Cotizaciones.Add(this);
         db.SaveChanges();
     }
 }
Exemplo n.º 17
0
 public void Update()
 {
     this.Vehiculo = null;
     this.cliente = null;
     using (RentaCarContext db = new RentaCarContext())
     {
         db.Cotizaciones.Attach(this);
         db.Entry(this).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 18
0
        public void Reemplazar()
        {
            this.Vehiculo = null;
            this.Alquiler = null;
            this.Estado = AlquilerDetalle.EstadoReemplazado;
            using (RentaCarContext db = new RentaCarContext())
            {
                db.AlquilerDetalle.Attach(this);
                db.Entry(this).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }

            var v = RentaCarNewBll.Vehiculo.GetOne(this.IdVehiculo);
            v.IdEstado = EstadosVehiculo.DISPONIBLE;
            v.Estado = null;
            v.Update();
        }
Exemplo n.º 19
0
        public static void Eliminar(int id)
        {
            using (RentaCarContext db = new RentaCarContext())
            {
                var f = db.Facturas.Find(id);

                db.Facturas.Remove(f);
                db.SaveChanges();
            }
        }
Exemplo n.º 20
0
 public void Update()
 {
     this.Vehiculo = null;
     this.Alquiler = null;
     using (RentaCarContext db = new RentaCarContext())
     {
         db.AlquilerDetalle.Attach(this);
         db.Entry(this).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }