Exemplo n.º 1
0
        private void viewMyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
            View_myReferences vr = new View_myReferences(userId);

            vr.Show();
        }
Exemplo n.º 2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string command = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
            int    tag_Id  = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[3].Value);

            if (command == "Edit")
            {
                Edit_Tags et = new Edit_Tags(tag_Id);
                et.UserID = userId;
                this.Close();
                et.Show();
            }
            else if (command == "Delete")
            {
                try
                {
                    string      qry   = "delete from [tbl_Tags] where Tag_Id =" + tag_Id;
                    DatabaseCon dbcon = new DatabaseCon();
                    dbcon.Query = qry;
                    dbcon.ExecuteQuery();
                    MessageBox.Show("Data deleted successfully");

                    loadTag();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else if (command == "Tagged Article")
            {
                try
                {
                    string      qry   = "select Tag from [tbl_Tags] where Tag_Id =" + tag_Id;
                    DatabaseCon dbcon = new DatabaseCon();
                    dbcon.Query = qry;
                    DataTable dt  = dbcon.GetData();
                    string    Tag = dt.Rows[0]["Tag"].ToString();

                    View_myReferences vr = new View_myReferences(userId);
                    vr.Tag = Tag;
                    this.Close();
                    vr.Show();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        private void Edit_References_FormClosing(object sender, FormClosingEventArgs e)
        {
            View_myReferences v = new View_myReferences(userID);

            v.Show();
        }