Пример #1
0
        /// <summary>
        ///     Инициализация
        /// </summary>
        /// <param name="e"></param>
        protected override void OnInit(EventArgs e)
        {
            if (!V4Page.Listeners.Contains(this))
            {
                V4Page.Listeners.Add(this);
            }
            LinkedDocCmdListnerIndex = V4Page.Listeners.IndexOf(this);

            base.OnInit(e);

            if (V4Page.V4IsPostBack)
            {
                return;
            }

            _currentTypeSelectCtrlText = new Label
            {
                Text = $"{V4Page.Resx.GetString("LinkedDocs_lbl_ТипВытекающего")}:"
            };

            _currentTypeSelectCtrl = new DropDownList
            {
                V4Page     = V4Page,
                ID         = "type_" + ID,
                Width      = new Unit("350px"),
                IsReadOnly = true
            };

            _currentTypeSelectCtrl.Changed += TypeChanged;

            V4Page.V4Controls.Add(_currentTypeSelectCtrl);
            _dtSequelTypes = DocType.GetSettingsLinkedDocsInfo(CurrentDocType);
            LoadDropDownListData();
            SetDefaultLinkedDocType();

            _currentRadioCtrl = new Radio
            {
                V4Page = V4Page,
                ID     = "radio_" + ID,
                IsRow  = false,
                Name   = "DocRadio",
                HtmlID = "radio_" + ID
            };
            _currentRadioCtrl.Changed += _currentRadioCtrl_OnChanged;
            _currentRadioCtrl.Items.Add(new Item("0", $" {V4Page.Resx.GetString("LinkedDocs_lbl_НовыйВытекающий")}"));
            _currentRadioCtrl.Items.Add(new Item("1", $" {V4Page.Resx.GetString("LinkedDocs_lbl_Существующий")}"));
            _currentRadioCtrl.Value = "0";
            V4Page.V4Controls.Add(_currentRadioCtrl);

            _currentDbSelectCtrl = new DBSDocument
            {
                V4Page = V4Page,
                ID     = "dbsDocument_" + ID,
                HtmlID = "linkedDoc",
                Width  = new Unit("350px")
            };

            _currentDbSelectCtrl.OnRenderNtf  += LinkedDocumentOnOnRenderNtf;
            _currentDbSelectCtrl.ValueChanged += LinkedDocumentOnValueChanged;
            _currentDbSelectCtrl.BeforeSearch += DBSelect_BeforeSearch;
            _currentDbSelectCtrl.IsDisabled    = true;

            V4Page.V4Controls.Add(_currentDbSelectCtrl);
        }