public bool FindUserId(string userId) { var user = rp.GetAll().Find(x => x.NationalId == userId); if (user != null) { return(true); } return(false); }
public List <RegisterModel> GetAllPatients() { using (var deprepo = new RegisterRepository()) { return(deprepo.GetAll().Where(x => x.Role == "Staff").Select(x => new RegisterModel() { Email = x.Email, FullName = x.FullName, Surname = x.Surname, Title = x.Title, MaritalStatus = x.MaritalStatus, DOB = x.DOB, Age = x.Age, Sex = x.Sex, Address1 = x.Address1, Address2 = x.Address2, Address3 = x.Address3, PostalCode = x.PostalCode, Telephone = x.Telephone, Employer = x.Employer, EmployerTelephone = x.EmployerTelephone, Occupation = x.Occupation, NationalId = x.NationalId, Status = x.Status, MedicalAidName = x.MedicalAidName, MedicalAidNo = x.MedicalAidNo }).ToList()); } }
public static async Task <List <RegisterViewModel> > GetRegisterAllAsync() { List <RegisterViewModel> rvmList = new List <RegisterViewModel>(); var registers = _Register.GetAll().ToList(); registers.ForEach(f => rvmList.Add(new RegisterViewModel() { Address = _Address.GetAsync(new Func <Address, bool>((x) => x.IdRecord == f.Id)).Result, Register = f }) ); return(rvmList); }