private void btnAllocate_Click(object sender, EventArgs e)
        {
            DataAccessLayer dl = new DataAccessLayer();

            if (dbConn.State == ConnectionState.Closed)
            {
                dbConn.Open();
            }
            try
            {
                for (int i = dgvProblems.Rows.Count - 1; i > 0; i--)
                {
                    DataGridViewRow row = dgvProblems.Rows[i - 1];
                    if (Convert.ToBoolean(row.Cells["Assign"].Value) == true)
                    {
                        p.UpdateProblem(int.Parse(row.Cells["ProbID"].Value.ToString()), cmbStaffID.Text.ToString(), "Assigned");
                        pl.InsertProblem(int.Parse(row.Cells["ProbID"].Value.ToString()), DateTime.Now.ToString(), cmbStaffID.Text.ToString(), "Initial allocated staff ID");
                    }
                }

                dgvProblems.DataSource = dl.getOpenProblems();

                try
                {
                    frmAllocateProblem frm = new frmAllocateProblem();
                    frm.Close();
                }
                catch { }
            }
            catch (SqlException sqlex)
            {
                MessageBox.Show("SQL exception: " + sqlex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            this.Close();
        }
        private void btnAllocateProblem_Click(object sender, EventArgs e)
        {
            frmAllocateProblem fAll = new frmAllocateProblem();

            fAll.ShowDialog();
        }
Example #3
0
        private void allocateProblemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmAllocateProblem fAll = new frmAllocateProblem();

            fAll.ShowDialog();
        }