protected override void OnInit(EventArgs e)
    {
        if (!this.IsCallback)
        {
            // set company logo
            PXResult <Branch, UploadFile> res =
                (PXResult <Branch, UploadFile>) PXSelectJoin <Branch,
                                                              InnerJoin <UploadFile, On <Branch.logoName, Equal <UploadFile.name> > >,
                                                              Where <Branch.branchCD, Equal <Required <Branch.branchCD> > > > .
                Select(new PXGraph(), PXAccess.GetBranchCD());

            if (res != null)
            {
                PX.SM.UploadFile file = (PX.SM.UploadFile)res;
                if (file != null)
                {
                    this.logoCell.Style[HtmlTextWriterStyle.BackgroundImage] = ControlHelper.GetAttachedFileUrl(this, file.FileID.ToString());
                }
            }
        }
        base.OnInit(e);
    }
示例#2
0
    protected override void OnInit(EventArgs e)
    {
        bool hasRightsOnTasks;
        bool hasRightsOnEvents;

        if (BuildManager.GetType(_TASKS_AND_EVENTS_REMINDER_GRAPH, false) != null &&
            ((hasRightsOnTasks = VerifyRightsOnScreen(_TASKS_URL)) | (hasRightsOnEvents = VerifyRightsOnScreen(_EVENTS_URL))))
        {
            PXTasksAndEventsNavPanel pnlTasksAndEvents = new PXTasksAndEventsNavPanel();
            pnlTasksAndEvents.ID        = "pnlTasksAndEvents";
            pnlTasksAndEvents.Width     = Unit.Percentage(100.0D);
            pnlTasksAndEvents.ImgCss    = "treeImage";
            pnlTasksAndEvents.GraphType = _TASKS_AND_EVENTS_REMINDER_GRAPH;
            pnlTasksAndEvents.GetOpenTasksCountMethod   = "GetOpenTasksCount";
            pnlTasksAndEvents.GetTodayTasksCountMethod  = "GetTodayTasksCount";
            pnlTasksAndEvents.GetNewTasksCountMethod    = "GetNewTasksCount";
            pnlTasksAndEvents.GetTasksFilterIDMethod    = "GetTasksDefaultFilterID";
            pnlTasksAndEvents.GetOpenEventsCountMethod  = "GetOpenEventsCount";
            pnlTasksAndEvents.GetTodayEventsCountMethod = "GetTodayEventsCount";
            pnlTasksAndEvents.GetNewEventsCountMethod   = "GetNewEventsCount";
            pnlTasksAndEvents.GetEventsFilterIDMethod   = "GetEventsDefaultFilterID";
            pnlTasksAndEvents.Target             = "main";
            pnlTasksAndEvents.TaskImage          = Sprite.Main.GetFullUrl(Sprite.Main.DataEntry);
            pnlTasksAndEvents.TasksLabel         = PX.Data.PXMessages.LocalizeNoPrefix(PX.AscxControlsMessages.TasksAndEventsPanel.Tasks);
            pnlTasksAndEvents.TasksUrl           = _TASKS_URL;
            pnlTasksAndEvents.TasksFilterMember  = "Tasks";
            pnlTasksAndEvents.TasksFilterName    = "TS_OPEN";
            pnlTasksAndEvents.ShowTasks          = hasRightsOnTasks;
            pnlTasksAndEvents.EventImage         = Sprite.Main.GetFullUrl(Sprite.Main.Calendar);
            pnlTasksAndEvents.EventsLabel        = PX.Data.PXMessages.LocalizeNoPrefix(PX.AscxControlsMessages.TasksAndEventsPanel.Events);
            pnlTasksAndEvents.EventsUrl          = _EVENTS_URL;
            pnlTasksAndEvents.EventsFilterMember = "Events";
            pnlTasksAndEvents.EventsFilterName   = "EV_TODAY";
            pnlTasksAndEvents.ShowEvents         = hasRightsOnEvents;
            divNavPanel.Controls.Add(pnlTasksAndEvents);
        }
        else
        {
            FindControl("trNavPanel").Visible = false;
        }

        if (!this.IsCallback)
        {
            // set company logo
            PXResult <Branch, UploadFile> res =
                (PXResult <Branch, UploadFile>) PXSelectJoin <Branch,
                                                              InnerJoin <UploadFile, On <Branch.logoName, Equal <UploadFile.name> > >,
                                                              Where <Branch.branchCD, Equal <Required <Branch.branchCD> > > > .
                Select(new PXGraph(), PXAccess.GetBranchCD());

            if (res != null)
            {
                PX.SM.UploadFile file = (PX.SM.UploadFile)res;
                if (file != null)
                {
                    this.logoCell.Style[HtmlTextWriterStyle.BackgroundImage] = ControlHelper.GetAttachedFileUrl(this, file.FileID.ToString());
                }
            }
        }
        base.OnInit(e);
    }