//מוסיפה ילד חדש public static bool NewChild(child newChild) { if (volunteeringET.child.FirstOrDefault(child => child.tz == newChild.tz) == null) { volunteeringET.child.Add(newChild); volunteeringET.SaveChanges(); return(true); } return(false); }
//מאשרת בקשת התנדבות public static bool contentedVolunteering(int volunteerOfChildID) { volunteerOfChild v = volunteeringET.volunteerOfChild.Find(volunteerOfChildID); if (v != null) { v.status = EStatus.contented.ToString(); volunteeringET.SaveChanges(); return(true); } return(false); }
//מסירה מתנדב ע"י ת.ז public static bool removeVolunteerByID(int id) { volunteer v = volunteeringET.volunteer.Find(id); if (v != null) { volunteeringET.volunteer.Remove(v); volunteeringET.SaveChanges(); GlobalBL.SendEmail(v.mail, "הסרה מהאתר ידיד לילד", "הוסרת מאתר ידיד לילד מאחר ולא התקבל ממך שירות זמן רב"); return(true); } else { return(false); } }
//מוסיפה משפחה public static bool newFamily(family family) { if (volunteeringET.family.FirstOrDefault(f => f.mail == family.mail) == null) { volunteeringET.family.Add(family); volunteeringET.SaveChanges(); return(true); } return(false); }
// מתנדב מאשר השתתפות באירוע public static bool approvalParticipationInEvent(int id) { eventOfVolunteer eventOfVolunteer = volunteeringET.eventOfVolunteer.Find(id); if (eventOfVolunteer != null) { eventOfVolunteer.IsParticipant = eIsParticipant.participation.ToString(); volunteeringET.SaveChanges(); return(true); } return(false); }
public bool addNewEvents(eventsVolunteer eventsVolunteer) { if (eventsVolunteer != null && ModelState.IsValid == true) { volunteeringET.eventsVolunteer.Add(eventsVolunteer); volunteeringET.SaveChanges(); return(true); } else { return(false); } }
//מוסיפה סוג התנדבות למתנדב/מוגבלות לילד חדש public static bool addtypeDisability(typeDisability typeDisability) { if (volunteeringET.typeDisability.FirstOrDefault(t => t.childId == typeDisability.childId) == null) { volunteeringET.typeDisability.Add(typeDisability); volunteeringET.SaveChanges(); return(true); } else { return(false); } }