protected void btAddCircle_Click(object sender, EventArgs e) { signedOutErrorContainer.Visible = false; var circleName = ((tbCircleInput.Text).Trim()).Replace(" ", "").ToLower(); if (String.IsNullOrEmpty(tbCircleInput.Text)) { GeneralHelpers.AddValidationError(Page, "addCircleGroup", "Required fields are not filled up"); } if (addUserCircleList.Where(uc => uc.CircleId == circleName).Count() > 0 || existingUserCircleList.Where(uc => uc.CircleId == circleName).Count() > 0) { GeneralHelpers.AddValidationError(Page, "addCircleGroup", "There are duplicate circles present"); } if (!Page.IsValid) { signedOutErrorContainer.Visible = true; lbErrorMsg.Text = GeneralHelpers.GetFirstValidationError(Page.Validators); } else { UserCircle newUserCircle = new UserCircle(); newUserCircle.CircleId = circleName; newUserCircle.UserId = currentUser.Id; addUserCircleList.Add(newUserCircle); } tbCircleInput.Text = ""; tbCircleInput.Focus(); rptUpdateCircles.DataSource = existingUserCircleList.Concat(addUserCircleList); rptUpdateCircles.DataBind(); updateCirclesModal(); }
protected void btSubmit_Click(object sender, EventArgs e) { signedOutErrorContainer.Visible = false; Page.Validate(); if (!existingUserCircleList.Concat(addUserCircleList).Any()) { GeneralHelpers.AddValidationError(Page, "addUserCirclesGroup", "No circles have been added"); } if (!Page.IsValid) { signedOutErrorContainer.Visible = true; lbErrorMsg.Text = GeneralHelpers.GetFirstValidationError(Page.Validators, "addUserCirclesGroup"); } else { foreach (UserCircle userCircle in removeUserCircleList) { UserCircleDAO.ChangeUserCirclePoints( userId: userCircle.UserId, circleName: userCircle.CircleId, points: -50, source: "Removing the circle", addNotification: true ); UserCircleDAO.RemoveUserCircle(userCircle.Id); } foreach (UserCircle userCircle in addUserCircleList) { UserCircle addedUserCircle = UserCircleDAO.AddUserCircle(userCircle); UserCircleDAO.ChangeUserCirclePoints( userId: addedUserCircle.UserId, circleName: addedUserCircle.CircleId, points: 50, source: "Joining the circle", addNotification: true ); } Response.Redirect("/Redirect.aspx"); } }
protected void submitButt_Click(object sender, EventArgs e) { Event newEventData = new Event(); EventSchedule eventSchedule = new EventSchedule(); currentUser = (BLL.User)Session["currentUser"]; signedOutErrorContainer.Visible = false; if (String.IsNullOrEmpty(eventTitleTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Event Title not filled up under basic info!"); } if (String.IsNullOrEmpty(eventDescriptionTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Event Title not filled up under basic info!"); } if (String.IsNullOrEmpty(CategoryDropDownList.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Category not selected!"); } if (String.IsNullOrEmpty(organizerTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Orgainzer not filled up under basic info"); } if (LocationDLL.Text == "Venue") { if (String.IsNullOrEmpty(LocationTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Venue place not filled up under Location"); } } else { if (String.IsNullOrEmpty(LocationDLL.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Don't itchy hand delete the values from f12"); } } if (String.IsNullOrEmpty(startDateTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Start Date not filled up under Date And Time"); } if (String.IsNullOrEmpty(endDateTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "End Date nor filled up under Date And Time"); } if (String.IsNullOrEmpty(startTimeDLL.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Start Date nor filled up under Date And Time"); } if (String.IsNullOrEmpty(endTimeDLL.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Start Date nor filled up under Date And Time"); } DateTime startDate; DateTime endDate; DateTime.TryParse(startDateTB.Text, out startDate); DateTime.TryParse(endDateTB.Text, out endDate); string startTime = startTimeDLL.Text; string endTime = endTimeDLL.Text; string startTimeHour = startTime.Substring(0, 2); string startTimeMinutes = startTime.Substring(2, 2); string endTimeHour = endTime.Substring(0, 2); string endTimeMinutes = endTime.Substring(2, 2); if (startDate > endDate) { GeneralHelpers.AddValidationError(Page, "addEvent", "why start date later than end date?"); } else { if (startDate == endDate) { if (Int32.Parse(startTimeHour) > Int32.Parse(endTimeHour)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Start Time cannot be Later than End Time Since Date is the same"); } } } if (entryFeeStatusDDL.Text == "Not Free") { if (String.IsNullOrEmpty(entryFeeTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Entry Fee not filled up under Details"); } } else { if (String.IsNullOrEmpty(entryFeeStatusDDL.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Don't itchy hand delete the values from f12"); } } if (maxTimeAPersonCanRegisterDLL.Text == "Limit") { if (String.IsNullOrEmpty(maxTimeAPersonCanRegisterTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Max Time A Person Can Register not filled up under Details"); } } else { if (String.IsNullOrEmpty(maxTimeAPersonCanRegisterDLL.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Don't itchy hand delete the values from f12"); } } if (maxSlotAvaliableDDL.Text == "Limit") { if (String.IsNullOrEmpty(maxSlotTB.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Max Time A Person Can Register not filled up under Details"); } } else { if (String.IsNullOrEmpty(maxSlotAvaliableDDL.Text)) { GeneralHelpers.AddValidationError(Page, "addEvent", "Don't itchy hand delete the values from f12"); } } if (!(imageUpload.HasFile && (imageUpload.PostedFile.ContentType == "image/jpeg" || imageUpload.PostedFile.ContentType == "image/jpeg" || imageUpload.PostedFile.ContentType == "image/png"))) { GeneralHelpers.AddValidationError(Page, "addEvent", "File empty or upload wrong format"); } if (!Page.IsValid) { signedOutErrorContainer.Visible = true; lbErrorMsg.Text = GeneralHelpers.GetFirstValidationError(Page.Validators); } else { newEventData.eventName = eventTitleTB.Text; newEventData.eventDescription = eventDescriptionTB.Text; newEventData.eventCategory = CategoryDropDownList.SelectedItem.Text; System.Diagnostics.Debug.WriteLine("hello world testing11" + CategoryDropDownList.SelectedItem.Text); System.Diagnostics.Debug.WriteLine("hello world testing12" + CategoryDropDownList.SelectedValue); System.Diagnostics.Debug.WriteLine("hello world testing13" + CategoryDropDownList.SelectedItem.Value); newEventData.eventHolderName = organizerTB.Text; newEventData.eventHolderId = currentUser.Id; if (LocationDLL.Text == "To Be Announced") { newEventData.eventLocation = LocationDLL.Text; } else { newEventData.eventLocation = LocationTB.Text; } newEventData.eventLocation = LocationTB.Text; newEventData.eventStartDate = startDateTB.Text; newEventData.eventEndDate = endDateTB.Text; newEventData.eventStartTime = startTimeDLL.Text; newEventData.eventEndTime = endTimeDLL.Text; newEventData.eventEntryFeesStatus = entryFeeStatusDDL.Text; var imagePath = GeneralHelpers.UploadFile(imageUpload); //System.Diagnostics.Debug.WriteLine("hello world testing",imagePath); newEventData.eventImage = imagePath; newEventData.eventStatus = "onGoing"; if (singleEventRadioButton.Checked) { newEventData.singleOrRecurring = "Single"; } if (entryFeeStatusDDL.Text == "Free") { newEventData.eventTicketCost = "$0.00"; } else { newEventData.eventTicketCost = "$" + entryFeeTB.Text; } if (maxTimeAPersonCanRegisterDLL.Text == "No Limit") { newEventData.maxTimeAPersonCanRegister = maxTimeAPersonCanRegisterDLL.Text; } else { newEventData.maxTimeAPersonCanRegister = maxTimeAPersonCanRegisterTB.Text; } if (maxSlotAvaliableDDL.Text == "No Limit") { newEventData.eventMaxSlot = maxSlotAvaliableDDL.Text; } else { newEventData.eventMaxSlot = maxSlotTB.Text; } if (LocationDLL.Text == "To Be Announced") { newEventData.eventLocation = "To Be Announced"; } else { newEventData.eventLocation = LocationTB.Text; } UserCircleDAO.ChangeUserCirclePoints(currentUser.Id, CategoryDropDownList.Text, 20, "Creating An Event", true); Event newCreatedEvt = newEventData.AddNewEvent(); Response.Redirect("EventSchedulePage.aspx?eventID=" + newCreatedEvt.eventId); } }
protected void submitButt_Click(object sender, EventArgs e) { SignUpEventDetail newEventSignUpEventData = new SignUpEventDetail(); EventSchedule eventSchedule = new EventSchedule(); List <String> userOptInEvent = new List <string>(); string selectedEventToParticipate = ""; int bookingQuantity = 0; foreach (Control control in rpEventSchedule.Controls) { var OptIncheckBox = (CheckBox)control.FindControl("optInCB"); var eventDescriptionLabel = (Label)control.FindControl("eventDescription"); var eventScheduleId = (Label)control.FindControl("secretEventSheduleId"); if (OptIncheckBox.Checked) { userOptInEvent.Add(eventScheduleId.Text); selectedEventToParticipate += eventScheduleId.Text + ","; } } //if (String.IsNullOrEmpty(NumberOfBookingSlotsTB.Text)) //{ // GeneralHelpers.AddValidationError(Page, "registerEvent", "Booking Slot Amount is empty"); //} if (NumberOfBookingSlotsDLL.Text == "Please Select Number of Slots") { GeneralHelpers.AddValidationError(Page, "registerEvent", "Please select numbers only"); } if (!Page.IsValid) { signedOutErrorContainer.Visible = true; lbErrorMsg.Text = GeneralHelpers.GetFirstValidationError(Page.Validators); } else { newEventSignUpEventData.name = nameTB.Text; newEventSignUpEventData.contactNumber = contactNumberTB.Text; currentUser = (BLL.User)Session["currentUser"]; newEventSignUpEventData.userId = currentUser.Id; System.Diagnostics.Debug.WriteLine("gh say hello: " + NumberOfBookingSlotsDLL.Text); if (NumberOfBookingSlotsDLL.Text != "") { newEventSignUpEventData.numberOfBookingSlot = NumberOfBookingSlotsDLL.Text; bookingQuantity = Int32.Parse(NumberOfBookingSlotsDLL.Text); } else { newEventSignUpEventData.numberOfBookingSlot = NumberOfBookingSlotsTB.Text; bookingQuantity = Int32.Parse(NumberOfBookingSlotsTB.Text); } newEventSignUpEventData.selectedEventToParticipate = selectedEventToParticipate; newEventSignUpEventData.eventId = currentEventID; newEventSignUpEventData.date = dateDDL.Text; // System.Diagnostics.Debug.WriteLine(String.Join("\n", userOptInEvent)); //System.Diagnostics.Debug.WriteLine(currentUser.Name); //System.Diagnostics.Debug.WriteLine("gh say hello: " + NumberOfBookingSlotsDLL.Text); newEventSignUpEventData.Add(); eventSchedule.AddAndUpdateUserOptIn(selectedEventToParticipate, currentUser.Id); var totalCost = TotalCost.Text; if (singleEventDetails.eventEntryFeesStatus == "Free") { Response.Redirect("ViewAllEventPage.aspx"); } else { goPayPalRoute(bookingQuantity); } } }