private void sbtnRepliesUpdate_Click(object sender, System.EventArgs e) { if (!CheckGvRepliesFocusRow()) return; DataRow row = gvMemo.GetDataRow(gvMemo.FocusedRowHandle); if (Convert.ToInt32(row["nEmployeeID"]) == Convert.ToInt32(luedtMemoEmployeeID.EditValue)) { ACMS.ACMSStaff.Memo.frmReplies myForm = new ACMS.ACMSStaff.Memo.frmReplies( Convert.ToInt32(gvReplies.GetDataRow(gvReplies.FocusedRowHandle)["nBulletinID"]), Convert.ToInt32(row["nMemoID"]), Convert.ToInt32(luedtMemoEmployeeID.EditValue), ACMSLogic.Staff.MemoReplyAction.Update); if (DialogResult.OK == myForm.ShowDialog()) { row.BeginEdit(); row["fRead"] = false; row.EndEdit(); lastMemoIDForReplies = -1; ListReplies(); } myForm.Dispose(); } else { UI.ShowErrorMessage(this, "You are not author of this reply, so you can't update this reply."); return; } }
private void sbtnRepliesView_Click(object sender, System.EventArgs e) { if (!CheckGvRepliesFocusRow()) return; ACMS.ACMSStaff.Memo.frmReplies myForm = new ACMS.ACMSStaff.Memo.frmReplies( Convert.ToInt32(gvReplies.GetDataRow(gvReplies.FocusedRowHandle)["nBulletinID"]), Convert.ToInt32(gvMemo.GetDataRow(gvMemo.FocusedRowHandle)["nMemoID"]), Convert.ToInt32(luedtMemoEmployeeID.EditValue), ACMSLogic.Staff.MemoReplyAction.View); myForm.ShowDialog(); myForm.Dispose(); }
private void sbtnRepliesAdd_Click(object sender, System.EventArgs e) { if (gvMemo.FocusedRowHandle < 0) return; DataRow rFocus = gvMemo.GetDataRow(gvMemo.FocusedRowHandle); ACMS.ACMSStaff.Memo.frmReplies myForm = new ACMS.ACMSStaff.Memo.frmReplies(-1, Convert.ToInt32(rFocus["nMemoID"]), Convert.ToInt32(luedtMemoEmployeeID.EditValue), ACMSLogic.Staff.MemoReplyAction.Add); if (DialogResult.OK == myForm.ShowDialog()) { rFocus.BeginEdit(); rFocus["fRead"] = false; rFocus.EndEdit(); lastMemoIDForReplies = -1; ListReplies(); } myForm.Dispose(); }