Beispiel #1
0
        private void Save()
        {
            MapRpt rpt = new MapRpt();

            rpt = BP.Sys.PubClass.CopyFromRequest(rpt) as MapRpt;
            if (this.RptNo != null)
            {
                rpt.No = this.RptNo;
            }

            Flow fl = new Flow(this.FK_Flow);

            rpt.PTable = fl.PTable;
            rpt.Save();

            //if (string.IsNullOrWhiteSpace(this.RptNo))
            //{
            //    if (rpt.IsExits)
            //    {
            //        BP.Sys.PubClass.Alert("@该编号已经存在:" + rpt.No);
            //        return;
            //    }
            //    rpt.Insert();
            //}
            //else
            //{
            //    rpt.Update();
            //}
        }
Beispiel #2
0
        private void Save()
        {
            MapRpt rpt = new MapRpt();

            rpt = BP.Sys.PubClass.CopyFromRequest(rpt) as MapRpt;
            if (this.RptNo != null)
            {
                rpt.No = this.RptNo;
            }

            rpt.ParentMapData = this.FK_MapData;

            Flow fl = new Flow(this.FK_Flow);

            rpt.PTable = fl.PTable;

            if (string.IsNullOrWhiteSpace(this.RptNo))
            {
                if (rpt.IsExits)
                {
                    BP.Sys.PubClass.Alert("@该编号已经存在:" + rpt.No);
                    return;
                }

                rpt.Insert();
            }
            else
            {
                rpt.Update();
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 处理查询权限, 此处不要修改,以Search.ascx为准.
            // this.Page.RegisterClientScriptBlock("sss",
            //"<link href='" + BP.WF.Glo.CCFlowAppPath + "WF/Comm/Style/Table" + BP.Web.WebUser.Style + ".css' rel='stylesheet' type='text/css' />");
            currMapRpt = new MapRpt(this.RptNo);
            Entity en = this.HisEns.GetNewEntity;
            Flow   fl = new Flow(this.currMapRpt.FK_Flow);

            //初始化查询工具栏.
            this.ToolBar1.InitToolbarOfMapRpt(fl, currMapRpt, this.RptNo, en, 1);
            this.ToolBar1.AddLinkBtn(BP.Web.Controls.NamesOfBtn.Export);

            //增加转到.
            this.ToolBar1.Add("&nbsp;");
            DDL ddl = new DDL();
            ddl.ID = "GoTo";
            ddl.Items.Add(new ListItem("查询", "Search"));
            // ddl.Items.Add(new ListItem("高级查询", "SearchAdv"));
            ddl.Items.Add(new ListItem("分组分析", "Group"));
            ddl.Items.Add(new ListItem("交叉报表", "D3"));
            ddl.Items.Add(new ListItem("对比分析", "Contrast"));
            ddl.SetSelectItem(this.PageID);
            this.ToolBar1.AddDDL(ddl);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged_GoTo);

            this.ToolBar1.GetLinkBtnByID(NamesOfBtn.Search).Click += new System.EventHandler(this.ToolBar1_ButtonClick);
            this.ToolBar1.GetLinkBtnByID(NamesOfBtn.Export).Click += new System.EventHandler(this.ToolBar1_ButtonClick);

            #endregion 处理查询权限

            //处理按钮.
            this.SetDGData();
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 处理查询权限, 此处不要修改,以Search.ascx为准.
            // this.Page.RegisterClientScriptBlock("sss",
            //"<link href='" + BP.WF.Glo.CCFlowAppPath + "WF/Comm/Style/Table" + BP.Web.WebUser.Style + ".css' rel='stylesheet' type='text/css' />");
            currMapRpt = new MapRpt(this.RptNo);
            Entity en = this.HisEns.GetNewEntity;
            Flow   fl = new Flow(this.currMapRpt.FK_Flow);

            this.Page.Title = fl.Name;

            //初始化查询工具栏.
            this.ToolBar1.InitToolbarOfMapRpt(fl, currMapRpt, this.RptNo, en, 1);


            //增加发起.
            if (BP.WF.Dev2Interface.Flow_IsCanStartThisFlow(this.FK_Flow, BP.Web.WebUser.No) == true)
            {
                string str = "<div style='float:right'><a href=\"javascript:WinOpen('/WF/MyFlow.aspx?FK_Flow=" + this.FK_Flow + "','df');\" ><img src='/WF/Img/Start.png' width='12px' border=0/>&nbsp;发起</a></div>";
                this.ToolBar1.Add(str);
            }

            if (BP.Web.WebUser.No == "admin")
            {
                string url = "/WF/Rpt/OneFlow.aspx?FK_MapData=ND" + int.Parse(this.FK_Flow) + "Rpt&FK_Flow=" + this.FK_Flow;

                //  string str = "<div style='float:right'><a href=\"javascript:Setting('"+this.RptNo+"','"+this.FK_Flow+"');\" >设置</a></div>";
                string str = "<div style='float:right'><a href='" + url + "' ><img src='/WF/Img/Setting.png' width='12px' border=0/>&nbsp;设置</a></div>";
                this.ToolBar1.Add(str);
            }


            this.ToolBar1.AddLinkBtn(BP.Web.Controls.NamesOfBtn.Export); //导出.

            //增加转到.
            this.ToolBar1.Add("&nbsp;");
            DDL ddl = new DDL();
            ddl.ID = "GoTo";
            ddl.Items.Add(new ListItem("查询", "Search"));
            // ddl.Items.Add(new ListItem("高级查询", "SearchAdv"));
            ddl.Items.Add(new ListItem("分组分析", "Group"));
            ddl.Items.Add(new ListItem("交叉报表", "D3"));
            ddl.Items.Add(new ListItem("对比分析", "Contrast"));
            ddl.SetSelectItem(this.PageID);
            this.ToolBar1.AddDDL(ddl);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged_GoTo);

            this.ToolBar1.GetLinkBtnByID(NamesOfBtn.Search).Click += new System.EventHandler(this.ToolBar1_ButtonClick);
            this.ToolBar1.GetLinkBtnByID(NamesOfBtn.Export).Click += new System.EventHandler(this.ToolBar1_ButtonClick);

            #endregion 处理查询权限



            //处理按钮.
            this.SetDGData();
        }
