Пример #1
0
        private void SplitEkanbanDeviceHistories(EKanbanDevice eKanbanDevice)
        {
            HistoryFlow.Controls.Clear();
            SysHistoryQuery sysHistoryQuery = new SysHistoryQuery(_SERVER.ServerName.Database);
            var             ehis            = sysHistoryQuery.GetEKanbanHistories(eKanbanDevice.id);
            int             TotalQty        = 0;

            if (ehis != null)
            {
                int i = 0;
                foreach (var item in ehis)
                {
                    EkanbanHisControl ekanbanHisControl = new EkanbanHisControl(item, eKanbanDevice, _SERVER.ServerName.Database);

                    HistoryFlow.Controls.Add(ekanbanHisControl);
                    if (!ekanbanHisControl.ErrorHis)
                    {
                        i++;
                        TotalQty += ekanbanHisControl.TotaPrepareQty;
                    }
                }
                lbTotalPrepare.Text    = i.ToString();
                lbTotalPrepareQty.Text = TotalQty.ToString();
            }
        }
Пример #2
0
 public EkanbanHisControl(EKanbanHis ekanbanHis, EKanbanDevice eKanbanDevice, IDbName _database)
 {
     InitializeComponent();
     EKanbanHis       = new EKanbanHis();
     EKanbanHis       = ekanbanHis;
     eKanbanTaskQuery = new EKanbanTaskQuery(_database);
     SysHistoryQuery  = new SysHistoryQuery(_database);
     lbCartName.Text  = eKanbanDevice.Name;
 }
Пример #3
0
 public bool AddNewEKanbanDevice(EKanbanDevice _ekanbanDevice)
 {
     try
     {
         using (EKanbanTaskContext = new EKanbanTaskContext(database))
         {
             EKanbanTaskContext.EKanbanDevices.Add(_ekanbanDevice);
             EKanbanTaskContext.SaveChanges();
         }
         return(true);
     }
     catch { return(false); }
 }
Пример #4
0
 public bool UpdateEKanbanDevice(EKanbanDevice _ekanbanDevice)
 {
     try
     {
         using (EKanbanTaskContext = new EKanbanTaskContext(database))
         {
             EKanbanTaskContext.Entry(_ekanbanDevice).State = EntityState.Modified;
             EKanbanTaskContext.SaveChanges();
         }
         return(true);
     }
     catch { return(false); }
 }
Пример #5
0
 public EKanbanHis GetLastEKanbanHistory(EKanbanDevice _ekanbanDevice)
 {
     try
     {
         using (HistoryContext = new HistoryContext(database))
         {
             return(HistoryContext.EKanbanHis
                    .Include("EKanbanAddHis")
                    .Include("EKanbanConfirmHis")
                    .Include("EKanbanClearHis")
                    .Where(i => i.EKanbanDevice_Id == _ekanbanDevice.id)
                    .First());
         }
     }
     catch { return(null); }
 }
Пример #6
0
        private void UpdateSelectedEkanbanDevice()
        {
            SelectedEKanbanDevice    = new EKanbanDevice();
            SelectedEKanbanInterface = new EKanbanInterface();

            if (lbEKanbanDevice.SelectedItem == null)
            {
                return;
            }

            SelectedEKanbanDevice = lbEKanbanDevice.SelectedItem as EKanbanDevice;

            SelectedEKanbanInterface = EKanbanTaskQuery.GetLastEKanbanInterface(SelectedEKanbanDevice.id);

            DS_EKBInterface.DataSource = new EKanbanInterface();
            if (SelectedEKanbanInterface != null)
            {
                lbStatus.Text = (SysActionCode)SelectedEKanbanInterface.SysActionCode == SysActionCode.EKANBAN_CONFIRM_ITEM ? "CONFORM OK" : "WAITING";
                DS_EKBInterface.DataSource = SelectedEKanbanInterface;
            }
        }
Пример #7
0
        public EkanbanItem(EKanbanDevice ekanbandevice)
        {
            InitializeComponent();

            EKanbanDevice    = ekanbandevice;
            lbName.Text      = EKanbanDevice.Name;
            Online.BackColor = Color.Red;

            if (ekanbandevice.LastOnline != null)
            {
                if ((DateTime.Now - (DateTime)ekanbandevice.LastOnline).TotalSeconds < 60)
                {
                    Online.BackColor = Color.Green;
                }
            }

            if (EKanbanDevice.ScreenOff == true)
            {
                ScreenOff.Checked = true;
            }
        }