private void MakeNewTimeStamp()
        {
            log = new TimeLog();
            QueryManager qMgr = new QueryManager();

            log.DeviceID   = this.DeviceID;
            log.DeviceName = this.DeviceName;
            log.UserName   = this.UserName;
            log.DateUsed   = this.DateUsed;
            log.TimeOn     = this.TimeOn.ToShortTimeString();
            log.TimeOff    = this.TimeOff.ToShortTimeString();
            log.TimeUsed   = this.TimeUsed;

            qMgr.InsertRow("TimeLog", log);

            MessageBox.Show(this.DeviceName + " used for : " + TimeUsed);
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                LogicalDevice new_Dev = new LogicalDevice();
                new_Dev.DeviceID          = comboBox1.SelectedItem.ToString();
                new_Dev.Devicename        = textBox2.Text.Replace(' ', '_');
                new_Dev.dateoflastservice = DateTime.Now.ToShortDateString();
                new_Dev.timeused          = "0";

                QueryManager qMgr = new QueryManager();

                qMgr.InsertRow("Instruments", new_Dev);
                MessageBox.Show("Device added:" + new_Dev.Devicename);
                OnNewDevAddedToReg();
            }
            catch (Exception)
            {
                MessageBox.Show("Please Select a Device From the List");
            }
        }