コード例 #1
0
 protected void SaveButton_OnClick(object sender, EventArgs e)
 {
     if (ValidateDataSource())
     {
         LevelOneDataSource.SaveValues(false);
     }
 }
コード例 #2
0
        protected override object SaveControlState()
        {
            if (LevelOneDataSource != null)
            {
                LevelOneDataSource.SaveValues(true);
            }

            return(base.SaveControlState());
        }
コード例 #3
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            // Normally only in OnUnload. Call here only to provide diagnostic output
            LevelOneDataSource.SaveValues(true);

            var hasLevelOneInstance   = CurrentFunction.RootObject != null;
            var hasLevelTwoInstance   = hasLevelOneInstance && CurrentFunction.RootObject.ReferenceValue != null;
            var hasLevelThreeInstance = hasLevelTwoInstance && CurrentFunction.RootObject.ReferenceValue.ReferenceValue != null;

            Stack.Text  = "";
            Stack.Text += string.Format("LevelOne: HasInstance = {0}, IsDirty = {1}<br/>", hasLevelOneInstance, null);
            Stack.Text += string.Format("LevelTwo (LevelOne.ReferenceValue): HasInstance = {0}, IsDirty = {1}<br/>", hasLevelTwoInstance, LevelTwoDataSource.IsDirty);
            Stack.Text += string.Format("LevelThree (LevelOne.ReferenceValue.ReferenceValue): HasInstance = {0}, IsDirty = {1}<br/>", hasLevelThreeInstance, LevelThreeDataSource.IsDirty);
        }
コード例 #4
0
        private bool ValidateDataSource()
        {
            PrepareValidation();

            return(LevelOneDataSource.Validate());
        }
コード例 #5
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     LevelOneDataSource.BusinessObject = (IBusinessObject)CurrentFunction.RootObject;
     LevelOneDataSource.LoadValues(IsPostBack);
 }