Esempio n. 1
0
        private void dataGridView1_CellContentClick_2(object sender, DataGridViewCellEventArgs e)
        {
            int    curRow = int.Parse(e.RowIndex.ToString());
            string currentrow;

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

            SqlConnection con = new SqlConnection(constring);

            con.Open();

            SqlCommand cmd = new SqlCommand("Update ComposeRequest set CView='" + p1 + "' where CID='" + currentrow + "'", con);

            cmd.ExecuteNonQuery();

            ViewUserRequests vur = new ViewUserRequests();

            vur.ShowDialog();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(constring);

            con.Open();
            SqlDataAdapter adp1 = new SqlDataAdapter("Select * from ComposeRequest where CID='" + label14.Text + "'", con);
            DataSet        ds1  = new DataSet();

            adp1.Fill(ds1);
            string status = ds1.Tables[0].Rows[0]["CStatus"].ToString();

            if (status == "Success")
            {
                DialogResult dlg1 = MessageBox.Show("Request Already Sent To Manager.", "Message Box", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                if (dlg1 == DialogResult.OK)
                {
                    ViewUserRequests vur = new ViewUserRequests();
                    vur.Close();
                }
            }
            else
            {
                for (int j = 0; j < ds1.Tables[0].Rows.Count; j++)
                {
                    SqlCommand cmd1 = new SqlCommand("Update ComposeRequest set CReqToManager='" + comboBox1.SelectedItem.ToString() + "' where CID='" + label14.Text + "'", con);
                    cmd1.ExecuteNonQuery();

                    SqlCommand cmd2 = new SqlCommand("Update ComposeRequest set CStatus='" + p4 + "' where CID='" + label14.Text + "'", con);
                    cmd2.ExecuteNonQuery();
                }

                DialogResult dlg = MessageBox.Show("Request Sent To Manager.", "Message Box", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                if (dlg == DialogResult.OK)
                {
                    ViewUserRequests vur = new ViewUserRequests();
                    vur.Close();
                }
            }
            con.Close();
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(constring);
            con.Open();
            SqlDataAdapter adp1 = new SqlDataAdapter("Select * from ComposeRequest where CID='" + label14.Text + "'", con);
            DataSet ds1 = new DataSet();
            adp1.Fill(ds1);
            string status=ds1.Tables[0].Rows[0]["CStatus"].ToString();

            if (status == "Success")
            {
                DialogResult dlg1 = MessageBox.Show("Request Already Sent To Manager.", "Message Box", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                if (dlg1 == DialogResult.OK)
                {
                    ViewUserRequests vur = new ViewUserRequests();
                    vur.Close();
                }
            }
            else
            {
                for (int j = 0; j < ds1.Tables[0].Rows.Count; j++)
                {
                    SqlCommand cmd1 = new SqlCommand("Update ComposeRequest set CReqToManager='" + comboBox1.SelectedItem.ToString() + "' where CID='" + label14.Text + "'", con);
                    cmd1.ExecuteNonQuery();

                    SqlCommand cmd2 = new SqlCommand("Update ComposeRequest set CStatus='" + p4 + "' where CID='" + label14.Text + "'", con);
                    cmd2.ExecuteNonQuery();
                }

                DialogResult dlg = MessageBox.Show("Request Sent To Manager.", "Message Box", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                if (dlg == DialogResult.OK)
                {
                    ViewUserRequests vur = new ViewUserRequests();
                    vur.Close();

                }
            }
            con.Close();
        }
Esempio n. 4
0
        private void dataGridView1_CellContentClick_2(object sender, DataGridViewCellEventArgs e)
        {
            int curRow = int.Parse(e.RowIndex.ToString());
            string currentrow;
            currentrow = dataGridView1.Rows[curRow].Cells[1].Value.ToString();

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

            SqlCommand cmd = new SqlCommand("Update ComposeRequest set CView='" + p1 + "' where CID='" + currentrow + "'", con);
            cmd.ExecuteNonQuery();

            ViewUserRequests vur = new ViewUserRequests();
            vur.ShowDialog();
        }