Example #1
0
        /// <summary>
        /// Occurs when the page is being loaded.
        /// </summary>
        /// <param name="sender">The sourceRow of the event.</param>
        /// <param name="e">An EventArgs that contains no event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Micajah.Common.Pages.MasterPage.InitializeSetupPage(this.Page);
            this.MasterPage.VisibleBreadcrumbs = false;

            m_UserContext = UserContext.Current;

            this.LoadResources();
            this.ParseParams();

            MagicForm.ApplyStyle(SearchTable);
            AutoGeneratedButtonsField.InsertButtonSeparator(ButtonsSeparator);
            Control container = MagicForm.AddRequiredTable(FooterCell);

            container.Controls.Add(ButtonsHolder);

            if (this.IsPostBack)
            {
                BaseControl.LoadResources(List, this.GetType().BaseType.Name);
            }
            else
            {
                InstanceListRow.Visible = FrameworkConfiguration.Current.WebApplication.EnableMultipleInstances;
                InstanceList.Required   = (m_RoleId != RoleProvider.OrganizationAdministratorRoleId);
            }
        }
Example #2
0
        private TableFooterRow GetFooterRow(bool showRequiredTable)
        {
            TableFooterRow footerRow = new TableFooterRow();

            TableCell cell = new TableCell();

            cell.ColumnSpan = this.RepeatColumns * 2;

            Control container = ((showRequiredTable && (this.Theme != MasterPageTheme.Modern)) ? MagicForm.AddRequiredTable(cell) : cell);

            container.Controls.Add(this.UpdateButton);
            AutoGeneratedButtonsField.InsertButtonSeparator(container);
            if (this.ShowCloseButtonSeparate)
            {
                container.Controls.Add(this.CloseButton);
                AutoGeneratedButtonsField.InsertButtonSeparator(container);
            }
            container.Controls.Add(this.CancelLink);

            footerRow.Cells.Add(cell);

            return(footerRow);
        }
        private void InitializeMagicFormCell(DataControlFieldCell cell, int rowIndex)
        {
            bool modernTheme = (m_MagicForm.Theme == MasterPageTheme.Modern);

            cell.CssClass = "Mf_B";

            Control container = cell;

            if (this.m_MagicForm.ShowRequiredTable)
            {
                container = MagicForm.AddRequiredTable(cell);
            }

            CommandActions action          = 0;
            bool           showCloseButton = false;

            if (m_MagicForm.CurrentMode == DetailsViewMode.Edit && m_ShowEditButton)
            {
                action          = CommandActions.Update;
                showCloseButton = ((m_MagicForm.ShowCloseButton == CloseButtonVisibilityMode.Always) ||
                                   (m_MagicForm.ShowCloseButton == CloseButtonVisibilityMode.Edit));
            }
            else if (m_MagicForm.CurrentMode == DetailsViewMode.Insert && m_ShowInsertButton)
            {
                action          = CommandActions.Insert;
                showCloseButton = ((m_MagicForm.ShowCloseButton == CloseButtonVisibilityMode.Always) ||
                                   (m_MagicForm.ShowCloseButton == CloseButtonVisibilityMode.Insert));
            }

            if (action > 0)
            {
                ButtonType type  = ButtonType.Button;
                Color      color = Color.Black;
                if (showCloseButton)
                {
                    if (m_MagicForm.ShowCloseButtonSeparate)
                    {
                        InsertButton(container, action, rowIndex, type, (modernTheme ? Color.Empty : color));
                        InsertButtonSeparator(container);
                        type  = ButtonType.Link;
                        color = Color.Blue;
                    }
                    InsertButton(container, (action | CommandActions.Close), rowIndex, type, (modernTheme ? Color.Empty : color), m_MagicForm.ShowCloseButtonSeparate, null);
                }
                else
                {
                    InsertButton(container, action, rowIndex, type, (modernTheme ? Color.Empty : color));
                }
            }

            if (m_MagicForm.ShowCancelButton)
            {
                InsertButtonSeparator(container);
                InsertButton(container, CommandActions.Cancel, rowIndex, "Cancel");
            }

            if (m_ShowDeleteButton && m_MagicForm.CurrentMode != DetailsViewMode.Insert)
            {
                InsertButtonSeparator(container);
                InsertButton(container, CommandActions.Delete, rowIndex, "Delete");
            }
        }