Пример #1
0
        public IActionResult Matches()
        {
            var user = authProvider.GetCurrentUser();

            AllInformationModel AllInfo = new AllInformationModel();

            AllInfo.AllUsers = profileSearchDAL.GetMatches();

            AllInfo.CurrentUser        = AllInfo.GetCurrentGamer(AllInfo.AllUsers, user.Username);
            AllInfo.GamerMatchStrength = AllInfo.Matches(AllInfo.AllUsers, AllInfo.CurrentUser);
            return(View(AllInfo));
        }
        public List <AllInformationModel> GiveNameToTreatment(List <Treatment> treatments)
        {
            List <AllInformationModel> allInformationModels = new List <AllInformationModel>();

            foreach (Treatment treatment in treatments)
            {
                AllInformationModel allInformation = new AllInformationModel();
                allInformation.DiseaseName  = headGateway.GetDiseaseNamebyId(treatment.DiseaseId).Name;
                allInformation.MedicineName = headGateway.GetMedicineNamebyId(treatment.MedicineId).GenericName;
                allInformation.Dose         = GetDoseById(Convert.ToInt32(treatment.Dose));
                allInformation.DoseTimeName = treatment.DoseTime == 1 ? "Before Meal" : "After Meal";
                allInformation.Quantity     = treatment.Quantity;
                allInformation.Note         = treatment.Note;
                allInformationModels.Add(allInformation);
            }
            return(allInformationModels);
        }
Пример #3
0
        public IActionResult Index(User userProfile)
        {
            var user      = authProvider.GetCurrentUser();
            var container = profileDAO.GetProfile(user.Username);
            AllInformationModel AllInfo = new AllInformationModel();

            if (container.GameTitles.Count != 0 && container.GenreNames.Count != 0)
            {
                if (container.GameTitles.Count != 0 && container.GenreNames.Count != 0)
                {
                    AllInfo.AllUsers        = profileSearchDAL.GetMatches();
                    AllInfo.CurrentUser     = AllInfo.GetCurrentGamer(AllInfo.AllUsers, user.Username);
                    container.MatchStrength = AllInfo.Matches(AllInfo.AllUsers, AllInfo.CurrentUser);
                    container.MatchStrength = AllInfo.RemoveCurrentGamer(container.MatchStrength, user.Username);
                    container.TopThree      = AllInfo.GetTopThree(container.MatchStrength);
                }
            }
            return(View(container));
        }
Пример #4
0
        public IActionResult GamerProfile(int id)
        {
            var profile = profileSearchDAL.GetProfile(id);

            profile = profileDAL.GetProfile(profile.Username);
            AllInformationModel AllInfo = new AllInformationModel();
            var user        = authProvider.GetCurrentUser();
            var currentUser = profileDAL.GetProfile(user.Username);

            profile.IsPopulated = false;
            if (currentUser.GameTitles.Count != 0 && currentUser.GenreNames.Count != 0)
            {
                AllInfo.AllUsers      = profileSearchDAL.GetMatches();
                AllInfo.CurrentUser   = AllInfo.GetCurrentGamer(AllInfo.AllUsers, user.Username);
                profile.MatchStrength = AllInfo.Matches(AllInfo.AllUsers, AllInfo.CurrentUser);
                profile.IsPopulated   = true;
            }
            return(View(profile));
        }