Beispiel #5
0
        public Entities SetDGData()
        {
            try
            {
                return(this.SetDGData(this.PageIdx));
            }
            catch
            {
                Flow fl = new Flow(this.FK_Flow);
                fl.DoCheck();

                MapRpt myRpt = new MapRpt("ND" + int.Parse(this.FK_Flow) + "MyRpt");
                myRpt.ResetIt();
                //清缓存
                BP.DA.Cash.Map_Cash.Clear();

                return(this.SetDGData(this.PageIdx));
            }
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapRpt rpt = new MapRpt();

            if (this.RptNo != null)
            {
                /**/
                rpt.No = this.RptNo;;
                rpt.RetrieveFromDBSources();
            }

            this.TB_No.Text   = rpt.No;
            this.TB_Name.Text = rpt.Name;
            this.TB_Note.Text = rpt.Note;

            if (string.IsNullOrEmpty(rpt.No) == false)
            {
                this.TB_No.Enabled = false;
            }
        }
Beispiel #7
0
        public void DataPanelDtl(Entities ens, string ctrlId)
        {
            //   this.Controls.Clear();
            Entity myen         = ens.GetNewEntity;
            string pk           = myen.PK;
            string clName       = myen.ToString();
            Attrs  attrs        = myen.EnMap.Attrs;
            var    attrCount    = 0;
            var    visibleAttrs = new List <Attr>();

            foreach (Attr attrT in attrs)
            {
                if (attrT.UIVisible == false)
                {
                    continue;
                }

                if (attrT.Key == "Title" || attrT.Key == "MyNum")
                {
                    continue;
                }

                attrCount++;
                visibleAttrs.Add(attrT);
            }

            MapRpt md = new MapRpt(this.RptNo);

            this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("colspan=" + (attrCount + 2), myen.EnMap.EnDesc + " 记录:" + ens.Count + "条");
            this.Pub1.AddTREnd();
            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("style='text-align:center'", "序");
            this.Pub1.AddTDGroupTitle("标题");

            visibleAttrs.ForEach(attr => Pub1.AddTDGroupTitle(attr.Desc));

            bool isRefFunc = false;

            isRefFunc = true;
            int pageidx = this.PageIdx - 1;
            int idx     = SystemConfig.PageSize * pageidx;

            this.Pub1.AddTREnd();
            string style = WebUser.Style;

            foreach (Entity en in ens)
            {
                this.Pub1.AddTR();
                idx++;
                this.Pub1.AddTDIdx(idx);
                //this.Pub1.Add("<TD class='TD'><a href=\"javascript:WinOpen('../WorkOpt/OneWork/Track.aspx?FK_Flow=" + this.FK_Flow + "&WorkID=" + en.GetValStrByKey("OID") + "');\" ><img src='../Img/Track.png' border=0 />"+en.GetValStrByKey("Title")+"</a></TD>");
                this.Pub1.Add("<TD class='TD'><a href=\"javascript:WinOpen('../WorkOpt/OneWork/Track.aspx?FK_Flow=" + this.FK_Flow + "&WorkID=" + en.GetValStrByKey("OID") + "');\" ><img src='../Img/Track.png' border=0 />" + en.GetValStrByKey("Title") + "</a></TD>");

                foreach (var attr in visibleAttrs)
                {
                    if (attr.UIContralType == UIContralType.DDL)
                    {
                        if (attr.UIBindKey == "BP.Pub.NYs")
                        {
                            this.Pub1.AddTD(en.GetValStrByKey(attr.Key));
                        }
                        else
                        {
                            this.Pub1.AddTD(en.GetValRefTextByKey(attr.Key));
                        }
                        continue;
                    }

                    if (attr.UIHeight != 0)
                    {
                        this.Pub1.AddTDDoc("...", "...");
                        continue;
                    }

                    string str = en.GetValStrByKey(attr.Key);
                    switch (attr.MyDataType)
                    {
                    case DataType.AppDate:
                    case DataType.AppDateTime:
                        if (str == "" || str == null)
                        {
                            str = "&nbsp;";
                        }
                        this.Pub1.AddTD(str);
                        break;

                    case DataType.AppString:
                        if (str == "" || str == null)
                        {
                            str = "&nbsp;";
                        }
                        if (attr.UIHeight != 0)
                        {
                            this.Pub1.AddTDDoc(str, str);
                        }
                        else
                        {
                            this.Pub1.AddTD(str);
                        }
                        break;

                    case DataType.AppBoolean:
                        if (str == "1")
                        {
                            this.Pub1.AddTD("是");
                        }
                        else
                        {
                            this.Pub1.AddTD("否");
                        }
                        break;

                    case DataType.AppFloat:
                    case DataType.AppInt:
                    case DataType.AppRate:
                    case DataType.AppDouble:
                        this.Pub1.AddTDNum(str);
                        break;

                    case DataType.AppMoney:
                        this.Pub1.AddTDNum(decimal.Parse(str).ToString("0.00"));
                        break;

                    default:
                        throw new Exception("no this case ...");
                    }
                }

                this.Pub1.AddTREnd();
            }

            #region  求合计代码写在这里。

            bool IsHJ = false;
            foreach (Attr attr in attrs)
            {
                if (attr.MyFieldType == FieldType.RefText || attr.UIContralType == UIContralType.DDL)
                {
                    continue;
                }

                if (attr.Key == "OID" || attr.Key == "FID" ||
                    attr.Key == "MID" || attr.Key.ToUpper() == "WORKID" ||
                    attr.Key == BP.WF.Data.NDXRptBaseAttr.FlowEndNode ||
                    attr.Key == BP.WF.Data.NDXRptBaseAttr.PWorkID)
                {
                    continue;
                }

                switch (attr.MyDataType)
                {
                case DataType.AppDouble:
                case DataType.AppFloat:
                case DataType.AppInt:
                case DataType.AppMoney:
                    IsHJ = true;
                    break;

                default:
                    break;
                }
            }

            if (IsHJ)
            {
                // 找出配置是不显示合计的列。
                this.Pub1.Add("<TR class='TRSum'>");
                this.Pub1.AddTD("class=Sum", "合计");
                this.Pub1.AddTD("class=Sum", "");

                foreach (Attr attr in attrs)
                {
                    if (attr.MyFieldType == FieldType.RefText ||
                        attr.UIVisible == false ||
                        attr.Key == "MyNum")
                    {
                        continue;
                    }

                    if (attr.MyDataType == DataType.AppBoolean)
                    {
                        this.Pub1.AddTD("class=Sum", "");
                        continue;
                    }

                    if (attr.UIContralType == UIContralType.DDL)
                    {
                        this.Pub1.AddTD("class=Sum", "");
                        continue;
                    }

                    if (attr.Key == "OID" || attr.Key == "FID" ||
                        attr.Key == "MID" || attr.Key.ToUpper() == "WORKID")
                    {
                        this.Pub1.AddTD("class=Sum", "");
                        continue;
                    }

                    switch (attr.MyDataType)
                    {
                    case DataType.AppDouble:
                        this.Pub1.AddTDNum(ens.GetSumDecimalByKey(attr.Key));
                        break;

                    case DataType.AppFloat:
                        this.Pub1.AddTDNum(ens.GetSumDecimalByKey(attr.Key));
                        break;

                    case DataType.AppInt:
                        this.Pub1.AddTDNum(ens.GetSumDecimalByKey(attr.Key));
                        break;

                    case DataType.AppMoney:
                        this.Pub1.AddTDJE(ens.GetSumDecimalByKey(attr.Key));
                        break;

                    default:
                        this.Pub1.AddTD("class=Sum", "");
                        break;
                    }
                }

                this.Pub1.AddTREnd();
            }
            #endregion

            this.Pub1.AddTableEnd();
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.DoType)
            {
            case "AddFlowMenu":     // 增加流程菜单, 并且让所有人都可以使用.
                BP.GPM.Menu  m   = new BP.GPM.Menu(this.RefNo);
                BP.GPM.Menus ens = new BP.GPM.Menus();
                ens.Retrieve(BP.GPM.MenuAttr.FK_App, m.FK_App, BP.GPM.MenuAttr.Flag, "BPMDir");
                if (ens.Count != 0)
                {
                    this.Response.Write("该系统中已经存在流程菜单,所以您不能增加");
                    return;
                }

                BP.GPM.Menu dir = null;

                #region 找到父级节点。
                if (m.HisMenuType == BP.GPM.MenuType.App)
                {
                    dir = m.DoCreateSubNode() as BP.GPM.Menu;
                }
                else
                {
                    m = new BP.GPM.Menu(m.ParentNo);
                }

                if (dir == null)
                {
                    if (m.HisMenuType == BP.GPM.MenuType.App)
                    {
                        dir = m.DoCreateSubNode() as BP.GPM.Menu;
                    }
                    else
                    {
                        m = new BP.GPM.Menu(m.ParentNo);
                    }
                }
                if (dir == null)
                {
                    if (m.HisMenuType == BP.GPM.MenuType.App)
                    {
                        dir = m.DoCreateSubNode() as BP.GPM.Menu;
                    }
                    else
                    {
                        m = new BP.GPM.Menu(m.ParentNo);
                    }
                }
                if (dir == null)
                {
                    if (m.HisMenuType == BP.GPM.MenuType.App)
                    {
                        dir = m.DoCreateSubNode() as BP.GPM.Menu;
                    }
                    else
                    {
                        m = new BP.GPM.Menu(m.ParentNo);
                    }
                }
                #endregion 找到父级节点。

                if (dir == null)
                {
                    /*没有找到应用程序的根目录.*/
                    this.Response.Write("没有找到应用程序的根目录,系统错误...");
                    return;
                }

                dir.Name        = "工作流程";
                dir.HisMenuType = BP.GPM.MenuType.Dir;
                dir.Flag        = "BPMDir";
                dir.FK_App      = m.FK_App;
                dir.Update();

                BP.WF.XML.ClassicMenus cms = new BP.WF.XML.ClassicMenus();
                cms.RetrieveAll();

                BP.Port.Stations stas = new BP.Port.Stations();
                stas.RetrieveAll();
                foreach (BP.WF.XML.ClassicMenu en in cms)
                {
                    BP.GPM.Menu func = dir.DoCreateSubNode() as BP.GPM.Menu;
                    func.Name        = en.Name;
                    func.Url         = en.Url;
                    func.FK_App      = m.FK_App;
                    func.HisMenuType = BP.GPM.MenuType.Menu;
                    func.Update();

                    // 把权限分配到各个岗位上去.
                    foreach (BP.Port.Station item in stas)
                    {
                        BP.GPM.ByStation bysta = new BP.GPM.ByStation();
                        bysta.FK_Station = item.No;
                        bysta.RefObj     = func.No;
                        try
                        {
                            bysta.Insert();
                        }
                        catch
                        {
                        }
                    }
                }
                this.WinClose();
                break;

            case "Del":
                MapRpt rpt = new MapRpt();
                rpt.No = this.RptNo;
                rpt.Delete();
                this.WinClose("ok");
                break;

            case "EnableKeySearch":
                MapData rpt1 = new MapData(this.RptNo);
                rpt1.RptIsSearchKey = !rpt1.RptIsSearchKey;
                rpt1.Update();
                this.WinClose("ok");
                break;

            default:
                break;
            }
        }