public void PrepareValidation()
        {
            Invoker.InitRecursive();

            _editableRow.DataSourceFactory = new EditableRowDataSourceFactory();
            _editableRow.ControlFactory    = EditableRowControlFactory.CreateEditableRowControlFactory();

            BocColumnDefinition[] columns = new BocColumnDefinition[3];
            columns[0] = _typeWithAllDataTypesStringValueSimpleColumn;
            columns[1] = _typeWithAllDataTypesInt32ValueSimpleColumn;
            columns[2] = _commandColumn;

            _editableRow.CreateControls(_value01, columns);
            _editableRow.EnsureValidatorsRestored();

            IBusinessObjectReferenceDataSource dataSource = _editableRow.GetDataSource();

            dataSource.LoadValues(false);

            BocTextValue stringValueField = (BocTextValue)_editableRow.GetEditControl(0);
            BocTextValue int32ValueField  = (BocTextValue)_editableRow.GetEditControl(1);

            _editableRow.PrepareValidation();

            Assert.That(stringValueField.Text, Is.EqualTo(stringValueField.Text));
            Assert.That(int32ValueField.Text, Is.EqualTo(int32ValueField.Text));
        }
        public virtual void RegisterHtmlHeadContents(HtmlHeadAppender htmlHeadAppender)
        {
            ArgumentUtility.CheckNotNull("htmlHeadAppender", htmlHeadAppender);

            var bocBooleanValue = new Controls.BocBooleanValue();

            bocBooleanValue.RegisterHtmlHeadContents(htmlHeadAppender);

            var bocDateTimeValue = new Controls.BocDateTimeValue();

            bocDateTimeValue.RegisterHtmlHeadContents(htmlHeadAppender);

            var bocEnumValue = new BocEnumValue();

            bocEnumValue.RegisterHtmlHeadContents(htmlHeadAppender);

            var bocMultilineTextValue = new BocMultilineTextValue();

            bocMultilineTextValue.RegisterHtmlHeadContents(htmlHeadAppender);

            var bocReferenceValue = new BocReferenceValue();

            bocReferenceValue.RegisterHtmlHeadContents(htmlHeadAppender);

            var bocTextValue = new BocTextValue();

            bocTextValue.RegisterHtmlHeadContents(htmlHeadAppender);
        }
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);

            if (!IsPostBack)
            {
                XmlReflectionBusinessObjectStorageProvider.Current.Reset();
            }

            FormGridRowInfoCollection newRows = (FormGridRowInfoCollection)_listOfFormGridRowInfos[FormGrid];

            BocTextValue incomeField = new BocTextValue();

            incomeField.ID = "IncomeField";
            incomeField.DataSourceControl  = CurrentObject.ID;
            incomeField.PropertyIdentifier = "Income";
            incomeField.Visible            = false;
            //  A new row
            newRows.Add(new FormGridRowInfo(
                            incomeField,
                            FormGridRowInfo.RowType.ControlInRowWithLabel,
                            BooleanField.ID,
                            FormGridRowInfo.RowPosition.AfterRowWithID));

            InitalizeReferenceFieldMenuItems();
        }
        public void IsDirty()
        {
            Invoker.InitRecursive();

            _editableRow.DataSourceFactory = new EditableRowDataSourceFactory();
            _editableRow.ControlFactory    = EditableRowControlFactory.CreateEditableRowControlFactory();

            BocColumnDefinition[] columns = new BocColumnDefinition[3];
            columns[0] = _typeWithAllDataTypesStringValueSimpleColumn;
            columns[1] = _typeWithAllDataTypesInt32ValueSimpleColumn;
            columns[2] = _commandColumn;

            _editableRow.CreateControls(_value01, columns);

            IBusinessObjectReferenceDataSource dataSource = _editableRow.GetDataSource();

            dataSource.LoadValues(false);

            Assert.That(_editableRow.IsDirty(), Is.False);

            BocTextValue textBoxStringValue = (BocTextValue)_editableRow.GetEditControl(0);

            textBoxStringValue.Value = "a";

            Assert.That(_editableRow.IsDirty(), Is.True);
        }
        public void SaveValue()
        {
            Invoker.InitRecursive();

            _editableRow.DataSourceFactory = new EditableRowDataSourceFactory();
            _editableRow.ControlFactory    = EditableRowControlFactory.CreateEditableRowControlFactory();

            BocColumnDefinition[] columns = new BocColumnDefinition[2];
            columns[0] = _typeWithAllDataTypesStringValueSimpleColumn;
            columns[1] = _typeWithAllDataTypesInt32ValueSimpleColumn;

            _editableRow.CreateControls(_value01, columns);

            IBusinessObjectReferenceDataSource dataSource = _editableRow.GetDataSource();

            dataSource.LoadValues(false);

            BocTextValue textBoxStringValue = (BocTextValue)_editableRow.GetEditControl(0);
            BocTextValue textBoxInt32Value  = (BocTextValue)_editableRow.GetEditControl(1);

            Assert.That(textBoxStringValue.Value, Is.EqualTo("A"));
            Assert.That(textBoxInt32Value.Value, Is.EqualTo(1));

            textBoxStringValue.Value = "New Value A";
            textBoxInt32Value.Value  = "100";

            dataSource.SaveValues(false);

            Assert.That(((TypeWithAllDataTypes)_value01).String, Is.EqualTo("New Value A"));
            Assert.That(((TypeWithAllDataTypes)_value01).Int32, Is.EqualTo(100));
        }
        private void SetValues(EditableRow row, string stringValue, string int32Value)
        {
            BocTextValue stringValueField = (BocTextValue)row.GetEditControl(0);

            stringValueField.Text = stringValue;

            BocTextValue int32ValueField = (BocTextValue)row.GetEditControl(1);

            int32ValueField.Text = int32Value;
        }
        protected void SetValues(EditableRow row, string stringValue, string int32Value)
        {
            ArgumentUtility.CheckNotNull("row", row);

            BocTextValue stringValueField = (BocTextValue)row.GetEditControl(0);

            stringValueField.Text = stringValue;

            BocTextValue int32ValueField = (BocTextValue)row.GetEditControl(1);

            int32ValueField.Text = int32Value;
        }
        public void PrepareValidation()
        {
            Invoker.InitRecursive();
            Controller.SwitchRowIntoEditMode(2, Columns);

            EditableRow editableRow = (EditableRow)Controller.Controls[0];

            BocTextValue stringValueField = (BocTextValue)editableRow.GetEditControl(0);
            BocTextValue int32ValueField  = (BocTextValue)editableRow.GetEditControl(1);

            Controller.PrepareValidation();

            Assert.That(stringValueField.Text, Is.EqualTo(stringValueField.Text));
            Assert.That(int32ValueField.Text, Is.EqualTo(int32ValueField.Text));
        }
        public void PrepareValidation()
        {
            Invoker.InitRecursive();
            Controller.SwitchRowIntoEditMode(2, Columns);

            for (int i = 0; i < Controller.Controls.Count; i++)
            {
                EditableRow editableRow = (EditableRow)Controller.Controls[i];

                BocTextValue stringValueField = (BocTextValue)editableRow.GetEditControl(0);
                BocTextValue int32ValueField  = (BocTextValue)editableRow.GetEditControl(1);

                Controller.PrepareValidation();

                Assert.AreEqual(stringValueField.Text, stringValueField.Text, "Row {0}", i);
                Assert.AreEqual(int32ValueField.Text, int32ValueField.Text, "Row {0}", i);
            }
        }
        private void PrepareAdditonalRows()
        {
            FormGridRowInfoCollection newRows = (FormGridRowInfoCollection)_listOfFormGridRowInfos[FormGrid];

            BocTextValue incomeField = new BocTextValue();

            incomeField.ID                 = "IncomeField";
            incomeField.DataSource         = CurrentObject;
            incomeField.PropertyIdentifier = "Income";
            _incomeField = incomeField;

            //  A new row
            newRows.Add(new FormGridRowInfo(
                            incomeField,
                            FormGridRowInfo.RowType.ControlInRowWithLabel,
                            MultilineTextField.ID,
                            FormGridRowInfo.RowPosition.AfterRowWithID));
        }