/// Edit application /// <param name="application"></param> public void EditApplication(Application application) { Application _application = (from app in _context.Application where app.ApplicationId == application.ApplicationId select app).FirstOrDefault(); if (_application == null) { throw new ApplicationException("Application doesnot exist"); } application.University = _universityDAO.GetUniversity(application.UniversityId); application.Applicant = _applicantDAO.GetApplicant(application.ApplicantId); _application.CourseName = application.CourseName.Trim(); _application.PersonalStatement = application.PersonalStatement.Trim(); _application.Firm = application.Firm; _application.TeacherContactDetails = application.TeacherContactDetails.Trim(); _application.TeacherReference = application.TeacherReference.Trim(); _application.UniversityOffer = application.UniversityOffer.Trim(); _application.ApplicantId = application.ApplicantId; _application.UniversityId = application.UniversityId; _context.SaveChanges(); }
public void EditUniversity(University university) { University uni = GetOneUniversity(university.UniversityId); uni.UniversityName = university.UniversityName; _context.SaveChanges(); }
// Edit Applicant Profile public void EditProfile(Profile profile) { Profile prof = GetProfile(profile.ApplicantId); prof.ApplicantName = profile.ApplicantName; prof.ApplicantAddress = profile.ApplicantAddress; prof.Phone = profile.Phone; prof.Email = profile.Email; _context.SaveChanges(); }
public void EditProfile(Applicant applicant) { Applicant applic = GetCurrentProfile(applicant.Id); applic.ApplicantName = applicant.ApplicantName; applic.ApplicantAddress = applicant.ApplicantAddress; applic.Phone = applicant.Phone; applic.Email = applicant.Email; _context.SaveChanges(); }
/*edit Profile*/ public void editProfiles(Profile profile) { Profile _profile = getProfile_Details(profile.ApplicantId); _profile.ApplicantName = profile.ApplicantName; _profile.ApplicantAddress = profile.ApplicantAddress; _profile.Email = profile.Email; _profile.Phone = profile.Phone; _profile.UserId = profile.UserId; _context.SaveChanges(); }
//Edit public method public void EditApplicant(Applicant applicant) { Applicant profile = (from app in _context.Applicant where app.ApplicantId == applicant.ApplicantId select app).ToList <Applicant>().First(); profile.ApplicantName = applicant.ApplicantName; profile.ApplicantAddress = applicant.ApplicantAddress; profile.Phone = applicant.Phone; profile.Email = applicant.Email; _context.SaveChanges(); }
public void ChangeUniversityOffer(int appId, string offer) { IQueryable <Application> _application; _application = from applications in _context.Application where applications.Id == appId select applications; Application _app = _application.ToList <Application>().First(); _app.UniversityOffer = offer; _context.SaveChanges(); }
//Edit public method public void EditUniversity(University university) { var uni = GetUniversity(university.UniversityName.Trim()); if (uni != null && uni.UniversityId != university.UniversityId) { throw new ApplicationException("University with same name already exist."); } University dataUniversity = (from universities in _context.University where universities.UniversityId == university.UniversityId select universities).ToList().First(); dataUniversity.UniversityName = university.UniversityName.Trim(); _context.SaveChanges(); }
public void EditApplication(Application application) { Application app = GetOneApplication(application.ApplicationId); var Count = 0; IQueryable <Application> _firms; _firms = from Application in _context.Application where Application.ApplicantId == app.ApplicantId where Application.Firm == true select Application; Count = _firms.Count(); // If there isn't a firm application already for this user if (Count < 1) { // Make chosen application firm app.Firm = application.Firm; _context.SaveChanges(); } // else if there is already a firm for the user else { // If user is trying to make firm application a non firm one then allow and save changes if (app.Firm == true) { app.Firm = application.Firm; _context.SaveChanges(); } // else do nothing else { // } } }
public void AddProfile(ApplicantProfile profile) { context.ApplicantProfile.Add(profile); context.SaveChanges(); }
/*create Application*/ public void addApplication(Application application) { _context.Application.Add(application); _context.SaveChanges(); }
public void CreateUserProfile(NAA_User_Profile newProfile) { _context.NAA_User_Profile.Add(newProfile); _context.SaveChanges(); }