public Member GetMember(string id) { if (_membersRepository.GetMember(id) == null) { throw new KeyNotFoundException("Member not found"); } return(_membersRepository.GetMember(id)); }
public void CreateCart(string email) { Cart c = new Cart(); c.Email = _memberRepo.GetMember(email).Email; _cartRepo.CreateCart(c); }
public void AddSubmission(SubmissionViewModel submission) { Submission sub = new Submission(); sub.Assignment = _assignmentsRepository.GetAssignment(submission.Assignment.Id); sub.Member = _membersRepository.GetMember(submission.Member.Email); sub.FilePath = submission.FilePath; sub.FileHash = submission.FileHash; sub.Signature = submission.Signature; sub.SymmetricIV = submission.SymmetricIV; sub.SymmetricKey = submission.SymmetricKey; _submissionsRepository.AddSubmission(sub); }
public MemberViewModel GetMember(string email) { var p = _membersRepo.GetMember(email); if (p == null) { return(null); } else { var result = _autoMapper.Map <MemberViewModel>(p); return(result); } }
public MemberViewModel GetMember(string email) { var mem = _membersRepo.GetMember(email); if (mem == null) { return(null); } else { var res = _autoMapper.Map <MemberViewModel>(mem); return(res); } }
public MemberViewModel GetMember(string email) { MemberViewModel m = new MemberViewModel(); var member = _membersRepository.GetMember(email); if (member != null) { m.Email = member.Email; m.FirstName = member.FirstName; m.LastName = member.LastName; m.PrivateKey = member.PrivateKey; m.PublicKey = member.PublicKey; m.TeacherEmail = member.TeacherEmail; return(m); } return(null); }
public IActionResult Membership(MemberEditViewModel model) { if (ModelState.IsValid) { Member member = _membersRepository.GetMember(model.Id); if (member == null) { var newMember = new Member { Id = model.Id, FirstName = model.FirstName, LastName = model.LastName, Address = model.Address, DateOfBirth = model.DateOfBirth, User = model.User, UserMembershipId = model.UserMembershipId, PhoneNUmber = model.PhoneNUmber }; _membersRepository.Add(newMember); return(RedirectToAction("index")); } member.FirstName = model.FirstName; member.LastName = model.LastName; member.Address = model.Address; member.DateOfBirth = model.DateOfBirth; member.User = model.User; member.UserMembershipId = model.UserMembershipId; member.PhoneNUmber = model.PhoneNUmber; _membersRepository.Update(member); return(RedirectToAction("index")); } return(View()); }
public Member GetMember(Guid id) { return(_membersRepository.GetMember(id)); }
public MemberViewModel GetMember(string name) { return(_mapper.Map <MemberViewModel>(_membersRepo.GetMember(name))); }
Member IMembersQuery.GetMember(Guid id) { return(_repository.GetMember(id)); }
public ActionResult <Member> GetMember(Guid id) { return(StatusCode(200, _membersRepository.GetMember(id))); }
public Member GetMember(string email) { return(_membersRepo.GetMember(email)); }