void Initialize() { TblCourses course = new TblCourses { Name = "course" }; ServerModel.DB.Insert(course); TblOrganizations organisation = new TblOrganizations { CourseRef = course.ID, Title = "organisation" }; ServerModel.DB.Insert(organisation); TblResources resource = new TblResources { CourseRef = course.ID, Type = "bob", Identifier = "resource" }; ServerModel.DB.Insert(resource); TblItems item = new TblItems { OrganizationRef = organisation.ID, ResourceRef = resource.ID, Title = "item" }; ServerModel.DB.Insert(item); TblLearnerAttempts attempt = new TblLearnerAttempts { //bug with foreign keys! }; ServerModel.DB.Insert(attempt); TblLearnerSessions session = new TblLearnerSessions { ItemRef = item.ID, LearnerAttemptRef = attempt.ID }; ServerModel.DB.Insert(session); currentSession = session; TblUsers user = GetUniqueUserForTesting(); ServerModel.DB.Insert(user); sessionID = session.ID; userID = user.ID; }
private Control GetControl(TblResources resource, Panel p) { Uri BaseUri = new Uri("http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port + HttpContext.Current.Request.ApplicationPath); Uri AssetsUri = new Uri(BaseUri, "Assets/"); Uri CourseUri = new Uri(AssetsUri, theme.CourseRef.ToString() + "/"); Uri ResourceUri = new Uri(CourseUri, resource.Href); Control ResourceControl = p.Page.ParseControl(string.Format(@"<IFRAME ID=""_iFrame"" width=""100%"" height=""100%"" src=""{0}""></IFRAME>", ResourceUri.ToString())); return(ResourceControl); }
private void ShowPage(TblItems item) { PageContent.Controls.Clear(); TblResources resource = ServerModel.DB.Load <TblResources>((int)item.ResourceRef); Control control = GetControl(resource, PageContent); PageContent.Controls.Add(control); InitializeLearnerSession(item.ID); }
private static int Store(string identifier, string type, string href, int courseID) { TblResources r = new TblResources { CourseRef = courseID, Identifier = identifier, Type = type, Href = href }; return(ServerModel.DB.Insert(r)); }
private static int Store(string identifier, string type, string href, int courseID) { TblResources r = new TblResources { CourseRef = courseID, Identifier = identifier, Type = type, Href = href }; return ServerModel.DB.Insert(r); }