Esempio n. 1
0
        private async Task onLoad(int?id, int?Did)
        {
            Department = await _context.Department.ToListAsync();

            Employee = await _context.Employee
                       .Include(e => e.Company)
                       .Include(e => e.Department)
                       .Include(e => e.EmployeeType)
                       .Include(e => e.Location)
                       .Include(e => e.Position).FirstOrDefaultAsync(m => m.EmployeeID == id);

            OT = await _context.OT.FirstOrDefaultAsync(m => m.OTID == Did);

            DetailOT = await _context.DetailOT
                       .Include(d => d.Employee)
                       .Include(d => d.FoodSet)
                       .Include(d => d.OT)
                       .Include(d => d.Part).ToListAsync();

            DetailOT = DetailOT.Where(d => d.OT_OTID == Did && d.Status.Equals("Allow")).ToList();
            Part     = await _context.Part.ToListAsync();

            FoodSet = await _context.FoodSet.ToListAsync();

            CarType = await _context.CarType.ToListAsync();



            CarType = CarType.OrderByDescending(o => o.Seat).ToList();
        }
Esempio n. 2
0
 private async Task onLoad(int? Did)
 {
     Department = await _context.Department.ToListAsync();
     Employee = HttpContext.Session.GetLogin(_context.Employee);
     OT = await _context.OT.FirstOrDefaultAsync(m => m.OTID == Did);
     DetailOT = await _context.DetailOT
         .Include(d => d.Employee)
         .Include(d => d.EmployeeAdd)
         .Include(d => d.FoodSet)
         .Include(d => d.OT)
         .Include(d => d.Point.Part).Where(d => d.OT_OTID == Did && d.Status.Equals("Allow")).ToListAsync();
     Part = await _context.Part.Where(a=> !a.Name.Equals("No")).ToListAsync();
     FoodSet =await _context.FoodSet.Where(a => !a.NameSet.Equals("No")).ToListAsync();
     CarType = await _context.CarType.Include(e => e.CompanyCar.Company).Where(e =>e.CompanyCar.CompanyCarID == Employee.Company_CompanyID && e.CompanyCar.Status.Equals("Open") && e.Status.Equals("Open")).ToListAsync();
     CarType = CarType.OrderByDescending(o => o.Seat).ToList();
 }
        private async Task onLoad(int?id, int?Did)
        {
            Department = await _context.Department.ToListAsync();

            Employee = await _context.Employee
                       .Include(e => e.Company)
                       .Include(e => e.Department)
                       .Include(e => e.EmployeeType)
                       .Include(e => e.Location)
                       .Include(e => e.Position).FirstOrDefaultAsync(m => m.EmployeeID == id);

            OT = await _context.OT.FirstOrDefaultAsync(m => m.OTID == Did);

            DetailOT = await _context.DetailOT
                       .Include(d => d.Employee)
                       .Include(d => d.FoodSet)
                       .Include(d => d.OT)
                       .Include(d => d.Part).ToListAsync();

            Part = await _context.Part.ToListAsync();

            FoodSet = await _context.FoodSet.ToListAsync();

            CarType = await _context.CarType.ToListAsync();

            CarType        = CarType.OrderByDescending(o => o.Seat).ToList();
            DetailCarQueue = await _context.DetailCarQueue
                             .Include(e => e.CarQueue)
                             .Include(e => e.Employee)
                             .Where(c => c.CarQueue.CarQueue_OTID == Did).ToListAsync();

            CarQueue = await _context.CarQueue
                       .Include(e => e.OT)
                       .Include(e => e.Part)
                       .Include(e => e.CarType)
                       .Where(c => c.CarQueue_OTID == Did).ToListAsync();

            OTs        = ListOTDetail(Did);
            Depasments = OTDetailOTList();
            timelist   = massCarQ();
            food       = foodMass();
        }
Esempio n. 4
0
        private async Task onLoad(int?Did)
        {
            Department = await _context.Department.ToListAsync();

            Employee = HttpContext.Session.GetLogin(_context.Employee);
            OT       = await _context.OT.FirstOrDefaultAsync(m => m.OTID == Did);

            DetailOT = await _context.DetailOT
                       .Include(d => d.Employee)
                       .Include(d => d.FoodSet)
                       .Include(d => d.OT)
                       .Include(d => d.Point.Part).Where(a => a.OT_OTID == Did).ToListAsync();

            Part = await _context.Part.Where(a => !a.Name.Equals("No")).ToListAsync();

            FoodSet = await _context.FoodSet.Where(a => !a.NameSet.Equals("No")).ToListAsync();

            CarType = await _context.CarType.ToListAsync();

            CarType        = CarType.OrderByDescending(o => o.Seat).ToList();
            DetailCarQueue = await _context.DetailCarQueue
                             .Include(e => e.CarQueue)
                             .Include(e => e.Employee)
                             .Where(c => c.CarQueue.CarQueue_OTID == Did).ToListAsync();

            CarQueue = await _context.CarQueue
                       .Include(e => e.OT)
                       .Include(e => e.Part)
                       .Include(e => e.CarType)
                       .Where(c => c.CarQueue_OTID == Did).ToListAsync();

            OTs        = ListOTDetail(Did);
            Depasments = OTDetailOTList();
            timelist   = massCarQ();
            food       = foodMass();
            LineToken  = await _context.LineToken
                         .Include(l => l.Company).FirstOrDefaultAsync(e => e.Company_CompanyID == Employee.Company_CompanyID);

            ViewData["Company_CompanyID"] = new SelectList(_context.Company, "CompanyID", "CompanyName");
        }