protected void GVEvents_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("EditNews")) { Entity.EventInfo oEventInfo = new Entity.EventInfo(); BLL.EventsLib oEventsLib = new BLL.EventsLib(); oEventInfo = oEventsLib.GetEventByEventId(Convert.ToInt32(e.CommandArgument)); if (oEventInfo != null) { ViewState["intEventId"] = e.CommandArgument.ToString(); txtActivity.Text = oEventInfo.StrActivity; txtComments.Text = oEventInfo.StrComments; txtDate.Text = oEventInfo.DtEventDate.ToShortDateString(); txtLocation.Text = oEventInfo.StrLocation; } } else if (e.CommandName.Equals("DeleteNews")) { BLL.EventsLib oEventsLib = new BLL.EventsLib(); oEventsLib.DeleteEventDetails(Convert.ToInt32(e.CommandArgument)); lblMsg.Text = "Event has been deleted successfully."; oEventsLib = null; ClearControls(); BindEvents(); } else if (e.CommandName.Equals("StatusChanged")) { BLL.EventsLib oEventsLib = new BLL.EventsLib(); oEventsLib.ActivateDeactivateEvent(Convert.ToInt32(e.CommandArgument)); lblMsg.Text = "Event status has been changed successfully."; oEventsLib = null; ClearControls(); BindEvents(); } }
private void BindDetails() { if (Request.QueryString["type"] != null && Request.QueryString["id"] != null && Request.QueryString["fid"] != null) { BLL.NewsLib oNewsLib = new BLL.NewsLib(); Entity.NewsInfo oNewsInfo = new Entity.NewsInfo(); if (Request.QueryString["type"].ToString().ToLower().Equals("newsletter")) { trNewsletter.Visible = true; oNewsInfo = new Entity.NewsInfo(); oNewsLib = new BLL.NewsLib(); oNewsInfo = oNewsLib.GetNewsLettersById(Convert.ToInt32(Request.QueryString["id"])); if (oNewsInfo != null) { lblNewsletterDescription.Text = oNewsInfo.StrDescription; if (!oNewsInfo.StrNewsletterDate.ToString().Equals("1/1/1999 12:00:00 AM")) lblNewsletterDate.Text = oNewsInfo.StrNewsletterDate.ToShortDateString(); if (!oNewsInfo.StrPDFFilename.Equals("na.pdf")) { ancPrevious.Visible = true; ancPrevious.HRef = AppConfig.GetBaseSiteUrl() + AppConfig.GetNewsLettersPDFPath() + oNewsInfo.StrPDFFilename; } else { trNewsletterPDF.Visible = false; } } } else if (Request.QueryString["type"].ToString().ToLower().Equals("event")) { trEvent.Visible = true; if (Request.QueryString["id"] != null) { int _intEventId = 0; _intEventId = Convert.ToInt32(Request.QueryString["id"]); Entity.EventInfo oEventInfo = new Entity.EventInfo(); BLL.EventsLib oEventsLib = new BLL.EventsLib(); oEventInfo = oEventsLib.GetEventByEventId(_intEventId); if (oEventInfo != null) { lblEventActivity.Text = oEventInfo.StrActivity; lblEventComments.Text = oEventInfo.StrComments; lblEventDate.Text = oEventInfo.DtEventDate.ToShortDateString(); lblEventLocation.Text = oEventInfo.StrLocation; } oEventsLib = null; oEventInfo = null; } } else if (Request.QueryString["type"].ToString().ToLower().Equals("newsannouncements")) { trNewsAnnouncement.Visible = true; oNewsInfo = new Entity.NewsInfo(); oNewsLib = new BLL.NewsLib(); oNewsInfo = oNewsLib.GetNewsAnnouncementsById(Convert.ToInt32(Request.QueryString["id"])); if (oNewsInfo != null) { lblNewsAnnouncementDescription.Text = oNewsInfo.StrDescription; lblNewsAnnouncementDirectLink.Text = oNewsInfo.StrDirectLink; if (lblNewsAnnouncementDirectLink.Text.Trim().Equals(string.Empty)) { trNewsAnnouncementDirectLink.Visible = false; trNewsAnnouncementPDF.Visible = true; ancPreviousNewsAnnoucment.HRef = AppConfig.GetBaseSiteUrl() + AppConfig.GetNewsAnnouncementsPDFPath() + oNewsInfo.StrPDFFilename; } else { trNewsAnnouncementDirectLink.Visible = true; trNewsAnnouncementPDF.Visible = false; } oNewsInfo = null; oNewsLib = null; } } else if (Request.QueryString["type"].ToString().ToLower().Equals("library")) { trLibrary.Visible = true; Entity.LibraryInfo oLibraryInfo = new Entity.LibraryInfo(); BLL.LibraryLib oLibraryLib = new BLL.LibraryLib(); oLibraryInfo = oLibraryLib.GetLibraryByLibraryId(Convert.ToInt32(Request.QueryString["id"])); if (oLibraryInfo != null) { lblLibraryDescription.Text = oLibraryInfo.StrDescription; if (!oLibraryInfo.DtLibraryDate.ToString().Equals("1/1/1999 12:00:00 AM")) lblLibraryDate.Text = oLibraryInfo.DtLibraryDate.ToShortDateString(); if (oLibraryInfo.StrLocationType.ToLower().Equals("pdf") || oLibraryInfo.StrLocationType.ToLower().Equals("video")) { trLibraryLink.Visible = false; ancLibraryPDF.Visible = true; ancLibraryPDF.HRef = AppConfig.GetBaseSiteUrl() + AppConfig.GetLibrariesFilePath() + oLibraryInfo.StrLocation; } else { trLibraryPDF.Visible = false; lblLibraryWebsiteLink.Text = oLibraryInfo.StrLocation; } lblLibraryCategoryType.Text = oLibraryInfo.StrLocationType; lblLibraryCategory.Text = oLibraryInfo.StrCategory; oLibraryInfo = null; oLibraryLib = null; } } } }
private void BindEventsDetails() { if (Request.QueryString["id"] != null) { lnkBtnSearch.Text = "Update"; lblHeading.Text = "Update Event"; lblSubHeading.Text = "Update Event Details"; int _intEventId = 0; _intEventId = Convert.ToInt32(Request.QueryString["id"]); Entity.EventInfo oEventInfo = new Entity.EventInfo(); BLL.EventsLib oEventsLib = new BLL.EventsLib(); oEventInfo = oEventsLib.GetEventByEventId(_intEventId); if (oEventInfo != null) { txtActivity.Text = oEventInfo.StrActivity; txtComments.Text = oEventInfo.StrComments; txtDate.Text = oEventInfo.DtEventDate.ToShortDateString(); txtLocation.Text = oEventInfo.StrLocation; rdoIsActive.SelectedValue = oEventInfo.ChrIsActive.ToString(); rdoApproved.SelectedValue = oEventInfo.ChrStatus.ToString(); } oEventsLib = null; oEventInfo = null; } }