Exemplo n.º 1
0
 private void txt_Category_TextChanged(object sender, EventArgs e)
 {
     if (AutoCompletionCache != null)
     {
         chk_Billable.Checked = AutoCompletionCache.BillableFlagByCategory(txt_Category.Text) ?? chk_Billable.Checked;
     }
 }
Exemplo n.º 2
0
        private void TaskInput_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (this.DialogResult == DialogResult.OK)
            {
                if (!string.IsNullOrEmpty(txt_CompletedAt.Text) && TaskEndDate == null)
                {
                    MessageBox.Show("The provided completion time is not a valid date/time.", "Invalid Completion Time", MessageBoxButtons.OK);
                    e.Cancel = true;
                }

                if (TaskStartDate == null)
                {
                    MessageBox.Show("A start time must be provided.", "Missing Start Time", MessageBoxButtons.OK);
                    e.Cancel = true;
                }

                if (!e.Cancel &&
                    ((AutoCompletionCache.BillableFlagByCategory(txt_Category.Text) ?? chk_Billable.Checked) != chk_Billable.Checked)
                    )
                {
                    if (MessageBox.Show("The \"Billable\" flag doesn't match previous values for the given Category; would you like to continue with the provided value?", "Billable mismatch - continue?", MessageBoxButtons.YesNo) != DialogResult.Yes)
                    {
                        e.Cancel = true;
                    }
                }
            }
        }