public static ProductEntity ProductByid(string id) { using (var db = new InventarioContext()) { return(db.Products.Where(p => p.ProductId == id).FirstOrDefault()); } }
public static bool IsProductInWarehouse(string StorageId) { using (var db = new InventarioContext()) { return(db.Storages.Where(s => s.StorageId == StorageId).Any()); } }
public static List <StorageEntity> ItemList() { using (var db = new InventarioContext()) { return(db.Storages.ToList()); } }
public static List <WarehouseEntity> WarehouseList() { using (var db = new InventarioContext()) { return(db.Warehouses.ToList()); } }
public static List <CategoryEntity> ItemList() { using (var db = new InventarioContext()) { return(db.Categories.ToList()); } }
public static CategoryEntity GetItemById(string ItemId) { using (var db = new InventarioContext()) { return(db.Categories.Find(ItemId)); } }
public static ProductEntity GetById(string ItemId) { using (var db = new InventarioContext()) { return(db.Products.Find(ItemId)); } }
public static List <ProductEntity> ProductList() { using (var db = new InventarioContext()) { return(db.Products.ToList()); } }
public static CategoryEntity CategoryById(string ID) { using (var db = new InventarioContext()) { return(db.Categories.Where(c => c.CategoryId == ID).FirstOrDefault()); } }
public List <InputOutputEntity> ItemList() { using (var db = new InventarioContext()) { return(db.InOuts.ToList()); } }
public static WarehouseEntity WarehouseById(string ID) { using (var db = new InventarioContext()) { return(db.Warehouses.Where(w => w.WarehouseId == ID).FirstOrDefault()); } }
public static void UpdateCategory(CategoryEntity oCategory) { using (var db = new InventarioContext()) { db.Categories.Update(oCategory); db.SaveChanges(); } }
public static void UpdateStorage(StorageEntity oStorage) { using (var db = new InventarioContext()) { db.Storages.Update(oStorage); db.SaveChanges(); } }
public static void DeleteItem(CategoryEntity item) { using (var db = new InventarioContext()) { db.Categories.Remove(item); db.SaveChanges(); } }
public static void DeleteItem(WarehouseEntity item) { using (var db = new InventarioContext()) { db.WarehouseEntities.Remove(item); db.SaveChanges(); } }
public void CreateInputOutput(InputOutputEntity oInputOutput) { using (var db = new InventarioContext()) { db.InOuts.Add(oInputOutput); db.SaveChanges(); } }
public static void DeleteItem(ProductEntity item) { using (var db = new InventarioContext()) { db.Products.Remove(item); db.SaveChanges(); } }
public static void UpdateWarehouse(WarehouseEntity oWarehouse) { using (var db = new InventarioContext()) { db.Warehouses.Update(oWarehouse); db.SaveChanges(); } }
public static void UpdateProduct(ProductEntity oProduct) { using (var db = new InventarioContext()) { db.Products.Update(oProduct); db.SaveChanges(); } }
public void UpdateItem(InputOutputEntity item) { using (var db = new InventarioContext()) { db.InOuts.Update(item); db.SaveChanges(); } }
public static void UpdateItem(StorageEntity item) { using (var db = new InventarioContext()) { db.Storages.Update(item); db.SaveChanges(); } }
public static List <StorageEntity> StorageProductByWarehouse(string ID) { using (var db = new InventarioContext()) { return(db.Storages .Include(s => s.Product) .Include(b => b.Warehouse) .Where(s => s.WarehouseId == ID).ToList()); } }
public static bool IsProductInWarehouse(string IdStorage) { using (var b = new InventarioContext()) { var product = b.Storages.ToList() .Where(s => s.StorageId == IdStorage); return(product.Any()); } }
public static List <StorageEntity> GetStorageProductByWarehouse(string idWarehouse) { using (var db = new InventarioContext()) { return(db.Storages .Where(s => s.WarehouseId == idWarehouse) .Include(s => s.Product) //Entity Framework core .Include(s => s.Warehouse) .ToList()); } }
// GET: IngresoVarios public ActionResult Index(string currentFilter, string searchString, int pagina = 1) { ViewBag.SearchString = searchString; if (searchString != null) { pagina = 1; } else { searchString = currentFilter; } ViewBag.CurrentFilter = searchString; var iNGRESOVARIOS = db.INGRESOVARIOS.Include(i => i.ARTICULO).Include(i => i.PERSONA).Include(i => i.SEDE); if (!String.IsNullOrEmpty(searchString)) { iNGRESOVARIOS = iNGRESOVARIOS.Where(s => s.CODIGOINTERNO.ToUpper().Contains(searchString.ToUpper()) || s.ARTICULO.ARTICULO1.ToUpper().Contains(searchString.ToUpper()) || s.MARCA.ToUpper().Contains(searchString.ToUpper()) || s.MODELO.ToUpper().Contains(searchString.ToUpper()) || s.PERSONA.NOMBRE1.ToUpper().Contains(searchString.ToUpper()) || s.PERSONA.APELLIDO1.ToUpper().Contains(searchString.ToUpper()) || s.SEDE.DESCRIPCION.ToUpper().Contains(searchString.ToUpper())); } var cantidadRegistrosPorPagina = 10; using (var db = new InventarioContext()) { var IngresoVarios = iNGRESOVARIOS.OrderBy(x => x.SECUENCIAL) .Skip((pagina - 1) * cantidadRegistrosPorPagina) .Take(cantidadRegistrosPorPagina).ToList(); var totalDeRegistros = iNGRESOVARIOS.Count(); var modelo = new IndexViewModel(); modelo.ingresoVarios = IngresoVarios; modelo.PaginaActual = pagina; modelo.TotalDeRegistros = totalDeRegistros; modelo.RegistrosPorPagina = cantidadRegistrosPorPagina; return(View(modelo)); } //return View(iNGRESOVARIOS.ToList()); }
public void Setup() { var optionsSqlite = new DbContextOptionsBuilder <InventarioContext>() .UseInMemoryDatabase(@"InventarioInmemory") .Options; _dbContext = new InventarioContext(optionsSqlite); _dbContext.Database.EnsureDeleted(); _dbContext.Database.EnsureCreated(); _productoRepository = new ProductoRepository(_dbContext); _registrarSalidaProductoService = new RegistrarSalidaProductoService( new UnitOfWork(_dbContext), _productoRepository ); }
public void Setup() { var optionsSqlite = new DbContextOptionsBuilder <InventarioContext>() .UseSqlite(@"Data Source=C:\\sqlite\\InventarioDBTest.db") .Options; _dbContext = new InventarioContext(optionsSqlite); _dbContext.Database.EnsureDeleted(); _dbContext.Database.EnsureCreated(); _productoRepository = new ProductoRepository(_dbContext); _registrarSalidaProductoService = new RegistrarSalidaProductoService( new UnitOfWork(_dbContext), _productoRepository ); }
public void Setup() { var optionsSqlite = new DbContextOptionsBuilder <InventarioContext>() .UseSqlite(SqlLiteDatabaseInMemory.CreateConnection()) .Options; _dbContext = new InventarioContext(optionsSqlite); _dbContext.Database.EnsureDeleted(); _dbContext.Database.EnsureCreated(); _productoRepository = new ProductoRepository(_dbContext); var mockEmailServer = new Mock <IMailServer>(); _registrarEntadaProductoService = new RegistrarEntradaProductoService( new UnitOfWork(_dbContext), _productoRepository ); }
// GET: AsignacionComputadores public ActionResult Index(string currentFilter, string searchString, int pagina = 1) { ViewBag.SearchString = searchString; if (searchString != null) { pagina = 1; } else { searchString = currentFilter; } ViewBag.CurrentFilter = searchString; var aSIGNACIONCOMPUTADORES = db.ASIGNACIONCOMPUTADORES.Include(a => a.INGRESOCOMPUTADORES).Include(a => a.PERSONA).Include(a => a.SEDE); if (!String.IsNullOrEmpty(searchString)) { aSIGNACIONCOMPUTADORES = aSIGNACIONCOMPUTADORES.Where(s => s.INGRESOCOMPUTADORES.CODIGOINTERNO.ToUpper().Contains(searchString.ToUpper()) || s.PERSONA.NOMBRE1.ToUpper().Contains(searchString.ToUpper()) || s.PERSONA.APELLIDO1.ToUpper().Contains(searchString.ToUpper()) || s.SEDE.DESCRIPCION.ToUpper().Contains(searchString.ToUpper())); } var cantidadRegistrosPorPagina = 10; using (var db = new InventarioContext()) { var AsignacionComputador = aSIGNACIONCOMPUTADORES.OrderBy(x => x.SECUENCIAL) .Skip((pagina - 1) * cantidadRegistrosPorPagina) .Take(cantidadRegistrosPorPagina).ToList(); var totalDeRegistros = aSIGNACIONCOMPUTADORES.Count(); var modelo = new IndexViewModel(); modelo.asignacionComputador = AsignacionComputador; modelo.PaginaActual = pagina; modelo.TotalDeRegistros = totalDeRegistros; modelo.RegistrosPorPagina = cantidadRegistrosPorPagina; return(View(modelo)); } //return View(aSIGNACIONCOMPUTADORES.ToList()); }
// GET: asignacionVarios public ActionResult Index(int pagina = 1) { var cantidadRegistrosPorPagina = 10; // parĂ¡metro using (var db = new InventarioContext()) { var AsignacionVario = db.asignacionVarios.OrderBy(x => x.SECUENCIAL) .Skip((pagina - 1) * cantidadRegistrosPorPagina) .Take(cantidadRegistrosPorPagina).ToList(); var totalDeRegistros = db.asignacionVarios.Count(); var modelo = new IndexViewModel(); modelo.asignacionVario = AsignacionVario; modelo.PaginaActual = pagina; modelo.TotalDeRegistros = totalDeRegistros; modelo.RegistrosPorPagina = cantidadRegistrosPorPagina; return(View(modelo)); } //return View(db.asignacionVarios.ToList()); }
public InventarioRepositorio() { _context = new InventarioContext(); }