Ejemplo n.º 1
0
        //

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

            if (int.TryParse(id, out assmId))
            {
                entity = AssessmentServices.GetDetail(assmId, skippingCache);
            }
            else if (ServiceHelper.IsValidCtid(id, ref messages))
            {
                entity = AssessmentServices.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 Assessment record was not found ");
                return(RedirectToAction("Index", "Home"));
            }
            ActivityServices.SiteActivityAdd("AssessmentProfile", "View", "Detail", string.Format("User viewed Assessment: {0} ({1})", entity.Name, entity.Id), 0, 0, assmId);

            return(View("~/Views/Detail/Detail.cshtml", entity));
        }
Ejemplo n.º 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));
        }