Exemplo n.º 1
1
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            SqlConnection con = new SqlConnection(constring);
            con.Open();

            int curRow = int.Parse(e.RowIndex.ToString());
            string currentrow;
            currentrow = dataGridView1.Rows[curRow].Cells[1].Value.ToString();

            SqlDataAdapter adp1 = new SqlDataAdapter("Select * from ResManagerToAdmin where ResID='" + currentrow + "'", con);
            DataSet ds1 = new DataSet();
            adp1.Fill(ds1);

            SqlCommand cmd = new SqlCommand("Update ResManagerToAdmin set RView='" + p2 + "' where ResID='" + currentrow + "'", con);
            cmd.ExecuteNonQuery();

            SqlCommand cmd1 = new SqlCommand("Update ResManagerToAdmin set RFinalView='" + p2 + "' where ResID='" + currentrow + "'", con);
            cmd1.ExecuteNonQuery();

            status = ds1.Tables[0].Rows[0]["RStatus"].ToString();

            if (status == "Success")
            {
                ViewAdminResponses var = new ViewAdminResponses();
                var.ShowDialog();
            }
            else
            {
                RecordNotFound rnf = new RecordNotFound();
                rnf.ShowDialog();
            }
        }
Exemplo n.º 2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int curRow = int.Parse(e.RowIndex.ToString());
            string currentrow, currentrow1;
            currentrow = dataGridView1.Rows[curRow].Cells[1].Value.ToString();
            currentrow1 = dataGridView1.Rows[curRow].Cells[7].Value.ToString();

            SqlConnection con = new SqlConnection(constring);
            con.Open();

            SqlCommand cmd = new SqlCommand("Update ResManagerToAdmin set RView='" + p1 + "' where ResID='" + currentrow + "'", con);
            cmd.ExecuteNonQuery();

            if (currentrow1 == "Record Not Found")
            {
                RecordNotFound rnf = new RecordNotFound();
                rnf.ShowDialog();
            }
            else
            {
                ViewAdminResponses var = new ViewAdminResponses();
                var.ShowDialog();
            }

            con.Close();
        }
Exemplo n.º 3
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int    curRow = int.Parse(e.RowIndex.ToString());
            string currentrow, currentrow1;

            currentrow  = dataGridView1.Rows[curRow].Cells[1].Value.ToString();
            currentrow1 = dataGridView1.Rows[curRow].Cells[7].Value.ToString();

            SqlConnection con = new SqlConnection(constring);

            con.Open();

            SqlCommand cmd = new SqlCommand("Update ResManagerToAdmin set RView='" + p1 + "' where ResID='" + currentrow + "'", con);

            cmd.ExecuteNonQuery();

            if (currentrow1 == "Record Not Found")
            {
                RecordNotFound rnf = new RecordNotFound();
                rnf.ShowDialog();
            }
            else
            {
                ViewAdminResponses var = new ViewAdminResponses();
                var.ShowDialog();
            }

            con.Close();
        }
Exemplo n.º 4
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            SqlConnection con = new SqlConnection(constring);

            con.Open();

            int    curRow = int.Parse(e.RowIndex.ToString());
            string currentrow;

            currentrow = dataGridView1.Rows[curRow].Cells[1].Value.ToString();

            SqlDataAdapter adp1 = new SqlDataAdapter("Select * from ResManagerToAdmin where ResID='" + currentrow + "'", con);
            DataSet        ds1  = new DataSet();

            adp1.Fill(ds1);

            SqlCommand cmd = new SqlCommand("Update ResManagerToAdmin set RView='" + p2 + "' where ResID='" + currentrow + "'", con);

            cmd.ExecuteNonQuery();

            SqlCommand cmd1 = new SqlCommand("Update ResManagerToAdmin set RFinalView='" + p2 + "' where ResID='" + currentrow + "'", con);

            cmd1.ExecuteNonQuery();

            status = ds1.Tables[0].Rows[0]["RStatus"].ToString();

            if (status == "Success")
            {
                ViewAdminResponses var = new ViewAdminResponses();
                var.ShowDialog();
            }
            else
            {
                RecordNotFound rnf = new RecordNotFound();
                rnf.ShowDialog();
            }
        }