Example #1
0
        public void Remove(int id)
        {
            ProductionHistory p = _context.ProductionHistory.Find(id);

            _context.ProductionHistory.Remove(p);
            _context.SaveChanges();
        }
Example #2
0
 public ProductionHistoryDto(ProductionHistory item)
 {
     ProductionHistoryId = item.ProductionHistoryId;
     EmployeeId          = item.EmployeeId;
     DepartmentId        = item.DepartamentoId;
     Date           = item.Date;
     EmployeeName   = item.Employee.EmployeeName;
     DepartmentName = item.Department.DepartmentName;
 }
Example #3
0
        static void Main(string[] args)
        {
            history = new ProductionHistory();

            var LOGHOST = Environment.GetEnvironmentVariable("loghost");
            //Start the log collector, this strats a thread the feeds logs into the quete to be processed.
            //LogsFromWebsocket logSource = new LogsFromWebsocket("ws://pennstation.eosdocs.io:8001/");
            LogsFromWebsocket logSource = new LogsFromWebsocket(LOGHOST);

            logSource.start();

            //Then start a thread that pulls log items from the queue and feeds them into the production history.
            Thread thread = new Thread(new ThreadStart(WorkThreadFunction));

            thread.Start();
            logQ = LogsFromWebsocket.logQ;

            Console.ReadLine();
        }
        public async Task <ProductionHistoryDto> AddAsync(ProductionHistoryDto item)
        {
            var depto = _contex.Department.First(q => q.DepartmentId == item.DepartmentId);
            var empl  = _contex.Employee.First(q => q.EmployeeId == item.EmployeeId);

            var newph = new ProductionHistory
            {
                ProductionHistoryId = item.ProductionHistoryId,
                EmployeeId          = item.EmployeeId,
                DepartamentoId      = item.DepartmentId,
                Date       = item.Date,
                Employee   = empl,
                Department = depto
            };

            _contex.ProductionHistory.Add(newph);
            await _contex.SaveChangesAsync();

            return(item);
        }
Example #5
0
 public void Edit(ProductionHistory production)
 {
     _context.Entry(production).State = EntityState.Modified;
 }
Example #6
0
 public void Add(ProductionHistory production)
 {
     _context.ProductionHistory.Add(production);
     _context.SaveChanges();
 }