/// <summary>
        /// 初始化方法
        /// </summary>
        /// <returns></returns>
        public string S3ColsLabel_Init()
        {
            string rptNo = this.GetRequestVal("RptNo");

            //判断rptNo是否存在于mapdata中
            MapData md = new MapData();

            md.No = rptNo;
            if (md.RetrieveFromDBSources() == 0)
            {
                Rpt.RptDfine rd = new Rpt.RptDfine(this.FK_Flow);

                switch (rptNo.Substring(("ND" + int.Parse(this.FK_Flow) + "Rpt").Length))
                {
                case "My":
                    rd.DoReset_MyStartFlow();
                    break;

                case "MyDept":
                    rd.DoReset_MyDeptFlow();
                    break;

                case "MyJoin":
                    rd.DoReset_MyJoinFlow();
                    break;

                case "Adminer":
                    rd.DoReset_AdminerFlow();
                    break;

                default:
                    throw new Exception("@未涉及的rptMark类型");
                }

                md.RetrieveFromDBSources();
            }

            //选择的字段,就是报表的字段.
            MapAttrs mattrsOfRpt = new MapAttrs(rptNo);

            mattrsOfRpt.RemoveEn(rptNo + "_OID");
            mattrsOfRpt.RemoveEn(rptNo + "_Title");

            return(mattrsOfRpt.ToJson());
        }
        /// <summary>
        /// 初始化方法
        /// </summary>
        /// <returns></returns>
        public string S2ColsChose_Init()
        {
            DataSet ds    = new DataSet();
            string  rptNo = this.GetRequestVal("RptNo");

            //所有的字段.
            string   fk_mapdata = "ND" + int.Parse(this.FK_Flow) + "Rpt";
            MapAttrs mattrs     = new MapAttrs(fk_mapdata);

            ds.Tables.Add(mattrs.ToDataTableField("Sys_MapAttrOfAll"));

            //判断rptNo是否存在于mapdata中
            MapData md = new MapData();

            md.No = rptNo;
            if (md.RetrieveFromDBSources() == 0)
            {
                Rpt.RptDfine rd = new Rpt.RptDfine(this.FK_Flow);

                switch (rptNo.Substring(fk_mapdata.Length))
                {
                case "My":
                    rd.DoReset_MyStartFlow();
                    break;

                case "MyDept":
                    rd.DoReset_MyDeptFlow();
                    break;

                case "MyJoin":
                    rd.DoReset_MyJoinFlow();
                    break;

                case "Adminer":
                    rd.DoReset_AdminerFlow();
                    break;

                default:
                    throw new Exception("@未涉及的rptMark类型");
                }

                md.RetrieveFromDBSources();
            }

            //选择的字段,就是报表的字段.
            MapAttrs mattrsOfRpt = new MapAttrs(rptNo);

            ds.Tables.Add(mattrsOfRpt.ToDataTableField("Sys_MapAttrOfSelected"));

            //系统字段.
            MapAttrs mattrsOfSystem = new MapAttrs();
            var      sysFields      = BP.WF.Glo.FlowFields;

            foreach (MapAttr item in mattrs)
            {
                if (sysFields.Contains(item.KeyOfEn))
                {
                    mattrsOfSystem.AddEntity(item);
                }
            }
            ds.Tables.Add(mattrsOfSystem.ToDataTableField("Sys_MapAttrOfSystem"));

            //返回.
            return(BP.Tools.Json.DataSetToJson(ds, false));
        }
        public string S5SearchCond_Init()
        {
            //报表编号.
            string rptNo = this.GetRequestVal("RptNo");

            //定义容器.
            DataSet ds = new DataSet();

            //判断rptNo是否存在于mapdata中
            MapData md = new MapData();

            md.No = rptNo;
            if (md.RetrieveFromDBSources() == 0)
            {
                Rpt.RptDfine rd = new Rpt.RptDfine(this.FK_Flow);

                switch (rptNo.Substring(("ND" + int.Parse(this.FK_Flow) + "Rpt").Length))
                {
                case "My":
                    rd.DoReset_MyStartFlow();
                    break;

                case "MyDept":
                    rd.DoReset_MyDeptFlow();
                    break;

                case "MyJoin":
                    rd.DoReset_MyJoinFlow();
                    break;

                case "Adminer":
                    rd.DoReset_AdminerFlow();
                    break;

                default:
                    throw new Exception("@未涉及的rptMark类型");
                }

                md.RetrieveFromDBSources();
            }

            ds.Tables.Add(md.ToDataTableField("Main"));

            //查询出来枚举与外键类型的字段集合.
            MapAttrs attrs = new MapAttrs();

            attrs.Retrieve(MapAttrAttr.FK_MapData, rptNo);
            ds.Tables.Add(attrs.ToDataTableField("Sys_MapAttr"));

            #region 检查是否有日期字段.
            bool isHave = false;
            foreach (MapAttr mattr in attrs)
            {
                if (mattr.UIVisible == false)
                {
                    continue;
                }

                if (mattr.MyDataType == DataType.AppDate || mattr.MyDataType == DataType.AppDateTime)
                {
                    isHave = true;
                    break;
                }
            }

            if (isHave == true)
            {
                DataTable dt      = new DataTable();
                MapAttrs  dtAttrs = new MapAttrs();
                foreach (MapAttr mattr in attrs)
                {
                    if (mattr.MyDataType == DataType.AppDate || mattr.MyDataType == DataType.AppDateTime)
                    {
                        if (mattr.UIVisible == false)
                        {
                            continue;
                        }
                        dtAttrs.AddEntity(mattr);
                    }
                }
                ds.Tables.Add(dtAttrs.ToDataTableField("Sys_MapAttrOfDate"));
            }
            #endregion

            //返回数据.
            return(BP.Tools.Json.DataSetToJson(ds, false));
        }