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; }
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(); } }
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(); } }
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; }
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()); }
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(); } } }
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()); }
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(); } }