Пример #1
0
        //

        public ActionResult LearningOpportunity(string id, string name = "")
        {
            //LearningOpportunityProfile entity = new LearningOpportunityProfile();
            int           loppId        = 0;
            var           entity        = new LearningOpportunityProfile();
            string        refresh       = Request.Params["refresh"];
            bool          skippingCache = FormHelper.GetRequestKeyValue("skipCache", false);
            List <string> messages      = new List <string>();

            if (int.TryParse(id, out loppId))
            {
                entity = LearningOpportunityServices.GetDetail(loppId, skippingCache);
            }
            else if (ServiceHelper.IsValidCtid(id, ref messages))
            {
                entity = LearningOpportunityServices.GetDetailByCtid(id, skippingCache);
            }
            else
            {
                SetPopupErrorMessage("ERROR - Enter the ctid which starts with 'ce' or Enter the id ");
                return(RedirectToAction("Index", "Home"));
            }
            //HttpContext.Server.ScriptTimeout = 300;

            if (entity.Id == 0)
            {
                SetPopupErrorMessage("ERROR - the requested LearningOpportunity record was not found ");
                return(RedirectToAction("Index", "Home"));
            }
            ActivityServices.SiteActivityAdd("LearningOpportunity", "View", "Detail", string.Format("User viewed LearningOpportunity: {0} ({1})", entity.Name, entity.Id), 0, 0, loppId);

            return(View("~/Views/Detail/Detail.cshtml", entity));
        }
Пример #2
0
        public ActionResult V3()
        {
            var    vm = new CompareItemSummary();
            string credentialCompare = "";
            string orgCompare        = "";
            string asmtCompare       = "";
            string loppCompare       = "";

            var lists = GetSessionItems();

            foreach (var item in lists)
            {
                switch (item.Type)
                {
                case "credential":
                    var entity = CredentialServices.GetCredentialForCompare(item.Id);
                    vm.Credentials.Add(entity);
                    ActivityServices.SiteActivityAdd("Credential", "View", "Compare", string.Format("User doing compare on Credential: {0} ({1})", entity.Name, entity.Id), 0, 0, entity.Id);
                    break;

                case "organization":
                    var org = OrganizationServices.GetDetail(item.Id);
                    vm.Organizations.Add(org);
                    ActivityServices.SiteActivityAdd("Organization", "View", "Compare", string.Format("User doing compare on Organization: {0} ({1})", org.Name, org.Id), 0, 0, org.Id);
                    break;

                case "assessment":
                    var asmt = AssessmentServices.GetDetail(item.Id);
                    vm.Assessments.Add(asmt);
                    ActivityServices.SiteActivityAdd("Assessment", "View", "Compare", string.Format("User doing compare on Assessment: {0} ({1})", asmt.Name, asmt.Id), 0, 0, asmt.Id);
                    break;

                case "learningopportunity":
                    var lopp = LearningOpportunityServices.GetDetail(item.Id);
                    vm.LearningOpportunities.Add(lopp);
                    ActivityServices.SiteActivityAdd("LearningOpportunity", "View", "Compare", string.Format("User doing compare on Learning opportunity: {0} ({1})", lopp.Name, lopp.Id), 0, 0, lopp.Id);
                    break;

                default:
                    break;
                }
            }

            return(View("CompareV3", vm));
        }