예제 #1
0
    //获取报表目录名
    void GetReportCatalogName()
    {
        string B_Company_id = Request["B_Company_id"];

        if (string.IsNullOrEmpty(B_Company_id))
        {
            return;
        }
        CCompany Company = (CCompany)Global.GetCtx(Session["TopCompany"].ToString()).CompanyMgr.Find(new Guid(B_Company_id));

        if (Company == null)
        {
            return;
        }
        string id   = Request["id"];
        Guid   guid = Guid.Empty;

        if (!string.IsNullOrEmpty(id))
        {
            guid = new Guid(id);
        }
        else
        {
            return;
        }

        CReportCatalog catalog = (CReportCatalog)Company.ReportCatalogMgr.Find(guid);

        if (catalog != null)
        {
            Response.Write(catalog.Name);
        }
    }
예제 #2
0
    void GetData()
    {
        string pid       = Request["pid"];
        Guid   Parent_id = Guid.Empty;

        if (!string.IsNullOrEmpty(pid))
        {
            Parent_id = new Guid(pid);
        }
        //context.Response.Write(@"[{text: '工作流'}]");
        string             sJson      = "[";
        List <CBaseObject> lstCatalog = m_Company.ReportCatalogMgr.GetList();

        foreach (CBaseObject obj in lstCatalog)
        {
            CReportCatalog catalog = (CReportCatalog)obj;
            if (catalog.Parent_id == Parent_id)
            {
                string sItem = string.Format("{{ isexpand: \"false\",\"id\":\"{0}\", name: \"{1}\",\"text\": \"{1}\", children: [] }},",
                                             catalog.Id,
                                             catalog.Name);
                sJson += sItem;
            }
        }
        sJson  = sJson.TrimEnd(",".ToCharArray());
        sJson += "]";
        Response.Write(sJson);
    }
예제 #3
0
    void PostData()
    {
        CUser user = (CUser)Session["User"];

        CReportCatalog BaseObject = new CReportCatalog();

        BaseObject.Ctx     = Global.GetCtx(Session["TopCompany"].ToString());
        BaseObject.Creator = user.Id;
        List <CBaseObject> lstCol = m_Table.ColumnMgr.GetList();
        bool bHasVisible          = false;

        foreach (CBaseObject obj in lstCol)
        {
            CColumn col = (CColumn)obj;

            if (col.Code.Equals("id", StringComparison.OrdinalIgnoreCase))
            {
                continue;
            }
            else if (col.Code.Equals("Created", StringComparison.OrdinalIgnoreCase))
            {
                continue;
            }
            else if (col.Code.Equals("Creator", StringComparison.OrdinalIgnoreCase))
            {
                //BaseObject.SetColValue(col, Program.User.Id);
                continue;
            }
            else if (col.Code.Equals("Updated", StringComparison.OrdinalIgnoreCase))
            {
                continue;
            }
            else if (col.Code.Equals("Updator", StringComparison.OrdinalIgnoreCase))
            {
                //BaseObject.SetColValue(col, Program.User.Id);
                continue;
            }

            BaseObject.SetColValue(col, Request.Params[col.Code]);
            bHasVisible = true;
        }
        if (!bHasVisible)
        {
            Response.Write("没有可修改字段!");
            return;
        }
        if (!m_Company.ReportCatalogMgr.AddNew(BaseObject, true))
        {
            Response.Write("添加失败!");
            return;
        }
    }
예제 #4
0
    public string GetCatalogName()
    {
        if (m_BaseObject == null)
        {
            return("");
        }
        CReportCatalog Catalog = (CReportCatalog)m_Company.ReportCatalogMgr.Find(m_BaseObject.RPT_ReportCatalog_id);

        if (Catalog == null)
        {
            return("");
        }
        return(Catalog.Name);
    }
