示例#1
0
        public ActionResult YouthScholarships(string scholarshipID)
        {
            string sessionId = Session["User-SessionID"].ToString();

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

            FindItemReponse <YouthScholarshipModel> response = new FindItemReponse <YouthScholarshipModel>();

            if (_user != null)
            {
                response = _youthScholarshipService.FindByUserID(_user.UserID);
                if (response.Item == null)
                {
                    response.Item = new YouthScholarshipModel();
                }
            }

            //Find experiences
            FindAllItemReponse <ExperienceModel> experiencesResponse = _experienceService.FindByscholarshipID(response.Item.YouthScholarshipID);

            if (experiencesResponse.Items != null && experiencesResponse.Items.Count > 0)
            {
                response.Item.ExperienceTitles = string.Join(",", experiencesResponse.Items.Select(i => i.Organization));
            }
            //Find educations
            FindAllItemReponse <EducationModel> educationsResponse = _educationService.FindByscholarshipID(response.Item.YouthScholarshipID);

            if (educationsResponse.Items != null && educationsResponse.Items.Count > 0)
            {
                response.Item.EducationTitles = string.Join(",", educationsResponse.Items.Select(i => i.MainCourseStudy));
            }
            //Find trainings
            FindAllItemReponse <TrainingModel> trainingsResponse = _trainingService.FindByscholarshipID(response.Item.YouthScholarshipID);

            if (trainingsResponse.Items != null && trainingsResponse.Items.Count > 0)
            {
                response.Item.AdditionalTrainingTitles = string.Join(",", trainingsResponse.Items.Select(i => i.NameOfCourse));
            }
            //Find leadership
            FindAllItemReponse <LeaderShipModel> leadershipsResponse = _leadershipService.FindByscholarshipID(response.Item.YouthScholarshipID);

            if (leadershipsResponse.Items != null && leadershipsResponse.Items.Count > 0)
            {
                response.Item.LeaderShipTitles = string.Join(",", leadershipsResponse.Items.Select(i => i.Organization));
            }
            //Find publication
            FindAllItemReponse <PublicationModel> publicationsResponse = _publicationService.FindByscholarshipID(response.Item.YouthScholarshipID);

            if (publicationsResponse.Items != null && publicationsResponse.Items.Count > 0)
            {
                response.Item.PublicationTitles = string.Join(",", publicationsResponse.Items.Select(i => i.Title));
            }

            return(View(response.Item));
        }
示例#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));
        }