Beispiel #1
0
 public void SaveLayoutData()
 {
     Assert.IsTrue(LayoutManager.Current.Login(ReferenceData.AdministratorString, string.Empty, Session));
     TestLayoutData1.GetLayoutData().Data1 = 1;
     TestLayoutData2.GetLayoutData().Data2 = 2;
     LayoutManager.Current.Logout();
     Assert.IsTrue(LayoutManager.Current.Login(ReferenceData.AdministratorString, string.Empty, Session));
     Assert.AreEqual(1, TestLayoutData1.GetLayoutData().Data1);
     Assert.AreEqual(2, TestLayoutData2.GetLayoutData().Data2);
     LayoutManager.Current.Logout();
 }
Beispiel #2
0
        public static TestLayoutData2 GetLayoutData()
        {
            XPCollection <TestLayoutData2> layoutDataCollection = LayoutManager.Current.GetLayoutData <TestLayoutData2>();

            if (layoutDataCollection.Count != 0)
            {
                return(layoutDataCollection[0]);
            }
            TestLayoutData2 layoutData = new TestLayoutData2(VideoRentCurrentUser.GetCurrentUser(LayoutManager.Current.Session));

            LayoutManager.Current.LayoutData.Add(layoutData);
            return(layoutData);
        }