예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            int     id = int.Parse(dataGridView1.SelectedRows[0].Cells["requestID"].Value.ToString());
            Request re = RequestDAO.getRequestByRequestID(id);

            re.MaID      = m.MaID;
            re.DateReply = DateTime.Now.ToString();
            re.Reply     = txtReplyContent.Text;
            RequestDAO.Update(re);
            MessageBox.Show("Reply Success");
            DataTable dt     = RequestDAO.GetDataTable();
            DataView  dv     = new DataView(dt);
            string    filter = "";

            if (comboBox1.SelectedIndex == 1)
            {
                filter = "maID is not null";
            }
            if (comboBox1.SelectedIndex == 0)
            {
                filter = "maID is null";
            }
            dv.RowFilter             = filter;
            dataGridView1.DataSource = dv;
            btnSave.Enabled          = false;
            txtReplyContent.Enabled  = false;
            txtReplyContent.Text     = "";
            btnCancel.Enabled        = false;
            btnReply.Enabled         = true;
        }