Exemple #1
0
        //


        private void btnRecord_Click(object sender, EventArgs e)
        {
            if (lstHistory.SelectedIndex != -1)
            {
                dateTimePicker1.Value = DateTime.Now;
                txtRecords.Text       = string.Empty;

                dateTimePicker1.Enabled = true;
                txtRecords.Enabled      = true;

                lstHistory.SelectedIndex = -1;
            }



            if (txtRecords.Text == "")
            {
                MessageBox.Show("Enter records.", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtRecords.Focus();
                return;
            }

            if (dateTimePicker1.Text == "")
            {
                MessageBox.Show("Enter a Date.", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            else //All checks are satisfied
            {
                dateTimePicker1.Enabled = false;
                txtRecords.Enabled      = false;

                Base_Station_Records BaseStationRecord = new Base_Station_Records();

                BaseStationRecord.SetRecord(txtRecords.Text);
                BaseStationRecord.SetDate(dateTimePicker1.Value);

                BSR.AddItem(BaseStationRecord);

                lstHistory.SelectedIndex = lstHistory.Items.IndexOf(BaseStationRecord);

                SendStatusUpdate(true, "Record Saved!", "success");
            }
        }
Exemple #2
0
 public void AddBaseStationRecords(Base_Station_Records xBR)
 {
     BaseStationRecords.Add(xBR);
 }