private void btnThemCongViec_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear();
            if (ProjectController.kiemTraDuAnDaTonTai(this.txtMaSoDuAn.Text.ToString().Trim()))
            {
                errorProvider1.SetError(this.txtMaSoDuAn, "Mã dự án đã tồn tại");
                return;
            }
            List <string> dsMaNV = new List <string>();

            for (int i = 0; i < this.dgrDanhSachCongViec.Rows.Count; i++)
            {
                dsMaNV.Add(this.dgrDanhSachCongViec.Rows[i].Cells[1].Value.ToString().Trim());
            }
            frmAddWork frmAddWork1 = new frmAddWork(this.txtMaSoDuAn.Text.ToString().Trim(), dsMaNV);

            frmAddWork1.ShowDialog();
            //capNhatDanhSachCongViec();
            if (frmAddWork1.DialogResult == DialogResult.OK)
            {
                this.dgrDanhSachCongViec.Rows.Add();
                int soHang = this.dgrDanhSachCongViec.RowCount;
                this.dgrDanhSachCongViec.Rows[soHang - 1].Cells[0].Value = frmAddWork1.CongViec.Works;
                this.dgrDanhSachCongViec.Rows[soHang - 1].Cells[1].Value = frmAddWork1.CongViec.IDMember;
            }
        }
Beispiel #2
0
        private void btnThemCongViec_Click(object sender, EventArgs e)
        {
            List <string> dsMaNV = new List <string>();

            for (int i = 0; i < this.dgrDanhSachCongViec.Rows.Count; i++)
            {
                dsMaNV.Add(this.dgrDanhSachCongViec.Rows[i].Cells[2].Value.ToString().Trim());
            }
            frmAddWork frmAddWork = new frmAddWork(this.dgrDanhSachDuAn.CurrentRow.Cells[0].Value.ToString().Trim(), dsMaNV);

            frmAddWork.ShowDialog();
            capNhatDanhSachCongViec();
        }