protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Determine page width
            int page_width = 996;
            if (Body.FindControl("div_page") != null)
            {
                String class_name = ((HtmlGenericControl)Body.FindControl("div_page")).Attributes["class"].ToString();
                switch (class_name)
                {
                case "normal_page":
                    page_width = 996;
                    ((HtmlGenericControl)Header.FindControl("div_rm")).Attributes["class"] = "MainMenuContainer RadMenuPad";     // remove padding to shorten radmenu
                    break;

                case "wide_page":
                    page_width = 1250;
                    break;

                case "wider_page":
                    page_width = 1290;
                    break;

                default:
                    page_width = 1250;
                    break;
                }
            }
            // Set footer width
            ((HtmlGenericControl)Footer.FindControl("div_footer")).Style.Add("width", page_width + "px");
            // Set header width
            ((HtmlGenericControl)Header.FindControl("div_header")).Style.Add("width", page_width + "px");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Determine page width
            int page_width = 996;
            if (Body.FindControl("div_page") != null)
            {
                String class_name = ((HtmlGenericControl)Body.FindControl("div_page")).Attributes["class"].ToString();
                switch (class_name)
                {
                case "normal_page":
                    page_width = 996;
                    ((HtmlGenericControl)Header.FindControl("div_rm")).Attributes["class"] = "pad";     // remove padding to shorten radmenu
                    break;

                case "wide_page":
                    page_width = 1250;
                    break;

                case "wider_page":
                    page_width = 1290;
                    break;

                default:
                    page_width = 1250;
                    break;
                }
            }
            // Set radmenu width
            //((RadMenu)Header.FindControl("rm")).Width = page_width;
            // Set radmenu container width
            ((HtmlGenericControl)Header.FindControl("div_rm")).Style.Add("width", page_width + "px");
            // Set footer width
            ((HtmlGenericControl)Footer.FindControl("div_footer")).Style.Add("width", page_width + "px");
            // Set header width
            ((HtmlGenericControl)Header.FindControl("div_header")).Style.Add("width", page_width + "px");

            // added to literal as Page.Header.Controls.Add is too early for script to find DropDowns and Page.Controls can't be modified until Page_LoadComplete which
            // can't be handled in user controls/masters
            if (Util.christmas_easter_eggs_enabled)
            {
                js_snowstorm.Text = "<script type='text/javascript' src='/JavaScript/snowstorm.js'></script>";
            }
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Set CSS Version <--Controls Downloading File From Server
        CssVersion = ConfigurationManager.AppSettings["CssVersionNumber"];

        //Check If We Are Showing Menu
        if (!ShowMenu)
        {
            //Hide Logon Prompt
            HelpMenuPopup.ShowOnPageLoad = false;

            //Hide Menu
            Header.Visible = false;
        }
        else
        {
            //Show Menu
            Header.Visible = true;

            //Show Logon Prompt If User Isn't Logged In Via Session Varaible
            HelpMenuPopup.ShowOnPageLoad = (HttpContext.Current.Session["LogonInfo"] == null);
        }

        //Setup Save Button
        var saveButton = ((ASPxButton)Footer.FindControl("SaveButton"));

        saveButton.Visible = _showSaveButton;
        saveButton.Enabled = _enableSaveButton;
        saveButton.Text    = _showSubmitText ? @"Submit" : @"";

        //Setup New Button
        var newButton = ((ASPxButton)Footer.FindControl("NewButton"));

        newButton.Visible = _showNewButton;
        newButton.Enabled = _enableNewButton;

        var newWRButton = ((ASPxButton)Footer.FindControl("NewWRButton"));

        newWRButton.Visible = _showNewWRButton;
        newWRButton.Enabled = _enableNewWRButton;

        var quickPostButton = ((ASPxButton)Footer.FindControl("QuickPostButton"));

        quickPostButton.Visible = _showQuickPostButton;
        quickPostButton.Enabled = _enableQuickPostButton;

        //Setup New Non-Stock Button
        var newNonStockPart = ((ASPxButton)Footer.FindControl("NewNonStockPart"));

        newNonStockPart.Visible = _showNonStockAddButton;
        newNonStockPart.Enabled = _enableNonStockAddButton;

        //Setup Edit Button
        var editButton = ((ASPxButton)Footer.FindControl("EditButton"));

        editButton.Visible = _showEditButton;
        editButton.Enabled = _enableEditButton;

        //Setup Delete Button
        var deleteButton = ((ASPxButton)Footer.FindControl("DeleteButton"));

        deleteButton.Visible = _showDeleteButton;
        deleteButton.Enabled = _enableDeleteButton;

        //Setup View Button
        var viewButton = ((ASPxButton)Footer.FindControl("ViewButton"));

        viewButton.Visible = _showViewButton;
        viewButton.Enabled = _enableViewButton;

        //Setup Print Button
        var printButton = ((ASPxButton)Footer.FindControl("PrintButton"));

        printButton.Visible = _showPrintButton;
        printButton.Enabled = _enablePrintButton;

        //Setup PDFButton
        var pdfButton = ((ASPxButton)Footer.FindControl("ExportPDF"));

        pdfButton.Visible = _showPdfButton;
        pdfButton.Enabled = _enablePdfButton;

        //Setup XLSButton
        var xlsButton = ((ASPxButton)Footer.FindControl("ExportXLS"));

        xlsButton.Visible = _showXlsButton;
        xlsButton.Enabled = _enableXlsButton;

        //Setup Plan
        var planButton = ((ASPxButton)Footer.FindControl("PlanJob"));

        planButton.Visible = _showPlanButton;
        planButton.Enabled = _enablePlanButton;

        //Setup Copy Job Button
        var copyJobButton = ((ASPxButton)Footer.FindControl("CopyJob"));

        copyJobButton.Visible = _showCopyJobButton;
        copyJobButton.Enabled = _enableCopyJobButton;

        //Setup Routine Job Button
        var routineJobButton = ((ASPxButton)Footer.FindControl("RoutineJob"));

        routineJobButton.Visible = _showRoutineJobButton;
        routineJobButton.Enabled = _enableRoutineJobButton;

        //Setup Force PM Button
        var forcePmButton = ((ASPxButton)Footer.FindControl("ForcePM"));

        forcePmButton.Visible = _showForcePmButton;
        forcePmButton.Enabled = _enableForcePmButton;

        //Setup Post
        var postButton = ((ASPxButton)Footer.FindControl("PostJob"));

        postButton.Visible = _showPostButton;
        postButton.Enabled = _enablePostButton;

        //Setup Unpost
        var unPostButton = ((ASPxButton)Footer.FindControl("UnpostJob"));

        unPostButton.Visible = _showUnPostButton;
        unPostButton.Enabled = _enableUnPostButton;

        //Setup SetDefaults
        var setDefaultsButton = ((ASPxButton)Footer.FindControl("SetDefaults"));

        setDefaultsButton.Visible = _showSetDefaultsButton;
        setDefaultsButton.Enabled = _enableSetDefaultsButton;

        //Setup SetEndDate
        var setEndButton = ((ASPxButton)Footer.FindControl("SetToEndDate"));

        setEndButton.Visible = _showSetEndDateButton;
        setEndButton.Enabled = _enableSetEndDateButton;

        //Setup SetStartDate
        var setStartButton = ((ASPxButton)Footer.FindControl("SetToStartDate"));

        setStartButton.Visible = _showSetStartDateButton;
        setStartButton.Enabled = _enableSetStartDateButton;

        ////Setup SetLocation
        //var locationButton = ((ASPxButton)Footer.FindControl("ShowLocation"));
        //locationButton.ClientVisible = _showLocationButton;
        //locationButton.Enabled = _enableLocationButton;

        //Setup Issue
        var issueButton = ((ASPxButton)Footer.FindControl("IssueJob"));

        issueButton.Visible = _showIssueButton;
        issueButton.Enabled = _enableIssueButton;

        //Setup Prev
        var prevStepButton = ((ASPxButton)Footer.FindControl("PreviousStep"));

        prevStepButton.Visible = _showPrevStepButton;
        prevStepButton.Enabled = _enablePrevStepButton;

        //Setup Next
        var nextStepButton = ((ASPxButton)Footer.FindControl("NextStep"));

        nextStepButton.Visible = _showNextStepButton;
        nextStepButton.Enabled = _enableNewButton;

        //Setup Batch Crew Add Button
        var batchCrewAddButton = ((ASPxButton)Footer.FindControl("BatchCrewAdd"));

        batchCrewAddButton.Visible = _showBatchCrewAddButton;
        batchCrewAddButton.Enabled = _enableBatchCrewAddButton;

        //Setup Batch Supervisor Add Button
        var batchSupervisorAddButton = ((ASPxButton)Footer.FindControl("BatchSupervisorAdd"));

        batchSupervisorAddButton.Visible = _showBatchSupervisorAddButton;
        batchSupervisorAddButton.Enabled = _enableBatchSupervisorAddButton;

        //Setup Batch Equipment Add Button
        var batchEquipAddButton = ((ASPxButton)Footer.FindControl("BatchEquipmentAdd"));

        batchEquipAddButton.Visible = _showBatchEquipmentButton;
        batchEquipAddButton.Enabled = _enableBatchEquipmentButton;

        //Setup Batch Part Add Button
        var batchPartButton = ((ASPxButton)Footer.FindControl("BatchPartAdd"));

        batchPartButton.Visible = _showBatchPartButton;
        batchPartButton.Enabled = _enableBatchPartButton;

        //Setup CrewLabor
        var crewLaborButton = ((ASPxButton)Footer.FindControl("AddCrewByLabor"));

        crewLaborButton.Visible = _showAddCrewLaborButton;
        crewLaborButton.Enabled = _enableAddCrewLaborButton;

        //Setup CrewGroup
        var crewGroupButton = ((ASPxButton)Footer.FindControl("AdCrewByGroup"));

        crewGroupButton.Visible = _showAddCrewGroupButton;
        crewGroupButton.Enabled = _enableAddCrewGroupButton;

        var mutiSelectButton = ((ASPxButton)Footer.FindControl("MultiSelect"));

        mutiSelectButton.Visible = _showMultiSelectButton;
        mutiSelectButton.Enabled = _enableMultiSelectButton;

        var emailButton = ((ASPxButton)Footer.FindControl("EmailButton"));

        emailButton.Visible = _showEmailButton;
        emailButton.Enabled = _showEmailButton;

        var mapDisplayButton = ((ASPxButton)Footer.FindControl("MapDisplay"));

        mapDisplayButton.Visible = _showMapDisplayButton;
        mapDisplayButton.Enabled = _showMapDisplayButton;
    }