/// <summary> /// /// </summary> /// <param name="timing"></param> public void Update(Timing timing) { var context = new QUANLYSANXUATEntities(); context.Timings.Attach(timing); context.Entry(timing).State = EntityState.Modified; context.SaveChanges(); }
public List <Lines_processes> GetLinesProcesseses(int lineId) { var context = new QUANLYSANXUATEntities(); return(context.Lines_processes.Where(l => l.Id_line == lineId) .OrderBy(c => c.Position_process_in_line) .ToList()); }
public List <Lines_processes> GetAllProcesseses(int lineId) { var context = new QUANLYSANXUATEntities(); return(context.Lines_processes.Include("Line") .Include("All_Processes") .Where(c => c.Id_line == lineId) .OrderBy(c => c.Position_process_in_line) .ToList()); }
/// <summary> /// /// </summary> /// <returns></returns> public List <ScheduleView> GetScheduleViews(int shift) { var context = new QUANLYSANXUATEntities(); var schedules = (from timing in context.Timings where timing.Id_sheet_production == shift select new ScheduleView() { StartTime = timing.StartTime.ToString(), EndTime = timing.EndTime.ToString(), Plan = (int)timing.SetPlan, QuantityCurrent = (int)timing.Products_current_hour, }).ToList(); return(schedules); }
//public int SumPassByTime(string reportId, int startHour, int startMinute, int endHour, int endMinute) //{ // var start = new TimeSpan(startHour, startMinute, 0); // var end = new TimeSpan(endHour, endMinute, 0); // var reportDetail = GetShowResults() // .Where(c => c.ReportID == reportId) // .Where(c => c.Date_check.ToShortDateString() == DateTime.Now.ToShortDateString()) // .Where(c => c.Time_check >= start && c.Time_check <= end) // .Sum(c => c.count_actual_pcb); // if (reportDetail != null) // return (int)reportDetail; // return 0; //} public int ActualByTime(string reportId, int startHour, int startSecond, int startMinute, int endHour, int endMinute, int endSecond) { var start = new TimeSpan(startHour, startMinute, startSecond); var end = new TimeSpan(endHour, endMinute, endSecond); using (var context = new QUANLYSANXUATEntities()) { //var report = context.IndicateReports // .Where(c => c.ReportID == reportId) // .Where(c => c.DateRerport.ToShortDateString() == DateTime.Now.ToShortDateString()).FirstOrDefault(c => c.DateRerport.TimeOfDay >= start && c.DateRerport.TimeOfDay <= end); //if (report != null) //{ // int pass = report.Pass; // return pass; //} return(0); } }
public ProcessService() { _context = new QUANLYSANXUATEntities(); }
public Timing GetTimeByID(int id) { var context = new QUANLYSANXUATEntities(); return(context.Timings.FirstOrDefault(u => u.Id_time_test == id)); }
/// <summary> /// Danh sách time /// </summary> /// <param name="shift"></param> /// <returns></returns> public List <Timing> GetTimings(int shift) { var context = new QUANLYSANXUATEntities(); return(context.Timings.Where(t => t.Id_sheet_production == shift).ToList()); }
/// <summary> /// /// </summary> /// <returns></returns> public List <Customer> GetCustomers() { var context = new QUANLYSANXUATEntities(); return(context.Customers.ToList()); }
public CustomerService() { _context = new QUANLYSANXUATEntities(); }
public ShiftService() { _context = new QUANLYSANXUATEntities(); }
/// <summary> /// Get all /// </summary> /// <returns></returns> public List <Show_Result> GetShowResults() { var context = new QUANLYSANXUATEntities(); return(context.Show_Result.OrderBy(c => c.Id_process).ToList()); }
/// <summary> /// /// </summary> /// <returns></returns> public List <Line_status> GetLineStatuses() { var context = new QUANLYSANXUATEntities(); return(context.Line_status.OrderByDescending(c => c.Id_Line).ToList()); }
/// <summary> /// /// </summary> /// <returns></returns> public List <Model> GetModels() { var context = new QUANLYSANXUATEntities(); return(context.Models.OrderByDescending(c => c.Id_model).ToList()); }
public ModelService() { _context = new QUANLYSANXUATEntities(); }
public LineService() { _context = new QUANLYSANXUATEntities(); }