public void Deletetongs_entity(List <int> ids) { using (var dbContext = new ToolManageDbContext()) { dbContext.tongs_entitys.Where(u => ids.Contains(u.ID)).Delete(); } }
public tongs_entity Gettongs_entity(int id) { using (var dbContext = new ToolManageDbContext()) { return(dbContext.tongs_entitys.Where(u => u.ID == id).SingleOrDefault()); } }
public FullLifeModel GetFullLife(int id, FullLifeIndex pageIndex) { var res = new FullLifeModel { Details = Gettongs_entity(id) }; var ToolManagedbContext = new ToolManageDbContext(); var AuditdbContext = new AuditDbContext(); IQueryable <InTable> InTables = ToolManagedbContext.InTables; IQueryable <OutTable> OutTables = ToolManagedbContext.OutTables; IQueryable <Warehouse> WarehouseTables = AuditdbContext.Warehouses; IQueryable <Scrap> ScrapTables = AuditdbContext.Scraps; IQueryable <RepairTable> RepairTables = ToolManagedbContext.RepairTables; InTables = InTables.Where(u => u.Code.Contains(res.Details.Code)); InTables = InTables.Where(u => u.SeqID == res.Details.SeqID); OutTables = OutTables.Where(u => u.Code.Contains(res.Details.Code)); OutTables = OutTables.Where(u => u.SeqID == res.Details.SeqID); WarehouseTables = WarehouseTables.Where(u => u.Code.Contains(res.Details.Code)); WarehouseTables = WarehouseTables.Where(u => u.SeqID == res.Details.SeqID); ScrapTables = ScrapTables.Where(u => u.Code.Contains(res.Details.Code)); ScrapTables = ScrapTables.Where(u => u.SeqID == res.Details.SeqID); RepairTables = RepairTables.Where(u => u.Code.Contains(res.Details.Code)); RepairTables = RepairTables.Where(u => u.SeqID == res.Details.SeqID); res.InDetails = InTables.OrderByDescending(u => u.ID).ToPagedList(pageIndex.pageIndex1, 12); res.OutDetails = OutTables.OrderByDescending(u => u.ID).ToPagedList(pageIndex.pageIndex2, 12); res.WarehouseDetails = WarehouseTables.OrderByDescending(u => u.ID).ToPagedList(pageIndex.pageIndex3, 12); res.ScrapDetails = ScrapTables.OrderByDescending(u => u.ID).ToPagedList(pageIndex.pageIndex4, 12); res.RepairDetails = RepairTables.OrderByDescending(u => u.ID).ToPagedList(pageIndex.pageIndex5, 12); return(res); }
public void DeleteRepairTable(List <int> ids) { using (var dbContext = new ToolManageDbContext()) { dbContext.RepairTables.Where(u => ids.Contains(u.ID)).Delete(); } }
public RepairTable GetRepairTable(int id) { using (var dbContext = new ToolManageDbContext()) { return(dbContext.RepairTables.Where(u => u.ID == id).SingleOrDefault()); } }
public IEnumerable <tongs_entity> Gettongs_entityList(tongs_entityRequest request = null) { request = request ?? new tongs_entityRequest(); using (var dbContext = new ToolManageDbContext()) { IQueryable <tongs_entity> tongs_entitys = dbContext.tongs_entitys; if (request != null) { if (!string.IsNullOrEmpty(request.Code)) { tongs_entitys = tongs_entitys.Where(u => u.Code.Contains(request.Code)); } if (request.SeqID != 0) { tongs_entitys = tongs_entitys.Where(u => u.SeqID == request.SeqID); } if (!string.IsNullOrEmpty(request.State)) { tongs_entitys = tongs_entitys.Where(u => u.State.Contains(request.State)); } if (request.Workcell != 0) { tongs_entitys = tongs_entitys.Where(u => u.Workcell == request.Workcell); } } return(tongs_entitys.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize)); } }
public void Savetongs_entity(tongs_entity Data) { using (var dbContext = new ToolManageDbContext()) { if (Data.ID > 0) { dbContext.Update <tongs_entity>(Data); } else { dbContext.Insert <tongs_entity>(Data); } } }
public void SaveRepairTable(RepairTable Data) { using (var dbContext = new ToolManageDbContext()) { if (Data.ID > 0) { dbContext.Update <RepairTable>(Data); } else { dbContext.Insert <RepairTable>(Data); } } }
public IEnumerable <InTable> GetInTableList(InTableRequest request = null) { request = request ?? new InTableRequest(); using (var dbContext = new ToolManageDbContext()) { IQueryable <InTable> InTables = dbContext.InTables; if (request != null) { if (!string.IsNullOrEmpty(request.Code)) { InTables = InTables.Where(u => u.Code.Contains(request.Code)); } if (request.SeqID != 0) { InTables = InTables.Where(u => u.SeqID == request.SeqID); } if (request.Workcell != 0) { InTables = InTables.Where(u => u.Workcell == request.Workcell); } } return(InTables.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize)); } }