Beispiel #1
0
        public static void AgregarServicios(string descripcion, int monto)
        {
            Servicios se = new Servicios();

            se.Descripción = descripcion;
            se.Monto       = monto;

            try
            {
                using (var s = new LavacContext()) {
                    s.Servicios.Add(se);
                    s.SaveChanges();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #2
0
        public static void asociarVehiculoServicio(int idServicio, int idVehiculo)
        {
            Vehiculo_Servicio vs = new Vehiculo_Servicio();

            vs.ID_Servicio = idServicio;
            vs.ID_Vehiculo = idVehiculo;

            try
            {
                using (var s = new LavacContext())
                {
                    s.Vehiculo_Servicio.Add(vs);
                    s.SaveChanges();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #3
0
        public static void AgregarVehiculo(Carro carro)
        {
            Vehiculo vehiculo = new Vehiculo();

            vehiculo.Placa = carro.placa;
            vehiculo.Dueño = carro.dueño;
            vehiculo.Marca = carro.marca;

            try
            {
                using (var s = new LavacContext())
                {
                    s.Vehiculo.Add(vehiculo);
                    s.SaveChanges();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }