Пример #1
0
        public ActionResult settings()
        {
            MsInUsEntities        connection = new MsInUsEntities();
            List <SelectListItem> year       = new List <SelectListItem>();

            for (int p = DateTime.Today.Year - 40; p < DateTime.Today.Year - 16; p++)
            {
                year.Add(new SelectListItem()
                {
                    Text = Convert.ToString(p), Value = Convert.ToString(p), Selected = (DateTime.Today.Year - 14 == p)
                });
            }
            UserProfile        userprofile = new UserProfile();
            FullProfile        fullprofile = new FullProfile();
            ProfilesController pc          = new ProfilesController();
            int id = Convert.ToInt32(Session["UserId"]);

            userprofile = connection.UserProfiles.Find(keyValues: id);
            if (userprofile.DOB != null)
            {
                userprofile.DOBMonth = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(userprofile.DOB.Value.Month);
                userprofile.DOBYear  = userprofile.DOB.Value.Year;
                userprofile.DOBday   = userprofile.DOB.Value.Day;
            }
            pc.initilization(fullprofile);
            userprofile.FullProfile = fullprofile;
            userprofile.doBirthYear = year;
            return(View(userprofile));
        }
        public ActionResult Index()
        {
            int         id = Convert.ToInt32(Session["UserId"]);
            FullProfile fs = connection.FullProfiles.SingleOrDefault(m => m.Id == id);

            if (fs.Toefl == true)
            {
                fs.score = (fs.TIListening + fs.TIReading + fs.TISpeaking + fs.TIWriting).ToString();
            }
            else if (fs.Ielts == true)
            {
                fs.score = ((fs.TIListening + fs.TIReading + fs.TISpeaking + fs.TIWriting) / 4).ToString();
            }
            if (fs.Toefl == null && fs.Ielts == null)
            {
                fs.Toefl = true;
            }
            MsInUsa.Controllers.ProfilesController cobj = new ProfilesController();
            cobj.initilization(fs);
            return(View(fs));
        }
        public ActionResult Index(FullProfile fs)
        {
            decimal?score = getscore(fs);

            if (fs.Toefl == true)
            {
                fs.score = (fs.TIListening + fs.TIReading + fs.TISpeaking + fs.TIWriting).ToString();
            }
            else if (fs.Toefl == false)
            {
                fs.score = ((fs.TIListening + fs.TIReading + fs.TISpeaking + fs.TIWriting) / 4).ToString();
            }
            if (fs.Toefl == null && fs.Ielts == null)
            {
                fs.Toefl = true;
            }
            fs.ambUniv  = connection.Universities_list.Where(m => (m.OverallScore >= score + 1 && m.University_Deadlines.Any(c => c.Course == fs.MSCourse))).OrderBy(m => m.OverallScore).Take(5).ToList();
            fs.modUniv  = connection.Universities_list.Where(m => (m.OverallScore > score && m.OverallScore < score + 1 && m.University_Deadlines.Any(c => c.Course == fs.MSCourse))).OrderBy(m => m.OverallScore).Take(5).ToList();
            fs.safeUniv = connection.Universities_list.Where(m => ((m.OverallScore <= score || m.OverallScore == null) && m.University_Deadlines.Any(c => c.Course == fs.MSCourse))).OrderByDescending(m => m.OverallScore).Take(5).ToList();
            MsInUsa.Controllers.ProfilesController cobj = new ProfilesController();
            cobj.initilization(fs);
            return(View("recommend", fs));
        }