Esempio n. 1
0
        /// <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();

        }
Esempio n. 2
0
 /// <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();
 }
Esempio n. 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public List<Line_status> GetLineStatuses()
 {
     var context = new QUANLYSANXUATEntities();
     
         return context.Line_status.OrderByDescending(c => c.Id_Line).ToList();
     
 }
Esempio n. 4
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public List<Model> GetModels()
        {
            var context = new QUANLYSANXUATEntities();

            return context.Models.OrderByDescending(c => c.Id_model).ToList();

        }
Esempio n. 5
0
        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();

        } 
Esempio n. 6
0
        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();

        } 
Esempio n. 7
0
        /// <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;
        } 
Esempio n. 8
0
        //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;
            }

        }
Esempio n. 9
0
 public ShiftService()
 {
     _context = new QUANLYSANXUATEntities();
 }
Esempio n. 10
0
 public Timing GetTimeByID(int id)
 {
     var context = new QUANLYSANXUATEntities();
     return context.Timings.FirstOrDefault(u => u.Id_time_test == id);
 }
Esempio n. 11
0
 /// <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();
 }
Esempio n. 12
0
 public ProcessService()
 {
     _context = new QUANLYSANXUATEntities();
 }
Esempio n. 13
0
 public ModelService()
 {
     _context = new QUANLYSANXUATEntities();
 }
Esempio n. 14
0
 public LineService()
 {
     _context = new QUANLYSANXUATEntities();
 }