Exemplo n.º 1
0
 private void button14_Click_1(object sender, EventArgs e)
 {
     if (comboBox2.Text == "DONE")
     {
         _auth val = new _auth();
         val.ShowDialog();
         if (val.upflag == "1")
         {
             _todoAdd a = new _todoAdd();
             a.label2.Text = this.label7.Text;
             a.ShowDialog();
             loadTask();
         }
         else
         {
             return;
         }
     }
     else
     {
         _todoAdd a = new _todoAdd();
         a.label2.Text = this.label7.Text;
         a.ShowDialog();
         loadTask();
     }
 }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            _auth a = new _auth();

            a.ShowDialog();
            if (a.upflag == "1")
            {
                if (String.IsNullOrWhiteSpace(label9.Text) || label9.Text == "~code~")
                {
                    MessageBox.Show(this, "Please select an event to update", "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    _collegeSchoolarForm2 b = new _collegeSchoolarForm2();
                    b.label2.Text = label9.Text;
                    b.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show(this, "Oops, Wrong Password :P", "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            getAttendee();
            label9.Text = "~code~";
        }
Exemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            _auth a = new _auth();

            a.ShowDialog();
            if (a.upflag == "1")
            {
                if (String.IsNullOrWhiteSpace(label9.Text) || label9.Text == "~code~")
                {
                    MessageBox.Show(this, "Please select an event to delete", "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MySqlConnection conn = new MySqlConnection(DBConn.connstring);
                    conn.Open();
                    MySqlCommand     myCommand = conn.CreateCommand();
                    MySqlTransaction myTrans;
                    myTrans = conn.BeginTransaction();
                    myCommand.Connection  = conn;
                    myCommand.Transaction = myTrans;
                    try
                    {
                        myCommand.Parameters.AddWithValue("@code", label9.Text);
                        string qD = @"delete from pwd where code = @code;";
                        myCommand.CommandText = qD;
                        myCommand.ExecuteNonQuery();
                        myTrans.Commit();
                        MessageBox.Show(this, "Record Deleted", "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    catch (Exception exg)
                    {
                        try
                        {
                            myTrans.Rollback();
                        }
                        catch (Exception ex)
                        {
                            if (myTrans.Connection != null)
                            {
                                MessageBox.Show(ex.ToString());
                            }
                        }
                        MessageBox.Show(exg.ToString());
                    }
                    finally
                    {
                        conn.Close();
                    }
                    getEvent();
                }
            }
            else
            {
                MessageBox.Show(this, "Oops, Wrong Password :P", "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            getEvent();
            label9.Text = "~code~";
        }
Exemplo n.º 4
0
        private void button17_Click(object sender, EventArgs e)
        {
            _auth val = new _auth();

            val.ShowDialog();
            if (val.upflag == "1")
            {
                delete();
            }
            else
            {
                return;
            }
            loadTask();
        }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            _auth b = new _auth();

            b.ShowDialog();
            if (b.upflag == "1")
            {
                _pwdForm a = new _pwdForm();
                a.label2.Text = this.label9.Text;
                a.ShowDialog();
                getEvent();
                label9.Text = "~code~";
            }
            else
            {
                MessageBox.Show(this, "Oops, Wrong Password :P", "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            _auth a = new _auth();

            a.ShowDialog();
            if (a.upflag == "1")
            {
                if (String.IsNullOrWhiteSpace(label9.Text) || label9.Text == "~code~")
                {
                    MessageBox.Show(this, "Please select an agency to update", "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    update();
                    getEvent();
                }
                this.Close();
            }
            else
            {
                MessageBox.Show(this, "Oops, Wrong Password :P", "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 7
0
        private void button18_Click_1(object sender, EventArgs e)
        {
            string strPending  = "update todo set flag = 'DONE' where code = @code";
            string strDone     = "update todo set flag = 'PENDING' where code = @code";
            string messPending = "Task Marked as Done!";
            string messDone    = "Task Marked as Pending!";
            string qry         = null;
            string mess        = null;

            if (comboBox2.Text == "PENDING")
            {
                qry  = strPending;
                mess = messPending;
            }
            else if (comboBox2.Text == "DONE")
            {
                _auth val = new _auth();
                val.ShowDialog();
                if (val.upflag == "1")
                {
                    qry  = strDone;
                    mess = messDone;
                }
                else
                {
                    return;
                }
            }
            else
            {
                return;
            }

            MySqlConnection conn = new MySqlConnection(DBConn.connstring);

            conn.Open();
            MySqlCommand     myCommand = conn.CreateCommand();
            MySqlTransaction myTrans;

            myTrans = conn.BeginTransaction();
            myCommand.Connection  = conn;
            myCommand.Transaction = myTrans;
            try
            {
                myCommand = conn.CreateCommand();
                myCommand.Parameters.AddWithValue("@code", label7.Text);
                myCommand.CommandText = qry;
                myCommand.ExecuteNonQuery();
                myTrans.Commit();
                MessageBox.Show(this, mess, "Peter Says", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception exg)
            {
                try
                {
                    myTrans.Rollback();
                }
                catch (Exception ex)
                {
                    if (myTrans.Connection != null)
                    {
                        MessageBox.Show(ex.ToString());
                    }
                }
                MessageBox.Show(exg.ToString());
            }
            finally
            {
                label7.Text = string.Empty;
                loadTask();
            }
        }