Beispiel #1
0
        public ModelBase(IServiceProvider serviceProvider)
        {
            DbContextOptions <DbContext> options;
            var builder = new DbContextOptionsBuilder <DbContext>();

            builder.UseSqlServer(Guid.NewGuid().ToString());
            options = builder.Options;

            _context = new MyComercioContext(options);
        }
Beispiel #2
0
        public Pais GetPais()
        {
            Pais pais;

            using (var context = new MyComercioContext())
            {
                pais = context.Pais.Where(x => x.Id == IdPais).FirstOrDefault();
            }

            return(pais);
        }
Beispiel #3
0
        public CategoriaProducto GetCategoria()
        {
            CategoriaProducto categoria;

            using (MyComercioContext context = new MyComercioContext())
            {
                categoria = context.CategoriaProducto.Where(x => x.Id == IdCategoriaProducto).FirstOrDefault();
            }

            return(categoria);
        }
        public Ciudad GetCiudad()
        {
            Ciudad ciudad;

            using (var context = new MyComercioContext())
            {
                ciudad = context.Ciudad.Where(x => x.Id == IdCiudad).FirstOrDefault();
            }

            return(ciudad);
        }
        public override bool IsValid(object value)
        {
            Pais pais;

            using (var context = new MyComercioContext())
            {
                pais = context.Pais.Where(x => x.Description.Trim().ToUpper() == value.ToString().Trim().ToUpper()).FirstOrDefault();
            }

            var ret = (pais == null);

            return(ret);
        }
Beispiel #6
0
 public CiudadController(MyComercioContext context)
 {
     _context = context;
 }
Beispiel #7
0
 public VentaDetallesController(MyComercioContext context)
 {
     _context = context;
 }
Beispiel #8
0
 public VentasVMController(MyComercioContext context)
 {
     _context = context;
 }
Beispiel #9
0
 public MarcasController(MyComercioContext context)
 {
     _context = context;
 }
Beispiel #10
0
 public PersonasController(MyComercioContext context)
 {
     _context = context;
 }
Beispiel #11
0
 public ProductosController(MyComercioContext context, IWebHostEnvironment hostEnvironment)
 {
     _context         = context;
     _hostEnvironment = hostEnvironment;
 }
 public ProductoController(MyComercioContext context)
 {
     _context = context;
 }
Beispiel #13
0
 public Ciudad(MyComercioContext context)
 {
     _context = context;
 }
Beispiel #14
0
 public PaisController(MyComercioContext context)
 {
     _context = context;
 }
 public ClientesController(MyComercioContext context)
 {
     _context = context;
 }
Beispiel #16
0
 public CategoriaProductoesController(MyComercioContext context)
 {
     _context = context;
 }
 public VendedorsController(MyComercioContext context)
 {
     _context = context;
 }