public void UpdateFamily(FamilyView family) { this.HeadOfFamily = family.HeadOfFamily; this.FamilyName = family.FamilyName; this.LadyOfFamily = family.LadyOfFamily; this.FirstDaughterOFFamily = (family.FirstDaughterOFFamily != null) ? family.FirstDaughterOFFamily : null; this.FirstSonOfFamily = (family.FirstSonOfFamily != null) ? family.FirstSonOfFamily : null; this.NumberOfFamilyMembers = family.NumberOfFamilyMembers; }
public Family(FamilyView family) { this.FamilyId = Guid.NewGuid().ToString(); this.HeadOfFamily = family.HeadOfFamily; this.FamilyName = family.FamilyName; this.LadyOfFamily = family.LadyOfFamily; this.FirstDaughterOFFamily = (family.FirstDaughterOFFamily != null) ? family.FirstDaughterOFFamily : null; this.FirstSonOfFamily = (family.FirstSonOfFamily != null) ? family.FirstSonOfFamily : null; this.NumberOfFamilyMembers = family.NumberOfFamilyMembers; }
void ReleaseDesignerOutlets() { if (FamilyView != null) { FamilyView.Dispose(); FamilyView = null; } if (IndividualView != null) { IndividualView.Dispose(); IndividualView = null; } }
public void LayoutSubviews(CGRect parentBounds) { nfloat cellWidth = parentBounds.Width * .98f; if (Family != null) { FamilyView.FormatCell(cellWidth, Family); } else { // since there's no family, have it display a "not found" result FamilyView.FormatCell(cellWidth, Strings.Search_NoResults_Title, Strings.Search_NoResults_Suggestions, "", Strings.Search_NoResults_Suggestion1, Strings.Search_NoResults_Suggestion2); } Button.Bounds = FamilyView.Bounds; }
public async Task <IActionResult> UpdateFamilyAsync(string familyId, [FromBody] FamilyView familyUpdate) { string activityID = Guid.NewGuid().ToString(); EventSourceLogging.Log.RequestLog(activityID, "UpdateFamilyAsync", familyUpdate.ToString() + "-" + familyId); var family = await _context.Families.FindAsync(familyId); if (family == null) { string response = "Given Family is not found."; EventSourceLogging.Log.RequestResponse(activityID, response); return(new NotFoundObjectResult(new Error(StatusCodes.Status404NotFound, response))); } family.UpdateFamily(familyUpdate); _context.Entry(family).State = EntityState.Modified; await _context.SaveChangesAsync(); EventSourceLogging.Log.RequestResponse(activityID, "Success"); return(NoContent()); }
public async Task <IActionResult> AddFamilyAsync([FromBody] FamilyView family) { string activityID = Guid.NewGuid().ToString(); EventSourceLogging.Log.RequestLog(activityID, "AddFamilyAsync", family.ToString()); if (!ModelState.IsValid) { EventSourceLogging.Log.RequestResponse(activityID, "Invalid state"); return(BadRequest()); } Family familyModel = new Family(family); await _context.Families.AddAsync(familyModel); await _context.SaveChangesAsync(); string guid = familyModel.FamilyId; EventSourceLogging.Log.RequestResponse(activityID, guid); return(Ok(familyModel.FamilyId)); }
public ActionResult AddToFamily(FamilyView familymodel) { var ownerId = Operator().OwnerGroupId; Family family = db.Families.Find(familymodel.ID); Person person = db.People.Find(new Guid(familymodel.SectedPersonIdToAdd)); //if (ModelState.IsValid) //{ person.Family = family; db.SaveChanges(); //} var model = Mapper.Map <FamilyView>(family); model.FamilyMembers = db.People.Where(x => x.Family.ID == family.ID).ProjectTo <PersonView>().ToList(); ModelState.Clear(); return(PartialView("_FamilyMembersPartial", model)); }
public void Remove( ) { FamilyView.RemoveFromSuperview( ); }