Ejemplo n.º 1
0
        private void BtnRemind_Click(object sender, EventArgs e)
        {
            Reminder r = new Reminder();

            r.st    = 2;
            r.FName = Fname;
            List <string> lst = new List <string>();

            if (ChLsBxTaskList.SelectedIndices == null)
            {
                MessageBox.Show("No tasks selected to set reminder. Please select one or more tasks");
                ChLsBxTaskList.Focus();
            }
            else
            {
                int i;
                for (i = 0; i < ChLsBxTaskList.SelectedItems.Count; i++)
                {
                    lst.Add(ChLsBxTaskList.SelectedItems.IndexOf(i).ToString());
                }
            }
            r.TLst = lst;
            r.Show();
        }
Ejemplo n.º 2
0
        private void BtnReminder_Click(object sender, EventArgs e)
        {
            Reminder r = new Reminder();

            if (CmBxList.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a mode of reminding you.");
                CmBxList.Focus();
            }
            else if (CmBxList.SelectedIndex == 0)
            {
                if (TxtBxPhNo.Text == null || TxtBxPhNo.Text == "")
                {
                    MessageBox.Show("Please enter your cellphone number to send a message to");
                    TxtBxPhNo.Focus();
                }
                else if (TxtBxPhNo.Text.Length != 10)
                {
                    MessageBox.Show("Invalid Phone number. Please try again");
                    TxtBxPhNo.Focus();
                }
                else
                {
                    if (st == 1)
                    {
                        r.MsgOnly(TxtBxPhNo.Text.ToString(), FName, ShpngLst);
                    }
                    else
                    {
                        r.MsgOnly(TxtBxPhNo.Text.ToString(), FName, TLst);
                    }
                }
            }
            else if (CmBxList.SelectedIndex == 1)
            {
                if (TxtBxEmail.Text == "" || TxtBxEmail.Text == null)
                {
                    MessageBox.Show("Please enter your email id.");
                    TxtBxEmail.Focus();
                }
                else if (!TxtBxEmail.Text.Contains("@") && !TxtBxEmail.Text.Contains("."))
                {
                    MessageBox.Show("Invalid Email id. Please try again.");
                    TxtBxEmail.Focus();
                }
                else
                {
                    if (st == 1)
                    {
                        r.EmailOnly(TxtBxEmail.Text.ToString(), FName, ShpngLst);
                    }
                    else
                    {
                        r.EmailOnly(TxtBxEmail.Text.ToString(), FName, TLst);
                    }
                }
            }
            else if (CmBxList.SelectedIndex == 2)
            {
                if (st == 1)
                {
                    r.EmailAndMsg(TxtBxEmail.Text.ToString(), TxtBxPhNo.Text.ToString(), FName, ShpngLst);
                }
                else
                {
                    r.EmailAndMsg(TxtBxEmail.Text.ToString(), TxtBxPhNo.Text.ToString(), FName, TLst);
                }
            }
        }
Ejemplo n.º 3
0
 private void BtnRemind_Click(object sender, EventArgs e)
 {
     Reminder r = new Reminder();
     r.st = 2;
     r.FName = Fname;
     List<string> lst = new List<string>();
     if(ChLsBxTaskList.SelectedIndices == null )
     {
         MessageBox.Show("No tasks selected to set reminder. Please select one or more tasks");
         ChLsBxTaskList.Focus();
     }
     else
     {
         int i;
         for(i = 0; i< ChLsBxTaskList.SelectedItems.Count;i++)
         {
             lst.Add(ChLsBxTaskList.SelectedItems.IndexOf(i).ToString());
         }
     }
     r.TLst = lst;
     r.Show();
 }
Ejemplo n.º 4
0
 public void EmailAndMsg(string email, string no, string nm, List<string> lst)
 {
     Reminder r = new Reminder();
     r.MsgOnly(no, nm, lst);
     r.EmailOnly(email, nm, lst);
     MessageBox.Show("Email sent to " + TxtBxEmail.Text.ToString() + "\nMessage sent to " + TxtBxPhNo.Text.ToString());
 }
Ejemplo n.º 5
0
        private void BtnReminder_Click(object sender, EventArgs e)
        {
            Reminder r = new Reminder();
            if(CmBxList.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a mode of reminding you.");
                CmBxList.Focus();
            }
            else if(CmBxList.SelectedIndex == 0)
            {
                if (TxtBxPhNo.Text == null || TxtBxPhNo.Text == "")
                {
                    MessageBox.Show("Please enter your cellphone number to send a message to");
                    TxtBxPhNo.Focus();
                }
                else if (TxtBxPhNo.Text.Length != 10)
                {
                    MessageBox.Show("Invalid Phone number. Please try again");
                    TxtBxPhNo.Focus();
                }
                else
                {
                    if (st == 1)
                    {
                        r.MsgOnly(TxtBxPhNo.Text.ToString() , FName, ShpngLst);
                    }
                    else
                    {
                        r.MsgOnly(TxtBxPhNo.Text.ToString(), FName, TLst);
                    }
                }
            }
            else if (CmBxList.SelectedIndex == 1)
            {
                if(TxtBxEmail.Text == "" || TxtBxEmail.Text == null)
                {
                    MessageBox.Show("Please enter your email id.");
                    TxtBxEmail.Focus();
                }
                else if(!TxtBxEmail.Text.Contains("@") && !TxtBxEmail.Text.Contains("."))
                {
                    MessageBox.Show("Invalid Email id. Please try again.");
                    TxtBxEmail.Focus();
                }
                else
                {
                    if (st == 1)
                    {
                        r.EmailOnly(TxtBxEmail.Text.ToString() , FName, ShpngLst);
                    }
                    else
                    {
                        r.EmailOnly(TxtBxEmail.Text.ToString(), FName, TLst);
                    }
                }
            }
            else if (CmBxList.SelectedIndex == 2)
            {
                if (st == 1)
                {
                    r.EmailAndMsg(TxtBxEmail.Text.ToString(), TxtBxPhNo.Text.ToString(), FName, ShpngLst);
                }
                else
                {
                    r.EmailAndMsg(TxtBxEmail.Text.ToString(), TxtBxPhNo.Text.ToString(), FName, TLst);
                }

            }
        }