Esempio n. 1
0
        protected void gvAuditDetails_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsBehavior.AllowSort = false;
            gridview.SettingsPager.Mode         = GridViewPagerMode.ShowAllRecords;
            gridview.SettingsText.Title         = $"AUDIT ID: {gridview.GetMasterRowKeyValue()}";
            gridview.SettingsExport.FileName    = $"Audit_{gridview.GetMasterRowKeyValue()}_{DateTime.Now.ToString("yyyyMMdd")}";

            GridViewUtils.GridViewToolbarInit(sender, e);
        }
Esempio n. 2
0
        protected void gvAuditQuestion_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsEditing.Mode             = GridViewEditingMode.Batch;
            gridview.SettingsDataSecurity.AllowInsert = ActiveUser.IsInRole(AppRoles.AuditorAdmin);
            gridview.SettingsDataSecurity.AllowEdit   = ActiveUser.IsInRole(AppRoles.AuditorAdmin);
            gridview.SettingsDataSecurity.AllowDelete = ActiveUser.IsInRole(AppRoles.AuditorAdmin);
            gridview.SettingsText.Title      = "QUESTIONS";
            gridview.SettingsExport.FileName = $"Questions_{DateTime.Now.ToString("yyyyMMdd")}";
            GridViewUtils.GridViewToolbarInit(sender, e);
        }
Esempio n. 3
0
        protected void gvUsersInRole_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsDataSecurity.AllowInsert    = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsDataSecurity.AllowEdit      = false;
            gridview.SettingsDataSecurity.AllowDelete    = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsEditing.EditFormColumnCount = 2;
            gridview.SettingsText.Title      = $"USERS IN ROLE ({gridview.GetMasterRowFieldValues("rolename").ToString()})";
            gridview.SettingsExport.FileName = $"UserInRole_{DateTime.Now.ToString("yyyyMMdd")}";
            GridViewUtils.GridViewToolbarInit(sender, e);
        }
Esempio n. 4
0
        protected void gvRoles_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsDataSecurity.AllowInsert             = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsDataSecurity.AllowEdit               = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsDataSecurity.AllowDelete             = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsEditing.EditFormColumnCount          = 2;
            gridview.SettingsDetail.AllowOnlyOneMasterRowExpanded = true;
            gridview.SettingsDetail.ShowDetailRow = true;
            gridview.SettingsText.Title           = "ROLES";
            gridview.SettingsExport.FileName      = $"Roles_{DateTime.Now.ToString("yyyyMMdd")}";
            GridViewUtils.GridViewToolbarInit(sender, e);
        }
Esempio n. 5
0
        protected void gvAudits_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsText.Title = "AUDITS";
            gridview.SettingsDetail.AllowOnlyOneMasterRowExpanded = true;
            gridview.SettingsDetail.ShowDetailRow = true;
            gridview.SettingsExport.FileName      = $"Audits_{DateTime.Now.ToString("yyyyMMdd")}";
            gridview.SettingsPager.PageSize       = 50;

            GridViewUtils.GridViewToolbarInit(sender, e);

            var print = new GridViewToolbarItem();

            print.Command             = GridViewToolbarCommand.Custom;
            print.Name                = ToolbarButtons.PrintAudit;
            print.Text                = "Print Audit";
            print.Image.Url           = "Images/printer.png";
            print.Image.AlternateText = print.Text;
            print.Image.ToolTip       = print.Text;
            print.Image.Height        = GridViewUtils.ImageToolbarSize;
            print.Image.Width         = GridViewUtils.ImageToolbarSize;

            var deleteAudit = new GridViewToolbarItem();

            deleteAudit.Command             = GridViewToolbarCommand.Custom;
            deleteAudit.Name                = ToolbarButtons.DeleteAudit;
            deleteAudit.Text                = "Delete Audit";
            deleteAudit.Image.Url           = "Images/trash.png";
            deleteAudit.Image.AlternateText = print.Text;
            deleteAudit.Image.ToolTip       = print.Text;
            deleteAudit.Image.Height        = GridViewUtils.ImageToolbarSize;
            deleteAudit.Image.Width         = GridViewUtils.ImageToolbarSize;

            var toolbarGrid = gridview.Toolbars.FindByName(GridViewUtils.ToolbarGrid);

            if (toolbarGrid != null)
            {
                toolbarGrid.Items.Add(print);
                if (ActiveUser.IsInRole(AppRoles.AuditorAdmin))
                {
                    toolbarGrid.Items.Add(deleteAudit);
                }
            }
        }
