protected void btnSubmit_Click(object sender, EventArgs e) { try { if (txtComments.Text != string.Empty) { string today = DateTime.Now.ToString(); if (today.IndexOf(" A") != -1) { today = today.Replace(" A", "A"); } if (today.IndexOf(" P") != -1) { today = today.Replace(" P", "P"); } // string Date = string.Format("{0} {1}", today.ToShortDateString(), today.ToLongTimeString()); App_Data.OrgEvent eventForEdit = getCurrentEvent(); EventDAO.createEventComment(txtComments.Text, eventForEdit.Event_ID, today, HttpContext.Current.User.Identity.Name); grdComments.DataSource = EventDAO.getCommentsByEventID(eventForEdit.Event_ID); grdComments.DataBind(); txtComments.Text = string.Empty; } } catch (Exception) { lblMessage.Text = "Comment not added!!"; } }
protected void btnCancel_Click(object sender, EventArgs e) { try { App_Data.OrgEvent eventForEdit = getCurrentEvent(); txtEditEventDate.Text = Convert.ToDateTime(eventForEdit.Date).ToShortDateString(); txtEditEventTime.Text = eventForEdit.Time; txtEditEventTitle.Text = eventForEdit.Title; ddlEditEventOrgEncharge.SelectedValue = eventForEdit.Organization_ID.ToString(); txtEditEventOrgWorkedWith.Text = eventForEdit.OrganizationWorkedWith; if (eventForEdit.OnOffCampus == true) { chkEventLocationOffCampus.Checked = true; } txtEditEventContactPerson.Text = eventForEdit.ContactName.ToString(); txtEditEventLocation.Text = eventForEdit.Location; txtEditEventDescription.Text = eventForEdit.Description; txtEditEventPhone.Text = eventForEdit.ContactPhone; txtEditEventEmailID.Text = eventForEdit.ContactEmail; txtEditEventAttendence.Text = eventForEdit.Attendance.ToString(); //added per Jake/Katie for MyOrgs project txtCreatedByUser.Text = eventForEdit.CreatedByUser; //added per Jake/Katie for MyOrgs project if (eventForEdit.RoomReserved == true) { CBroomreserved.Checked = true; } if (eventForEdit.Marketing == true) { CBmarketing.Checked = true; } if (eventForEdit.Catering == true) { CBcatering.Checked = true; } if (eventForEdit.SignupForm == true) { CBsignupform.Checked = true; } if (eventForEdit.ActivityWaiver == true) { CBactivitywaiver.Checked = true; } if (eventForEdit.CUNight == true) { CBcunight.Checked = true; } } catch (Exception) { lblMessage.Text = "Unable to retrieve the event data!!"; } }
protected void btnSubmitAll_Click(object sender, EventArgs e) { try { App_Data.OrgEvent eventForEdit = getCurrentEvent(); if (txtComments.Text != string.Empty) { string today = DateTime.Now.ToString(); if (today.IndexOf(" A") != -1) { today = today.Replace(" A", "A"); } if (today.IndexOf(" P") != -1) { today = today.Replace(" P", "P"); } EventDAO.createEventComment(txtComments.Text, eventForEdit.Event_ID, today, HttpContext.Current.User.Identity.Name); grdComments.DataSource = EventDAO.getCommentsByEventID(eventForEdit.Event_ID); grdComments.DataBind(); } driverList = UploadedDrivers; string driver2 = string.Empty; string driver1 = string.Empty; if (driverList.Count >= 1) { driver1 = driverList[0].Student_ID.ToString(); } if (driverList.Count >= 2) { driver2 = driverList[1].Student_ID.ToString(); } //Removed Volunteer Hours field, per Jake/Katie. They need to enter a Service Project for that. EventDAO.updateEvent(eventForEdit.Event_ID, Convert.ToInt32(ddlEditEventOrgEncharge.SelectedValue), string.IsNullOrEmpty(txtEditEventDate.Text) ? null : txtEditEventDate.Text, txtEditEventTime.Text, txtEditEventLocation.Text, txtEditEventDescription.Text, txtEditEventOrgWorkedWith.Text, txtEditEventPhone.Text, txtEditEventEmailID.Text, string.IsNullOrEmpty(txtEditEventAttendence.Text) ? null : txtEditEventAttendence.Text, "0", /*Vol Hrs field*/ string.IsNullOrEmpty(txtEditEventDollarSpend.Text) ? null : txtEditEventDollarSpend.Text, string.IsNullOrEmpty(txtDollarSpentByPartner.Text) ? null : txtDollarSpentByPartner.Text, txtEditEventTitle.Text, chkEventLocationOffCampus.Checked, string.IsNullOrEmpty(txtEditEventVan.Text) ? null : txtEditEventVan.Text, string.IsNullOrEmpty(txtEditEventBus.Text) ? null : txtEditEventBus.Text, txtEditEventContactPerson.Text, string.IsNullOrEmpty(driver1) ? null : driver1, string.IsNullOrEmpty(driver2) ? null : driver2, CBroomreserved.Checked ? 1 : 0, CBmarketing.Checked ? 1 : 0, CBcatering.Checked ? 1: 0, CBsignupform.Checked ? 1 : 0, CBactivitywaiver.Checked ? 1 : 0, CBcunight.Checked ? 1 : 0); clearAlltext(); } catch (Exception ex) { lblMessage.Text = "Changes were not submitted!!" + ex.ToString(); } }
protected void bntDeleteAll_Click(object sender, EventArgs e) { App_Data.OrgEvent eventForEdit = getCurrentEvent(); EventDAO.deleteEvent(eventForEdit.Event_ID); clearAlltext(); //we need to re-retrieve the gridediteventresults list after the delete. int idorganization = Convert.ToInt32(ddlSelectOrganization.SelectedValue); gridediteventresults.DataSource = EventDAO.getEventByOrgID(idorganization); gridediteventresults.DataBind(); }
protected void btnEditEventMoreInfoCancel_Click1(object sender, EventArgs e) { UploadedDrivers.Clear(); pnlEditing.Visible = true; btnCancelAll.Visible = true; btnSubmitAll.Visible = true; App_Data.OrgEvent eventForEdit = getCurrentEvent(); txtEditEventBus.Text = eventForEdit.BusRental.ToString(); txtEditEventVan.Text = eventForEdit.VanRental.ToString(); txtEditEventDollarSpend.Text = eventForEdit.DollarsSpentByOrg.ToString(); txtDollarSpentByPartner.Text = eventForEdit.DollarsSpentByPartner.ToString(); //added per Jake/Katie for MyOrgs project txtCreatedByUser.Text = eventForEdit.CreatedByUser; UploadedDrivers = EventDAO.getDriversForEvent(Convert.ToInt32(eventForEdit.Driver1), Convert.ToInt32(eventForEdit.Driver2)); grdEditEventDrivers.DataSource = UploadedDrivers; grdEditEventDrivers.DataBind(); }
public void PopulateInformationEvent() { pnlSelection.Visible = false; pnlEditing.Visible = true; UploadedDrivers.Clear(); ddlSelectDrivers.Items.Clear(); ListItem select = new ListItem("Select Driver", "-1"); ddlSelectDrivers.Items.Add(select); ddlSelectDrivers.DataSource = EventDAO.getStudentDriverList(); ddlSelectDrivers.DataTextField = "Name"; ddlSelectDrivers.DataValueField = "Student_ID"; ddlSelectDrivers.DataBind(); try { App_Data.OrgEvent eventForEdit = getCurrentEvent(); txtEditEventDate.Text = Convert.ToDateTime(eventForEdit.Date).ToShortDateString(); txtEditEventTime.Text = eventForEdit.Time; txtEditEventTitle.Text = eventForEdit.Title; ddlEditEventOrgEncharge.DataSource = OrganizationDAO.getOrganizationList(); ddlEditEventOrgEncharge.DataTextField = "OrganizationName"; ddlEditEventOrgEncharge.DataValueField = "Organization_ID"; ddlEditEventOrgEncharge.DataBind(); ddlEditEventOrgEncharge.SelectedValue = eventForEdit.Organization_ID.ToString(); txtEditEventOrgWorkedWith.Text = eventForEdit.OrganizationWorkedWith; if (eventForEdit.OnOffCampus == true) { chkEventLocationOffCampus.Checked = true; } txtEditEventContactPerson.Text = eventForEdit.ContactName; txtEditEventLocation.Text = eventForEdit.Location; txtEditEventDescription.Text = eventForEdit.Description; txtEditEventPhone.Text = eventForEdit.ContactPhone; txtEditEventEmailID.Text = eventForEdit.ContactEmail; txtEditEventBus.Text = eventForEdit.BusRental.ToString(); txtEditEventVan.Text = eventForEdit.VanRental.ToString(); txtEditEventDollarSpend.Text = eventForEdit.DollarsSpentByOrg.ToString(); txtDollarSpentByPartner.Text = eventForEdit.DollarsSpentByPartner.ToString(); txtEditEventAttendence.Text = eventForEdit.Attendance.ToString(); //added per Jake/Katie for MyOrgs project txtCreatedByUser.Text = eventForEdit.CreatedByUser; if (eventForEdit.RoomReserved == true) { CBroomreserved.Checked = true; } if (eventForEdit.Marketing == true) { CBmarketing.Checked = true; } if (eventForEdit.Catering == true) { CBcatering.Checked = true; } if (eventForEdit.SignupForm == true) { CBsignupform.Checked = true; } if (eventForEdit.ActivityWaiver == true) { CBactivitywaiver.Checked = true; } if (eventForEdit.CUNight == true) { CBcunight.Checked = true; } UploadedDrivers = EventDAO.getDriversForEvent(Convert.ToInt32(eventForEdit.Driver1), Convert.ToInt32(eventForEdit.Driver2)); grdEditEventDrivers.DataSource = UploadedDrivers; grdEditEventDrivers.DataBind(); //Bind Comments to grid grdComments.DataSource = EventDAO.getCommentsByEventID(eventForEdit.Event_ID); grdComments.DataBind(); } catch (Exception) { lblMessage.Text = "Unable to retrieve the event data!!"; } }