protected virtual void OnValueChanged(comments e) { // Create a copy of the event to work with EventHandler<comments> eh = DataChanged; /* If there are no subscribers, eh will be null so we need to check * to avoid a NullReferenceException. */ if (eh != null) eh(this, e); }
private void btnSave_Click(object sender, EventArgs e) { string strRating = ""; Messages oErrMsg = Messages.Instance; FeedBack oFeedBack = new FeedBack(); picbox.Visible = true; Application.DoEvents(); if (cboRating.Text.Trim() == "--Select--") { strRating = ""; } else { strRating = cboRating.Text.Trim(); } try { oErrMsg = oFeedBack.UpdateFeedBack(JobID, strRating, txtComments.Text.Trim(), AccountRef, PartNumber); if (!oErrMsg.IsError) { picbox.Visible = false; comments _cmm = new comments(); _cmm.Comments = txtComments.Text; _cmm.Rating = strRating; _cmm.Row = this.Row; _cmm.Col = this.Col; OnValueChanged(_cmm); DialogResult = DialogResult.OK; this.Close(); } else { picbox.Visible = false; MessageBox.Show(oErrMsg.Message); } } catch (Exception ex) { picbox.Visible = false; MessageBox.Show(ex.Message.ToString()); } }
private void Feedback_DataChanged(object sender, comments e) { outlookGrid1.Rows[e.Row].Cells[13].Value = e.Rating.Trim(); outlookGrid1.Rows[e.Row].Cells[14].Value = e.Comments.Trim(); }