private void lvCommentList_DoubleClick(object sender, EventArgs e) { if (lvCommentList.SelectedItems.Count == 1) { ListView.SelectedListViewItemCollection items = lvCommentList.SelectedItems; ListViewItem lvItem = lvCommentList.SelectedItems[0]; int ID = Convert.ToInt32(lvItem.Text); GlobalVO.setCommentID(ID); if (ActiveMdiChild != null) { ActiveMdiChild.Close(); } Form f = Application.OpenForms["frmUpdateComment"]; if (f == null) { frmUpdateComment fad = new frmUpdateComment(); fad.MdiParent = this.MdiParent; fad.Show(); } else { MessageBox.Show("Update Comment Form is Already Open.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } Close(); } }
private void getData() { string[,] data = ApiClass.getCommentByID(GlobalVO.getCommentID()); txtComment.Text = data[0, 0].ToString(); cbCommentStatus.Text = data[0, 1].ToString() == "PENDING" ? "PENDING" : data[0, 1].ToString() == "REJECTED" ? "REJECT" : "POST"; }
private void btnSave_Click(object sender, EventArgs e) { ApiClass.updateCommentStatus(GlobalVO.getCommentID(), cbCommentStatus.Text == "POST" ? "pass" : cbCommentStatus.Text == "REJECT" ? "reject" : "pending"); reOpenCommentListForm(); }