Exemple #1
0
        public ActionResult MainScholarships()
        {
            string sessionId = Session["User-SessionID"].ToString();

            Site.Core.Repository.User _user = SessionUtil.GetInstance.GetUserBySessionID(sessionId);

            FindAllItemReponse <MainScholarshipModel> response = new FindAllItemReponse <MainScholarshipModel>();

            if (_user != null)
            {
                response = _mainScholarshipService.FindByUserID(_user.UserID);
                if (response.Items == null)
                {
                    response.Items = new List <MainScholarshipModel>();
                }
            }
            return(View(response.Items));
        }
Exemple #2
0
        public ActionResult ViewUser(string userId)
        {
            //Get user information
            FindItemReponse <UserModel> response = _userService.FindUserByID(userId);

            //Find logistic
            FindItemReponse <LogisticScheduleModel> logisticResponse = _logisticService.FindByUserID(userId);

            if (logisticResponse.Item != null)
            {
                ViewBag.Logistic = logisticResponse.Item;
            }

            //Find mailing
            FindAllItemReponse <MailingAddressModel> mailingResponse = _mailingAddressService.FindMailingAddressByUser(userId);

            if (mailingResponse.Items != null && mailingResponse.Items.Count > 0)
            {
                ViewBag.Mailing = mailingResponse.Items[0];
            }

            //Find abstract
            FindAllItemReponse <UserSubmissionModel> abstractResponse = _userSubmissionService.FindByUserID(userId);

            ViewBag.Abstracts = abstractResponse.Items;

            //Find main scholarship by userID
            FindAllItemReponse <MainScholarshipModel> mainScholarshipReponse = _mainScholarshipService.FindByUserID(userId);

            if (mainScholarshipReponse.Items != null)
            {
                ViewBag.MainScholarship      = mainScholarshipReponse.Items;
                ViewBag.ScholarshipTitleMain = SCHOLARSHIP_MAIN_TITLE;
            }

            //Find youth scholarship by userID
            FindItemReponse <YouthScholarshipModel> youthScholarshipResponse = _youthScholarshipService.FindByUserID(userId);

            if (youthScholarshipResponse.Item != null)
            {
                ViewBag.YouthScholarship      = youthScholarshipResponse.Item;
                ViewBag.ScholarshipTitleYouth = SCHOLARSHIP_YOUTH_TITLE;

                //Find working experience
                FindAllItemReponse <ExperienceModel> experienceResponse = _experienceService.FindByscholarshipID(youthScholarshipResponse.Item.YouthScholarshipID);
                ViewBag.Experiences = experienceResponse.Items;

                //Find education
                FindAllItemReponse <EducationModel> educationResponse = _educationService.FindByscholarshipID(youthScholarshipResponse.Item.YouthScholarshipID);
                ViewBag.Educations = educationResponse.Items;

                //Find training
                FindAllItemReponse <TrainingModel> trainingResponse = _trainingService.FindByscholarshipID(youthScholarshipResponse.Item.YouthScholarshipID);
                ViewBag.Trainings = trainingResponse.Items;

                //Find leadership
                FindAllItemReponse <LeaderShipModel> leadershipResponse = _leadershipService.FindByscholarshipID(youthScholarshipResponse.Item.YouthScholarshipID);
                ViewBag.Leaderships = leadershipResponse.Items;

                //Find publication
                FindAllItemReponse <PublicationModel> publicationResponse = _publicationService.FindByscholarshipID(youthScholarshipResponse.Item.YouthScholarshipID);
                ViewBag.Publications = publicationResponse.Items;
            }

            //Find payment
            FindAllItemReponse <PaymentModel> paymentResponse = _paymentService.FindByUserID(userId);

            if (paymentResponse.Items != null)
            {
                ViewBag.Payments = paymentResponse.Items;
            }

            return(View(response.Item));
        }