protected void btnSubmit_OnClick(object sender, EventArgs e) { pnlOpportunities.Visible = true; pnlSignature.Visible = false; pnlSuccess.Visible = true; AttributeValueService attributeValueService = new AttributeValueService(rockContext); PersonService personService = new PersonService(rockContext); List<Guid> personGuidList = new List<Guid>(); personGuidList.Add(_targetPerson.Guid); var p = attributeValueService.GetByAttributeIdAndEntityId(906, _targetPerson.Id); var p2 = attributeValueService.GetByAttributeIdAndEntityId(1434, _targetPerson.Id); var personFromService = personService.GetByGuids(personGuidList).FirstOrDefault(); DateTime dateToSave = DateTime.Now.AddYears(CurrentYearAdd); p.Value = dateToSave.ToString(); if (p2.Value.IsNullOrWhiteSpace()) { p2.Value = dateToSave.Year.ToString(); } else { if (!p2.Value.Contains(dateToSave.Year.ToString())) { p2.Value = p2.Value + "," + dateToSave.Year.ToString(); } } personFromService.ConnectionStatusValue.Value = "Partner"; personFromService.ConnectionStatusValueId = 65; rockContext.SaveChanges(); LoadOpportunities(); if (GetAttributeValue("SendConfirmationEmail") == "True") { SendEmail(personFromService.Email, CurrentDateTime.Year.ToString() + " Partnership Covenant", rockContext); } }
protected void mdAge_OnSaveClick(object sender, EventArgs e) { PersonService personService = new PersonService(rockContext); List<Guid> personGuidList = new List<Guid>(); personGuidList.Add(_targetPerson.Guid); var personFromService = personService.GetByGuids(personGuidList).FirstOrDefault(); personFromService.SetBirthDate(dpBirthDate.SelectedDate); rockContext.SaveChanges(); mdAge.Hide(); Response.Redirect(Request.RawUrl); }