예제 #1
0
        public void SetRecord(CallRecord record)
        {
            _isLoading     = true;
            _record        = record;
            panel1.Enabled = _reminderCheckBox.Checked = !_record.WasNotified;

            int dayValue  = (int)(_record.NotifyDate.Date.Subtract(_record.DueDate.Date)).TotalDays;
            int timeValue = (int)_record.NotifyDate.TimeOfDay.TotalMinutes;

            foreach (KVP <string, int> item in _reminderDayComboBox.Items)
            {
                if (item.Value == dayValue)
                {
                    _reminderDayComboBox.SelectedItem = item;
                    break;
                }
            }
            foreach (KVP <string, int> item in _reminderTimeComboBox.Items)
            {
                if (item.Value == timeValue)
                {
                    _reminderTimeComboBox.SelectedItem = item;
                    break;
                }
            }
            _isLoading = false;
        }
예제 #2
0
 void _contactViewCardMenuItem_Click(object sender, System.EventArgs e)
 {
     if (this._contactListBox.SelectedIndex >= 0 && this._contactListBox.SelectedIndex < this._contactListBox.FilteredItems.Count)
     {
         CallRecord record = this._contactListBox.FilteredItems[this._contactListBox.SelectedIndex];
         record.Contact.ShowDialog();
     }
 }
예제 #3
0
        void _contactCompleteMenuItem_Click(object sender, System.EventArgs e)
        {
            if (this._contactListBox.SelectedIndex >= 0 && this._contactListBox.SelectedIndex < this._contactListBox.FilteredItems.Count)
            {
                CallRecord record = this._contactListBox.FilteredItems[this._contactListBox.SelectedIndex];
                record.IsActive = false;

                SetFilter();
            }
        }
예제 #4
0
 public void ShowDetails(CallRecord record, bool newRecord)
 {
     Cursor.Current = Cursors.WaitCursor;
     using (DetailsView details = new DetailsView())
     {
         details.ShowDialog(record, newRecord);
         SetFilter();
     }
     Cursor.Current = Cursors.Default;
 }
예제 #5
0
        public DialogResult ShowDialog(CallRecord record)
        {
            timer1.Enabled = true;
            _callRecord    = record;

            if (DateTime.Now > record.DueDate)
            {
                this._dueLabel.Text = "Overdue";
            }
            else
            {
                string dueDate = string.Empty;

                if (record.DueDate.Date == DateTime.Now.Date)
                {
                    dueDate = "Today";
                }
                else if (record.DueDate.Date == DateTime.Now.AddDays(1).Date)
                {
                    dueDate = "Tomorrow";
                }
                else
                {
                    dueDate = record.DueDate.ToShortDateString();
                }

                this._dueLabel.Text = string.Format("Due {0}", dueDate);
            }
            this._callReasonLabel.Text    = record.Description;
            this._contactPictureBox.Image = record.GetImage(this._contactPictureBox.Size);
            this._nameLabel.Text          = record.Name;

            if (null == this._contactPictureBox.Image)
            {
                this._contactPictureBox.Image    = Properties.Resources.user;
                this._contactPictureBox.SizeMode = PictureBoxSizeMode.CenterImage;
            }

            Led vib = new Led();

            vib.SetLedStatus(1, Led.LedState.On);
            System.Threading.Thread.Sleep(200);
            vib.SetLedStatus(1, Led.LedState.Off);
            System.Threading.Thread.Sleep(200);
            vib.SetLedStatus(1, Led.LedState.On);
            System.Threading.Thread.Sleep(200);
            vib.SetLedStatus(1, Led.LedState.Off);

            return(base.ShowDialog());
        }
예제 #6
0
        private void _deleteCallMenuItem_Click(object sender, EventArgs e)
        {
            if (this._contactListBox.SelectedIndex >= 0 && this._contactListBox.SelectedIndex < this._contactListBox.FilteredItems.Count)
            {
                if (DialogResult.Yes == MessageBox.Show("Are you sure you want to delete this call?", "Sideline", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1))
                {
                    CallRecord record = this._contactListBox.FilteredItems[this._contactListBox.SelectedIndex];
                    Settings.Default.Queue.Remove(record);
                    this._contactListBox.FilteredItems.Remove(record);
                    this._contactListBox.Items.Remove(record);

                    SetFilter();
                }
            }
        }
예제 #7
0
        public DialogResult ShowDialog(CallRecord record, bool newRecord)
        {
            _record = record;
            this.detailsGeneral1.CallRecord = record;
            this.detailsNotes1.CallRecord   = record;
            this._completeMenuItem.Enabled  = record.IsActive;

            if (newRecord)
            {
                this._completeMenuItem.Enabled = false;
                this._closeMenuItem.Text       = "Save";
            }

            Cursor.Current = Cursors.Default;
            return(base.ShowDialog());
        }
예제 #8
0
        public void AddCall(Contact contact)
        {
            if (!Utils.CheckRegistration() && Settings.Default.Queue.Count >= MaxItemCount)
            {
                MessageBox.Show(string.Format("You may only add up to {0} items before registering.", MaxItemCount), "Sideline", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
            else
            {
                CallRecord record = new CallRecord(contact, string.Empty, DateTime.Now.AddDays(1), CallPriority.Normal);
                Settings.Default.Queue.Add(record);
                ShowDetails(record, true);
                _contactListBox.Items.Add(record);

                SetFilter();
            }
        }