public void CreateNewMember(ZSysUserDTO Member) { int membershipId = Convert.ToInt32(Member.membership); var userMembershipId = _zsysUserRepository.CreateNewMember(new ZSysUser { FirstName = Member.firstName, LastName = Member.lastName, AddressLine1 = Member.address1, AddressLine2 = Member.address2, DOB = Member.DOB, Email = Member.email, Notes = Member.notes, UserName = Member.UserName }); var membershipDetails = GetAllMembershipDetails().FirstOrDefault(t => t.Id == membershipId).Result; var membershipFees = membershipDetails.MembershipFee + Convert.ToInt32(membershipDetails.MembershipPrice); var userMembershipStatus = _zsysUserRepository.CreateNewUserMembershipDetails(new UserMembership { Discount_InPerc = Convert.ToInt32(Member.discount), MembershipStartDate = DateTime.Now, MembershipEndDate = DateTime.Now.AddMonths(membershipDetails.MembershipMonths), MembershipFee = membershipFees, MembershipId = membershipId, UserMembershipId = userMembershipId }); //return await _zsysUserRepository.CreateNewMember(model); }
public async Task <bool> CreateNewMember(ZSysUserDTO Member) { var model = _mapper.Map <ZSysUser>(Member); return(await _zsysUserRepository.CreateNewMember(model)); }