Ejemplo n.º 1
0
        void PopulateForm()
        {
            ResetControls();

            //Get Content Info
            AWAPI_Data.Data.awContent content = _contentLib.Get(ContentId);
            if (content == null)
            {
                return;
            }

            lblTitle.Text = "Manage Content Form - " + content.alias;

            //Get Form Info
            AWAPI_Data.Data.awContentForm form = _formLib.GetByContentId(ContentId, false);
            if (form == null)
            {
                return;
            }

            _contentFormId.Text        = form.contentFormId.ToString();
            _title.Text                = form.title;
            _description.Text          = form.description;
            _isEnabled.Checked         = form.isEnabled;
            _applyToSubContent.Checked = form.applyToSub;
            _canCreateNew.Checked      = form.canCreateNew;
            _canUpdate.Checked         = form.canUpdate;
            _canDelete.Checked         = form.canDelete;
            ShowHildeControls(true);

            PopulateFields(form.contentFormId);
        }
Ejemplo n.º 2
0
        void SaveForm()
        {
            long id = 0;

            AWAPI_Data.Data.awContentForm form = new AWAPI_Data.Data.awContentForm();
            form.siteId       = App_Code.SessionInfo.CurrentSite.siteId;
            form.contentId    = ContentId;
            form.userId       = App_Code.SessionInfo.CurrentUser.userId;
            form.title        = _title.Text;
            form.description  = _description.Text;
            form.isEnabled    = _isEnabled.Checked;
            form.applyToSub   = _applyToSubContent.Checked;
            form.canCreateNew = _canCreateNew.Checked;
            form.canUpdate    = _canUpdate.Checked;
            form.canDelete    = _canDelete.Checked;

            if (_contentFormId.Text == "")
            {
                id = _formLib.Add(form.siteId, form.contentId, form.title, form.description, form.isEnabled, form.applyToSub,
                                  form.canCreateNew, form.canUpdate, form.canDelete, form.userId.Value);
            }


            else
            {
                id = Convert.ToInt64(_contentFormId.Text);
                _formLib.Update(id, form.title, form.description, form.isEnabled, form.applyToSub,
                                form.canCreateNew, form.canUpdate, form.canDelete, form.userId.Value);
            }
            _contentFormId.Text = id.ToString();
            ShowHildeControls(true);

            PopulateFields(id);
        }