public bool UpdateVolunteer(Dto.Volunteer volunteer) { var vol = new chrisparkeronline.com.Dal.DataModel.Volunteer { FullName = volunteer.Name, DOB = volunteer.DateOfBirth, CenterId = volunteer.FoodBankId, VolunteerId = volunteer.Id }; var dal = new CpoDataLayer(); return dal.UpdateVolunteer(vol); }
public Dto.Volunteer CreateVolunteer(Dto.Volunteer newVolunteer) { var value = new chrisparkeronline.com.Dal.DataModel.Volunteer { CenterId = newVolunteer.FoodBankId, DOB = newVolunteer.DateOfBirth, FullName = newVolunteer.Name, DateCreated = DateTime.Now }; var dal = new CpoDataLayer(); var addedVolunteer = dal.CreateVolunteer(value); if (addedVolunteer != null) { return new Dto.Volunteer { FoodBankId = addedVolunteer.CenterId, DateOfBirth = addedVolunteer.DOB, Name = addedVolunteer.FullName, Id = addedVolunteer.VolunteerId, Created = addedVolunteer.DateCreated }; } return null; }