private void btn_TL_Click(object sender, EventArgs e)
 {
     frmBugProduct frm = new frmBugProduct(_ID, true);
     frm.AfterAddReplyIssueSuccessfully += delegate(DTO.DOReplyBugProduct doReplyBugProduct)
     {
         ucReplyIssue ucReply1 = new ucReplyIssue(this,
                doReplyBugProduct.ID, doReplyBugProduct.NGUOI_GUI, doReplyBugProduct.NGAY_GUI
                , doReplyBugProduct.NOI_DUNG, doReplyBugProduct.DSFile, "TEN_FILE", "NOI_DUNG", _TinhTrang);
         flowLayoutPanel1.Controls.Add(ucReply1);
         ucReply1.Width = DefaultWidth;
         xtraScrollableControl1.ScrollControlIntoView(ucReply1);
         ucReplyIssue ucReplyIssue1 = (ucReplyIssue)this.flowLayoutPanel1.Controls[0];
         ucReplyIssue1.btnUpdate.Visible = false;
     };
     frm.AfterUpdateStatusOfIssue += delegate(long TinhTrang,object[] infos) {
         ucReplyIssue ucReplyIssue1 = (ucReplyIssue)this.flowLayoutPanel1.Controls[0];
         switch (TinhTrang)
         {
             case 1:
                 ucReplyIssue1.lblTinhTrang.Text = "Mới tạo";
                 break;
             case 2:
                 ucReplyIssue1.lblTinhTrang.Text = "Đang xử lý";
                 break;
             default:
                 ucReplyIssue1.lblTinhTrang.Text = "Hoàn tất";
                 ucReplyIssue1.btnUpdate.Visible = false;
                 for (int i = 1; i < this.flowLayoutPanel1.Controls.Count; i++)
                 {
                     ucReplyIssue _ucReplyIssue = (ucReplyIssue)this.flowLayoutPanel1.Controls[i];
                     _ucReplyIssue.btnUpdate.Visible = false;
                     this.btn_TL.Visible = false;
                 }
                 break;
         }
         UpdateIssue(TinhTrang, infos);
     };
     HelpProtocolForm.ShowModalDialog(this, frm);
 }
        public override void ShowUpdateForm(long id)
        {
            if (DAReplyBugProduct.TThoantat(id))
            {
                HelpMsgBox.ShowNotificationMessage("Không cho phép sửa vấn đề khi tình trạng đã \"Hoàn tất\".");
                return;
            }
            else if (DAReplyBugProduct.HasReplyIssue(id))
            {
                HelpMsgBox.ShowNotificationMessage("Không cho phép sửa vấn đề khi đã có phản hồi.");
                return;
            }

            frmBugProduct fbug = new frmBugProduct(id, false);
            fbug.AfterAddIssueSuccessfully += new frmBugProduct._AfterAddIssueSuccessfully(frm_AfterAddIssueSuccessfully);
            HelpProtocolForm.ShowModalDialog(this, fbug);
        }
 public override long[] ShowAddForm()
 {
     frmBugProduct frm = new frmBugProduct(-2, true);
     HelpProtocolForm.ShowModalDialog(this, frm);
     return null;
 }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            DataTable dtReplyIssue = DABugProduct.Get_Reply_Issue(_ID);
            if (dtReplyIssue.Rows.Count > 0)
            {
                DataRow row = dtReplyIssue.Rows[0];
                frmBugProduct frm = new frmBugProduct(HelpNumber.ParseInt64(row["BUG_ID"]), false, new long[] { _ID });
                frm.AfterUpdateReplyIssueSuccessfully += new frmBugProduct._AfterUpdateReplyIssueSuccessfully(frm_AfterUpdateReplyIssueSuccessfully);
                frm.AfterUpdateStatusOfIssue += new frmBugProduct._AfterUpdateStatusOfIssue(frm_AfterUpdateStatusOfIssue);
                HelpProtocolForm.ShowModalDialog((XtraFormPL)this.FindForm(), frm);
            }
            //Update issue
            else {
                frmBugProduct frm = new frmBugProduct(_ID, false);
                frm.AfterUpdateIssueSuccessfully +=new frmBugProduct._AfterUpdateIssueSuccessfully(frm_AfterUpdateIssueSuccessfully);
                frm.AfterUpdateStatusOfIssue += new frmBugProduct._AfterUpdateStatusOfIssue(frm_AfterUpdateStatusOfIssue);
                HelpProtocolForm.ShowModalDialog((XtraFormPL)this.FindForm(), frm);

            }
        }