Esempio n. 6
0
        protected void gv_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.Settings.ShowFilterRowMenu       = false;
            gridview.Settings.ShowHeaderFilterButton  = false;
            gridview.Settings.ShowTitlePanel          = true;
            gridview.Settings.VerticalScrollBarMode   = ScrollBarMode.Hidden;
            gridview.SettingsBehavior.AllowFocusedRow = false;
            gridview.KeyboardSupport               = false;
            gridview.SettingsLoadingPanel.Mode     = GridViewLoadingPanelMode.Disabled;
            gridview.SettingsPager.AlwaysShowPager = false;
            gridview.SettingsPager.Mode            = GridViewPagerMode.ShowAllRecords;
            gridview.Font.Size          = new System.Web.UI.WebControls.FontUnit("12px");
            gridview.SettingsText.Title = "PRODUCTION AREAS";
        }
Esempio n. 7
0
        protected void gvUsers_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsDataSecurity.AllowInsert    = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsDataSecurity.AllowEdit      = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsDataSecurity.AllowDelete    = ActiveUser.IsInRole(AppRoles.UserAdmin);
            gridview.SettingsEditing.EditFormColumnCount = 3;
            gridview.SettingsText.Title      = "USERS";
            gridview.SettingsExport.FileName = $"Users_{DateTime.Now.ToString("yyyyMMdd")}";
            GridViewUtils.GridViewToolbarInit(sender, e);

            var unlock = new GridViewToolbarItem();

            unlock.Command             = GridViewToolbarCommand.Custom;
            unlock.Name                = ToolbarButtons.Unlock;
            unlock.Text                = "Unlock User";
            unlock.Image.Url           = "Images/unlock.png";
            unlock.Image.AlternateText = unlock.Text;
            unlock.Image.ToolTip       = unlock.Text;
            unlock.Image.Height        = GridViewUtils.ImageToolbarSize;
            unlock.Image.Width         = GridViewUtils.ImageToolbarSize;

            var reset = new GridViewToolbarItem();

            reset.Command             = GridViewToolbarCommand.Custom;
            reset.Name                = ToolbarButtons.Reset;
            reset.Text                = "Reset Password";
            reset.Image.Url           = "Images/key.png";
            reset.Image.AlternateText = unlock.Text;
            reset.Image.ToolTip       = unlock.Text;
            reset.Image.Height        = GridViewUtils.ImageToolbarSize;
            reset.Image.Width         = GridViewUtils.ImageToolbarSize;

            var toolbarGrid = gridview.Toolbars.FindByName(GridViewUtils.ToolbarGrid);

            if (toolbarGrid != null && ActiveUser.IsInRole(AppRoles.UserAdmin))
            {
                toolbarGrid.Items.Add(unlock);
                toolbarGrid.Items.Add(reset);
            }
        }
Esempio n. 8
0
        protected void gvActions_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsEditing.Mode           = GridViewEditingMode.Batch;
            gridview.SettingsDataSecurity.AllowEdit = ActiveUser.IsAuthenticated;
            gridview.SettingsText.Title             = "ACTIONS";
            gridview.SettingsExport.FileName        = $"Actions_{DateTime.Now.ToString("yyyyMMdd")}";
            gridview.SettingsPager.PageSize         = 50;

            GridViewUtils.GridViewToolbarInit(sender, e);
            var toolbarItem = gridview.Toolbars.FindByName(GridViewUtils.ToolbarItem);

            if (toolbarItem != null)
            {
                toolbarItem.Visible = false;
            }
        }
Esempio n. 9
0
        protected void gvSchedules_Init(object sender, EventArgs e)
        {
            GridViewUtils.GridViewDefaultInit(sender, e);
            ASPxGridView gridview = sender as ASPxGridView;

            gridview.SettingsBehavior.AllowSort = false;
            gridview.SettingsText.Title         = $"AUDITS SCHEDULES";
            gridview.SettingsExport.FileName    = $"AuditSchedules_{DateTime.Now.ToString("yyyyMMdd")}";
            gridview.SettingsPager.PageSize     = 50;

            GridViewUtils.GridViewToolbarInit(sender, e);

            var print = new GridViewToolbarItem();

            print.Command             = GridViewToolbarCommand.Custom;
            print.Name                = ToolbarButtons.PrintAudit;
            print.Text                = "Print Audit";
            print.Image.Url           = "Images/printer.png";
            print.Image.AlternateText = print.Text;
            print.Image.ToolTip       = print.Text;
            print.Image.Height        = GridViewUtils.ImageToolbarSize;
            print.Image.Width         = GridViewUtils.ImageToolbarSize;

            var check = new GridViewToolbarItem();

            check.Command             = GridViewToolbarCommand.Custom;
            check.Name                = ToolbarButtons.CheckAudit;
            check.Text                = "See Audit";
            check.Image.Url           = "Images/research.png";
            check.Image.AlternateText = print.Text;
            check.Image.ToolTip       = print.Text;
            check.Image.Height        = GridViewUtils.ImageToolbarSize;
            check.Image.Width         = GridViewUtils.ImageToolbarSize;

            var toolbarGrid = gridview.Toolbars.FindByName(GridViewUtils.ToolbarGrid);

            if (toolbarGrid != null)
            {
                toolbarGrid.Items.Add(print);
                toolbarGrid.Items.Add(check);
            }
        }