예제 #5
0
        private void btFinish_Click(object sender, EventArgs e)
        {
            if (txtName.Text.Trim() == "")
            {
                MessageBox.Show("请输入报表名称!");
                return;
            }
            if (dataGridStatItem.Rows.Count == 0)
            {
                MessageBox.Show("请选择统计指标!");
                return;
            }

            UpdateStatItem();

            m_Report.Name = txtName.Text.Trim();
            if (cbCatalog.SelectedIndex < 1)
            {
                m_Report.RPT_ReportCatalog_id = Guid.Empty;
            }
            else
            {
                DataItem       item    = (DataItem)cbCatalog.SelectedItem;
                CReportCatalog catalog = (CReportCatalog)item.Data;
                m_Report.RPT_ReportCatalog_id = catalog.Id;
            }

            m_Report.Filter = txtFilter.Text.Trim();


            if (m_bIsNew)
            {
                m_Company.ReportMgr.AddNew(m_Report);
            }
            else
            {
                m_Company.ReportMgr.Update(m_Report);
            }
            if (!m_Company.ReportMgr.Save(true))
            {
                MessageBox.Show("保存失败!");
                return;
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
예제 #6
0
        void LoadCatalog()
        {
            cbCatalog.Items.Clear();
            cbCatalog.Items.Add("");
            int iDefaultIdx           = 0;
            List <CBaseObject> lstObj = m_Company.ReportCatalogMgr.GetList();

            foreach (CBaseObject obj in lstObj)
            {
                CReportCatalog catalog = (CReportCatalog)obj;
                DataItem       item    = new DataItem(catalog.Name, catalog);
                int            idx     = cbCatalog.Items.Add(item);
                if (catalog.Id == m_Catalog_id)
                {
                    iDefaultIdx = idx;
                }
            }
            cbCatalog.SelectedIndex = iDefaultIdx;
        }
예제 #7
0
    //获取报表目录
    void GetReportCatalog()
    {
        string B_Company_id = Request["B_Company_id"];

        if (string.IsNullOrEmpty(B_Company_id))
        {
            return;
        }
        CCompany Company = (CCompany)Global.GetCtx(Session["TopCompany"].ToString()).CompanyMgr.Find(new Guid(B_Company_id));

        if (Company == null)
        {
            return;
        }
        string pid       = Request["pid"];
        Guid   Parent_id = Guid.Empty;

        if (!string.IsNullOrEmpty(pid))
        {
            Parent_id = new Guid(pid);
        }
        //context.Response.Write(@"[{text: 'Report'}]");
        string             sJson            = "[";
        List <CBaseObject> lstReportCatalog = Company.ReportCatalogMgr.GetList();

        foreach (CBaseObject obj in lstReportCatalog)
        {
            CReportCatalog catalog = (CReportCatalog)obj;
            if (catalog.Parent_id == Parent_id)
            {
                string sItem = string.Format("{{ isexpand: \"false\", name: \"nodeReportCatalog\",\"id\":\"{0}\",\"text\": \"{1}\",\"url\": \"Report/ReportPanel.aspx?catalog_id={0}&B_Company_id={2}\",\"B_Company_id\":\"{2}\", children: [] }},",
                                             catalog.Id,
                                             catalog.Name,
                                             B_Company_id);
                sJson += sItem;
            }
        }
        sJson  = sJson.TrimEnd(",".ToCharArray());
        sJson += "]";
        Response.Write(sJson);
    }
예제 #8
0
        void LoopLoadReportCatalog(CCompany Company, Guid Parent_id, TreeNode pNode)
        {
            List <CBaseObject> lstReportCatalog = Company.ReportCatalogMgr.GetList();

            foreach (CBaseObject obj in lstReportCatalog)
            {
                CReportCatalog catalog = (CReportCatalog)obj;
                if (catalog.Parent_id == Parent_id)
                {
                    TreeNode node = new TreeNode();
                    node.Text               = catalog.Name;
                    node.ImageIndex         = 10;
                    node.SelectedImageIndex = 10;
                    TreeNodeTag tag = new TreeNodeTag();
                    tag.NodeType = TreeNodeType.ReportCatalog;
                    tag.Data     = catalog;
                    node.Tag     = tag;

                    pNode.Nodes.Add(node);

                    LoopLoadReportCatalog(Company, catalog.Id, node);
                }
            }
        }
예제 #9
0
        private void treeLeft_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNodeTag tag = (TreeNodeTag)e.Node.Tag;

            if (tag == null)
            {
                return;
            }

            if (tag.NodeType == TreeNodeType.TableRoot)
            {
                tablePanel.Dock    = DockStyle.Fill;
                tablePanel.Visible = true;
                tablePanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.DiagramRoot)
            {
                diagramPanel.Dock    = DockStyle.Fill;
                diagramPanel.Visible = true;
                diagramPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.UserRoot)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Parent.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                userPanel.Company = Company;
                userPanel.Dock    = DockStyle.Fill;
                userPanel.Visible = true;
                userPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.OrgRoot)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Parent.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                orgPanel.Company = Company;
                orgPanel.Dock    = DockStyle.Fill;
                orgPanel.Visible = true;
                orgPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.RoleRoot)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Parent.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                rolePanel.Company = Company;
                rolePanel.Dock    = DockStyle.Fill;
                rolePanel.Visible = true;
                rolePanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.AccessRoot)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Parent.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                accessPanel.Company = Company;
                accessPanel.Dock    = DockStyle.Fill;
                accessPanel.Visible = true;
                accessPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.WindowCatalogRoot)
            {
                windowPanel.Catalog = null;
                windowPanel.Dock    = DockStyle.Fill;
                windowPanel.Visible = true;
                windowPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.WindowCatalog)
            {
                CWindowCatalog catalog = (CWindowCatalog)tag.Data;
                windowPanel.Catalog = catalog;
                windowPanel.Dock    = DockStyle.Fill;
                windowPanel.Visible = true;
                windowPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.ViewCatalogRoot)
            {
                viewPanel.Catalog = null;
                viewPanel.Dock    = DockStyle.Fill;
                viewPanel.Visible = true;
                viewPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.ViewCatalog)
            {
                CViewCatalog catalog = (CViewCatalog)tag.Data;
                viewPanel.Catalog = catalog;
                viewPanel.Dock    = DockStyle.Fill;
                viewPanel.Visible = true;
                viewPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.FormCatalogRoot)
            {
                formPanel.Catalog = null;
                formPanel.Dock    = DockStyle.Fill;
                formPanel.Visible = true;
                formPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.FormCatalog)
            {
                CFormCatalog catalog = (CFormCatalog)tag.Data;
                formPanel.Catalog = catalog;
                formPanel.Dock    = DockStyle.Fill;
                formPanel.Visible = true;
                formPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.SubSystemRoot)
            {
                subSystemPanel.Dock    = DockStyle.Fill;
                subSystemPanel.Visible = true;
                subSystemPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.SubDiagram)
            {
                TreeNode    pNode  = e.Node.Parent;
                TreeNodeTag tagP   = (TreeNodeTag)pNode.Tag;
                CSystem     system = (CSystem)tagP.Data;
                if (system.FW_Diagram_id == Guid.Empty)
                {
                    SelDiagramForm frm = new SelDiagramForm();
                    if (frm.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    system.FW_Diagram_id = frm.m_SelDiagram.Id;
                    if (!Program.Ctx.SystemMgr.Update(system))
                    {
                        MessageBox.Show("修改失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                    DesignerForm frm2 = new DesignerForm();
                    frm2.m_Diagram = frm.m_SelDiagram;
                    frm2.Show(this);
                }
                else
                {
                    CDiagram diagram = (CDiagram)Program.Ctx.DiagramMgr.Find(system.FW_Diagram_id);
                    if (diagram == null)
                    {
                        SelDiagramForm frm = new SelDiagramForm();
                        if (frm.ShowDialog() != DialogResult.OK)
                        {
                            return;
                        }
                        system.FW_Diagram_id = frm.m_SelDiagram.Id;
                        if (!Program.Ctx.SystemMgr.Update(system))
                        {
                            MessageBox.Show("修改失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                        DesignerForm frm2 = new DesignerForm();
                        frm2.m_Diagram = frm.m_SelDiagram;
                        frm2.Show(this);
                    }
                    else
                    {
                        DesignerForm frm2 = new DesignerForm();
                        frm2.m_Diagram = diagram;
                        frm2.Show(this);
                    }
                }
            }
            else if (tag.NodeType == TreeNodeType.WindowCatalog)
            {
            }
            else if (tag.NodeType == TreeNodeType.ReportCompany)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                reportPanel.Company = Company;
                reportPanel.Catalog = null;
                reportPanel.Dock    = DockStyle.Fill;
                reportPanel.Visible = true;
                reportPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.ReportCatalog)
            {
                CCompany Company = null;
                TreeNode p       = e.Node.Parent;
                while (p != null)
                {
                    TreeNodeTag ptag = (TreeNodeTag)p.Tag;
                    if (ptag.NodeType == TreeNodeType.ReportCompany)
                    {
                        Company = (CCompany)ptag.Data;
                        break;
                    }
                    p = p.Parent;
                }
                reportPanel.Company = Company;
                CReportCatalog catalog = (CReportCatalog)tag.Data;
                reportPanel.Catalog = catalog;
                reportPanel.Dock    = DockStyle.Fill;
                reportPanel.Visible = true;
                reportPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.WorkflowCompany)
            {
                TreeNodeTag ptag    = (TreeNodeTag)e.Node.Tag;
                CCompany    Company = (CCompany)ptag.Data;
                workflowDefPanel.Company = Company;
                workflowDefPanel.Catalog = null;
                workflowDefPanel.Dock    = DockStyle.Fill;
                workflowDefPanel.Visible = true;
                workflowDefPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.WorkflowCatalog)
            {
                CCompany Company = null;
                TreeNode p       = e.Node.Parent;
                while (p != null)
                {
                    TreeNodeTag ptag = (TreeNodeTag)p.Tag;
                    if (ptag.NodeType == TreeNodeType.WorkflowCompany)
                    {
                        Company = (CCompany)ptag.Data;
                        break;
                    }
                    p = p.Parent;
                }
                workflowDefPanel.Company = Company;
                CWorkflowCatalog catalog = (CWorkflowCatalog)tag.Data;
                workflowDefPanel.Catalog = catalog;
                workflowDefPanel.Dock    = DockStyle.Fill;
                workflowDefPanel.Visible = true;
                workflowDefPanel.BringToFront();
            }
            else if (tag.NodeType == TreeNodeType.MenuRoot)
            {
                menuPanel.Dock    = DockStyle.Fill;
                menuPanel.Visible = true;
                menuPanel.BringToFront();
            }
        }