//Link Button #region [Link Button] protected void linkbtnView_Click(object sender, EventArgs e) { try { lock (this) { EWA_Messages ObjEWA = new EWA_Messages(); DL_Messages ObjDL = new DL_Messages(); LinkButton lnkBtnId = (LinkButton)sender; GridViewRow grdrow = lnkBtnId.NamingContainer as GridViewRow; string MessageId = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["MessageId"].ToString(); ObjEWA.MessageId = MessageId; ObjEWA.Action = "FetchAttachment"; dsAttachment = ObjDL.FetchAttachment(ObjEWA); //GrdAttachement.DataSource = dsAttachment; //GrdAttachement.DataBind(); lblFrom.Text = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Sender"].ToString(); lblSubject.Text = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Subject"].ToString(); txtMessage.Text = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["MessageContent"].ToString(); txtMessage.Enabled = false; MessagePopUp.Show(); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Save Attachment #region [Save Attachment] public void SaveAttachment_BL(EWA_Messages ObjEWA) { try { DL_Messages ObjDL = new DL_Messages(); ObjDL.SaveAttachment_DL(ObjEWA); } catch (Exception) { throw; } }
//Grid view anouncement #region [Grid View announcement] public DataSet BindGrdViewAnnouncement_BL(EWA_Messages objEWA) { try { DataSet ds = null; DL_Messages objDL = new DL_Messages(); ds = objDL.BindGrdViewAnnouncement_DL(objEWA); return(ds); } catch (Exception) { throw; } }
//Link Button #region [Link Button] protected void linkbtnView_Click(object sender, EventArgs e) { try { lock (this) { EWA_Messages ObjEWA = new EWA_Messages(); DL_Messages ObjDL = new DL_Messages(); LinkButton lnkBtnId = (LinkButton)sender; GridViewRow grdrow = lnkBtnId.NamingContainer as GridViewRow; string MessageId = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["MessageId"].ToString(); ObjEWA.MessageId = MessageId; ObjEWA.Action = "FetchAttachment"; dsAttachment = ObjDL.FetchAttachment(ObjEWA); //GrdAttachement.DataSource = dsAttachment; //GrdAttachement.DataBind(); lblFrom.Text = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Sender"].ToString(); // lblSubject.Text = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Subject"].ToString(); string URL1 = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Subject"].ToString(); if (URL1.StartsWith("https://www") || URL1.StartsWith("http://www")) { lnkbtnViewSubjectClick.Text = URL1; lnkbtnViewSubjectClick.Visible = true; lnkbtnViewSubjectClick.ForeColor = System.Drawing.Color.Blue; } else { lblSubject.Text = URL1; lblSubject.Visible = true; } txtMessage.Text = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["MessageContent"].ToString(); txtMessage.Enabled = false; MessagePopUp.Show(); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
protected void GrdViewAnnouncement_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { string[] confirmValue = Request.Form["confirm_value"].Split(','); if (confirmValue[confirmValue.Length - 1] == "Yes") { EWA_Messages ObjEWA = new EWA_Messages(); DL_Messages ObjDL = new DL_Messages(); ObjEWA.Action = "DeleteStaffCreateAnnouncement"; ObjEWA.SenderId = GrdViewAnnouncement.DataKeys[e.RowIndex].Values["StaffUserCode"].ToString(); ObjEWA.MessageId = GrdViewAnnouncement.DataKeys[e.RowIndex].Values["MessageId"].ToString(); ObjDL.DeleteSenderDetails(ObjEWA); BindGridData(); } } catch (Exception ex) { } }