Exemple #1
0
 private void btnSec_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(tbMachineName.Text))
     {
         Console.WriteLine("tbMachineName.text : " + tbMachineName.Text);
         Machine  machine  = _machineService.GetByName(tbMachineName.Text);
         AnaSayfa anaSayfa = new AnaSayfa {
             Machine = machine
         };
         panelMain.Controls.Clear();
         panelMain.Controls.Add(anaSayfa);
         anaSayfa.Show();
         anaSayfa.Dock = DockStyle.Fill;
         anaSayfa.BringToFront();
     }
     else
     {
         MessageBox.Show("Lütfen Listeden Bir Makine Seçiniz");
     }
 }
Exemple #2
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(tbStopCode.Text))
            {
                Log log = new Log();
                log = _logService.GetLast(Machine.Ip, _raspiDb, _raspiTable);
                TimeSpan time = DateTime.Now - log.Date;
                string   exp  = "";
                int      id;

                if (!string.IsNullOrWhiteSpace(rtbExp.Text))
                {
                    exp = rtbExp.Text;
                }
                StopReason sr = new StopReason
                {
                    Start  = log.Date,
                    Finish = DateTime.Now,
                    Time   = time,
                    Reason = Int32.Parse(tbStopCode.Text.ToString())
                };


                AnaSayfa anaSayfa = new AnaSayfa
                {
                    Machine    = Machine,
                    StopMinute = 35
                };
                timer.Enabled = false;
                timer.Stop();
                panelMain.Controls.Clear();
                panelMain.Controls.Add(anaSayfa);
                anaSayfa.Show();
                anaSayfa.Dock = DockStyle.Fill;
                anaSayfa.BringToFront();
            }
        }