/// <summary>
        ///  初始化sf2.
        /// </summary>
        /// <returns></returns>
        public string SF2_Init()
        {
            SFDBSrcs srcs = new SFDBSrcs();

            srcs.RetrieveAll();
            return(srcs.ToJson());
        }
Esempio n. 2
0
        public string ActiveDDL_Init()
        {
            DataSet ds = new DataSet();

            //加载外键字段.
            Paras ps = new Paras();

            ps.SQL = "SELECT KeyOfEn AS No, Name FROM Sys_MapAttr WHERE UIContralType=1 AND FK_MapData=" + SystemConfig.AppCenterDBVarStr + "FK_MapData AND KeyOfEn!=" + SystemConfig.AppCenterDBVarStr + "KeyOfEn";
            ps.Add("FK_MapData", this.FK_MapData);
            ps.Add("KeyOfEn", this.KeyOfEn);
            //var sql = "SELECT KeyOfEn AS No, Name FROM Sys_MapAttr WHERE UIContralType=1 AND FK_MapData='" + this.FK_MapData + "' AND KeyOfEn!='" + this.KeyOfEn + "'";
            DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(ps);

            dt.TableName = "Sys_MapAttr";

            dt.Columns[0].ColumnName = "No";
            dt.Columns[1].ColumnName = "Name";
            ds.Tables.Add(dt);

            if (dt.Rows.Count == 0)
            {
                return("err@表单中没有要级联的下拉框.");
            }

            //加载数据源.
            SFDBSrcs srcs = new SFDBSrcs();

            srcs.RetrieveAll();
            DataTable dtSrc = srcs.ToDataTableField();

            dtSrc.TableName = "Sys_SFDBSrc";
            ds.Tables.Add(dtSrc);

            // 加载mapext 数据.
            MapExt me = new MapExt();
            int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.ActiveDDL,
                                    MapExtAttr.FK_MapData, this.FK_MapData,
                                    MapExtAttr.AttrOfOper, this.KeyOfEn);

            if (i == 0)
            {
                me.FK_MapData = this.FK_MapData;
                me.AttrOfOper = this.KeyOfEn;
                me.FK_DBSrc   = "local";
            }

            if (me.FK_DBSrc == "")
            {
                me.FK_DBSrc = "local";
            }

            //去掉 ' 号.
            me.SetValByKey("Doc", me.Doc);

            dt           = me.ToDataTableField();
            dt.TableName = "Sys_MapExt";
            ds.Tables.Add(dt);

            return(BP.Tools.Json.ToJson(ds));
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                MapExt me = new MapExt();

                me.Retrieve(MapExtAttr.FK_MapData, this.FK_MapData, MapExtAttr.ExtType, this.ExtType, MapExtAttr.AttrOfOper, this.RefNo);
                this.TB_SQL.Text = me.Doc;

                BP.Sys.SFDBSrcs srcs = new SFDBSrcs();
                srcs.RetrieveAll();
                BP.Web.Controls.Glo.DDL_BindEns(this.DDL_DBSrc, srcs, me.FK_DBSrc);
            }
        }
Esempio n. 4
0
        public string DDLFullCtrl_Init()
        {
            DataSet ds = new DataSet();

            //加载数据源.
            SFDBSrcs srcs = new SFDBSrcs();

            srcs.RetrieveAll();
            DataTable dtSrc = srcs.ToDataTableField();

            dtSrc.TableName = "Sys_SFDBSrc";
            ds.Tables.Add(dtSrc);

            // 加载 mapext 数据.
            MapExt me = new MapExt();
            int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.DDLFullCtrl,
                                    MapExtAttr.FK_MapData, this.FK_MapData,
                                    MapExtAttr.AttrOfOper, this.KeyOfEn);

            if (i == 0)
            {
                me.FK_MapData = this.FK_MapData;
                me.AttrOfOper = this.KeyOfEn;
                me.FK_DBSrc   = "local";
            }

            me.W = i;

            if (me.FK_DBSrc == "")
            {
                me.FK_DBSrc = "local";
            }

            //去掉 ' 号.
            me.SetValByKey("Doc", me.Doc);

            DataTable dt = me.ToDataTableField();

            dt.TableName = "Sys_MapExt";
            ds.Tables.Add(dt);

            return(BP.Tools.Json.ToJson(ds));
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapExt me = new MapExt();
            // me.MyPK = this.FK_MapData + "_" + this.ExtType + "_" + me.AttrOfOper + "_" + me.AttrsOfActive;

            int i = me.Retrieve(MapExtAttr.FK_MapData, this.FK_MapData, MapExtAttr.ExtType, MapExtXmlList.ActiveDDL,
                                MapExtAttr.AttrOfOper, this.RefNo);

            this.Pub1.AddEasyUiPanelInfoBegin("为下拉框[" + this.RefNo + "]设置联动.", "icon-edit");
            me.FK_MapData = this.FK_MapData;

            this.Pub1.AddTableNormal();

            MapAttrs attrs = new MapAttrs(this.FK_MapData);

            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("联动下拉框:");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_Attr";
            foreach (MapAttr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                if (attr.UIIsEnable == false)
                {
                    continue;
                }

                if (attr.UIContralType != UIContralType.DDL)
                {
                    continue;
                }

                if (attr.KeyOfEn == this.RefNo)
                {
                    continue;
                }

                ddl.Items.Add(new ListItem(attr.KeyOfEn + " - " + attr.Name, attr.KeyOfEn));
            }
            ddl.SetSelectItem(me.AttrsOfActive);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("要实现联动的菜单");
            this.Pub1.AddTREnd();

            // 数据源列表.
            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("colspan=1", "数据源");

            ddl = new DDL();
            SFDBSrcs srcs = new SFDBSrcs();

            srcs.RetrieveAll();
            ddl.BindEntitiesNoName(srcs);

            this.Pub1.AddTD(ddl);
            // this.Pub1.AddTD("ccform允许从其他数据源中取数据,<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='/WF/Img/Setting.png' border=0/>设置/新建数据源</a>, <a href=\"javascript:window.localhost.href=window.localhost.href;\" >刷新数据源</a>");
            this.Pub1.AddTD("ccform允许从其他数据源中取数据,<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs','d2')\" ><img src='/WF/Img/Setting.png' border=0/>设置/新建数据源</a>, <a href=\"javascript:window.localhost.href=window.localhost.href;\" >刷新数据源</a>");

            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin("colspan='3'");
            RadioButton rb = new RadioButton();

            rb.Text      = "通过sql获取联动";
            rb.GroupName = "sdr";
            rb.ID        = "RB_0";
            if (me.DoWay == 0)
            {
                rb.Checked = true;
            }

            this.Pub1.Add("在下面文本框中输入一个SQL,具有编号,标签列,用来绑定下从动下拉框。<br />");
            this.Pub1.Add("比如:SELECT No, Name FROM CN_City WHERE FK_SF = '@Key' ");
            this.Pub1.AddBR();
            TextBox tb = new TextBox();

            tb.ID       = "TB_Doc";
            tb.Text     = me.Doc;
            tb.Columns  = 80;
            tb.CssClass = "TH";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 7;
            tb.Style.Add("width", "99%");
            this.Pub1.Add(tb);
            this.Pub1.AddBR();
            this.Pub1.Add("说明:@Key是ccflow约定的关键字,是主下拉框传递过来的值");
            //this.Pub1.AddFieldSetEnd();

            rb           = new RadioButton();
            rb.Text      = "通过编码标识获取";
            rb.GroupName = "sdr";
            rb.Enabled   = false;
            rb.ID        = "RB_1";
            if (me.DoWay == 1)
            {
                rb.Checked = true;
            }

            //this.Pub1.AddFieldSet(rb);
            this.Pub1.Add("主菜单是编号的是从动菜单编号的前几位,不必联动内容。<br />");
            this.Pub1.Add("比如: 主下拉框是省份,联动菜单是城市。");
            //this.Pub1.AddFieldSetEnd();

            //this.Pub1.Add("</TD>");
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_SaveJiLian_Click);
            this.Pub1.AddTD("colspan=2", btn);

            if (i != 0)
            {
                btn        = new LinkBtn(false, NamesOfBtn.Delete, "删除");
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.AddTD("colspan=1", btn);
            }

            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
            this.Pub1.AddEasyUiPanelInfoEnd();
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GloVar gvar = new GloVar();

            gvars = gvar.GetNewEntities as GloVars;
            gvars.Retrieve(GloVarAttr.GroupKey, "IntegrationSet");

            gvarSModel  = gvars.GetEntityByKey("StructureModel") as GloVar;
            gvarSMKind  = gvars.GetEntityByKey("StructureMngKind") as GloVar;
            gvarSSource = gvars.GetEntityByKey("StructureSource") as GloVar;

            GenerateCheckedInfo();

            switch (Step)
            {
            case 1:

                #region 设置组织结构模式

                Pub1.Add("选择组织结构模式:");

                if (gvarSModel == null)
                {
                    gvarSModel          = new GloVar();
                    gvarSModel.No       = "StructureModel";
                    gvarSModel.Name     = "组织结构模式";
                    gvarSModel.Val      = "1";
                    gvarSModel.GroupKey = "IntegrationSet";
                    gvarSModel.Note     = GetJoinStringFromArray(_smodels);
                    gvarSModel.Insert();
                }

                BPRadioButtonList rads = new BPRadioButtonList();
                rads.ID = "Rads_StructureModel";
                AddCheckItems(rads, _smodels);
                rads.RepeatDirection = RepeatDirection.Horizontal;
                rads.RepeatLayout    = RepeatLayout.Flow;
                rads.SetSelectItem(gvarSModel.Val);
                Pub1.Add(rads);
                Pub1.AddBR();
                Pub1.AddBR();

                AddButton(NamesOfBtn.Save, "保存并继续");
                #endregion

                break;

            case 2:

                #region 设置组织结构维护方式

                Pub1.Add("设置组织结构维护方式:");

                if (gvarSMKind == null)
                {
                    gvarSMKind          = new GloVar();
                    gvarSMKind.No       = "StructureMngKind";
                    gvarSMKind.Name     = "组织结构维护方式";
                    gvarSMKind.Val      = "1";
                    gvarSMKind.GroupKey = "IntegrationSet";
                    gvarSMKind.Note     = GetJoinStringFromArray(_smkinds);
                    gvarSMKind.Insert();
                }

                rads    = new BPRadioButtonList();
                rads.ID = "Rads_StructureMngKind";
                AddCheckItems(rads, _smkinds);
                rads.RepeatDirection = RepeatDirection.Horizontal;
                rads.RepeatLayout    = RepeatLayout.Flow;
                rads.SetSelectItem(gvarSMKind.Val);
                Pub1.Add(rads);
                Pub1.AddBR();
                Pub1.AddBR();

                AddButton(NamesOfBtn.Save, "保存并继续");
                Pub1.AddSpace(1);
                AddButton(NamesOfBtn.Back, "上一步");
                #endregion

                break;

            case 3:

                #region  择组织结构来源

                Pub1.Add("选择组织结构来源:");

                if (gvarSSource == null)
                {
                    gvarSSource          = new GloVar();
                    gvarSSource.No       = "StructureSource";
                    gvarSSource.Name     = "选择组织结构来源";
                    gvarSSource.Val      = "1";
                    gvarSSource.GroupKey = "IntegrationSet";
                    gvarSSource.Note     = GetJoinStringFromArray(_ssources);
                    gvarSSource.Insert();
                }

                rads    = new BPRadioButtonList();
                rads.ID = "Rads_StructureSource";
                AddCheckItems(rads, _ssources);
                rads.RepeatDirection = RepeatDirection.Horizontal;
                rads.RepeatLayout    = RepeatLayout.Flow;
                rads.SetSelectItem(gvarSSource.Val);
                Pub1.Add(rads);
                Pub1.AddBR();
                Pub1.AddBR();

                AddButton(NamesOfBtn.Save, "保存并继续");
                Pub1.AddSpace(1);
                AddButton(NamesOfBtn.Back, "上一步");
                #endregion

                break;

            case 4:

                #region 配置查询语句

                string msg = string.Empty;

                if (gvarSModel == null)
                {
                    msg = "“<a href='?step=1'>组织结构模式</a>”、";
                }

                if (gvarSMKind == null)
                {
                    msg += "“<a href='?step=2'>组织结构维护方式</a>”、";
                }

                if (gvarSSource == null)
                {
                    msg += "“<a href='?step=3'>组织结构来源</a>”";
                }

                if (!string.IsNullOrWhiteSpace(msg))
                {
                    Pub1.AddEasyUiPanelInfo("信息", "请先配置" + msg.TrimEnd('、') + ",然后配置此项!");
                    Pub1.AddBR();
                    AddButton(NamesOfBtn.Back, "上一步");
                    return;
                }

                //如果组织结构来源选择的是WebService和AD,则提示用户编写提供的通用webservice,以联接这两方载体
                if (gvarSSource.Val == "2" || gvarSSource.Val == "3")
                {
                    Pub1.AddEasyUiPanelInfo("信息", "您选择的组织结构数据来源是“<span style='font-weight:bold;'>" + _ssources[int.Parse(gvarSSource.Val) - 1] + "</span>”,该种方式目前请自行修改位于CCFlow项目下的WebService文件:\\DataUser\\PortalInterface.asmx,此WebService用来提供组织结构的相关数据。");
                    Pub1.AddBR();
                    AddButton(NamesOfBtn.Back, "上一步");
                    return;
                }

                if (gvarSModel.Val == "1")
                {
                    //一个用户一个部门
                    _oneones = new Dictionary <string, Dictionary <string, string> >();
                    maps     = new[]
                    {
                        new BP.Port.Station().EnMap,
                        new BP.Port.Dept().EnMap,
                        new BP.Port.Emp().EnMap,
                        new BP.Port.EmpStation().EnMap
                    };
                    GenerateMapAttrs(_oneones, maps);
                }
                else
                {
                    //一个用户多个部门
                    _onemores = new Dictionary <string, Dictionary <string, string> >();
                    maps      = new[]
                    {
                        new BP.GPM.StationType().EnMap,
                        new BP.GPM.Station().EnMap,
                        new BP.GPM.Dept().EnMap,
                        new BP.GPM.Duty().EnMap,
                        new BP.GPM.DeptDuty().EnMap,
                        new BP.GPM.Emp().EnMap,
                        new BP.GPM.DeptEmp().EnMap,
                        new BP.GPM.DeptStation().EnMap,
                        new BP.GPM.DeptEmpStation().EnMap
                    };
                    GenerateMapAttrs(_onemores, maps);
                }

                //如果组织结构维护方式选择的是由“CCBPM组织结构维护”,则下面的配置查询语句就不需要了
                if (gvarSMKind.Val == "1")
                {
                    msg = "您选择的组织结构数据来源是“<span style='font-weight:bold;'>" + _ssources[int.Parse(gvarSSource.Val) - 1] + "</span>”,组织结构维护方式选择的是“<span style='font-weight:bold;'>" + _smkinds[int.Parse(gvarSMKind.Val) - 1] + "</span>”,组织结构模式是“<span style='font-weight:bold;'>" + _smodels[int.Parse(gvarSModel.Val) - 1] + "</span>”,此种模式下,在ccbpm的主库中需要维护的相关表有:<br />";

                    if (gvarSModel.Val == "1")
                    {
                        //一个用户一个部门
                        msg += "1.岗位类型[Sys_Enum]。Sys_Enum枚举表中EnumKey='StaGrade'的枚举。<br />";

                        for (int i = 0; i < maps.Length; i++)
                        {
                            msg += string.Format("{0}.{1}[{2}]。<br />", i + 2, maps[i].EnDesc, maps[i].PhysicsTable);
                        }
                    }
                    else
                    {
                        //一个用户多个部门
                        for (int i = 0; i < maps.Length; i++)
                        {
                            msg += string.Format("{0}.{1}[{2}]。<br />", i + 1, maps[i].EnDesc, maps[i].PhysicsTable);
                        }
                    }

                    msg += " <hr> 在这种运行模式下,ccbpm系统已经为您提供了一套维护组织机构的功能,您可以左边的组织机构树进行维护。";
                    Pub1.AddEasyUiPanelInfo("信息", msg);
                    Pub1.AddBR();
                    AddButton(NamesOfBtn.Back, "上一步");
                }
                else
                {
                    Pub1.Add(
                        "您选择的组织结构数据来源是“<span style='font-weight:bold;'>" + _ssources[int.Parse(gvarSSource.Val) - 1] + "</span>”,组织结构维护方式选择的是“<span style='font-weight:bold;'>" + _smkinds[int.Parse(gvarSMKind.Val) - 1] + "</span>”,组织结构模式是“<span style='font-weight:bold;'>" + _smodels[int.Parse(gvarSModel.Val) - 1] + "</span>”。<br />");

                    gvarDBSrc = gvars.GetEntityByKey("StructureDBSrc") as GloVar;

                    if (gvarDBSrc == null)
                    {
                        gvarDBSrc          = new GloVar();
                        gvarDBSrc.No       = "StructureDBSrc";
                        gvarDBSrc.Name     = "数据源编号";
                        gvarDBSrc.Val      = "local";
                        gvarDBSrc.Note     = "数据源是Sys_SFDBSrc表";
                        gvarDBSrc.GroupKey = "IntegrationSet";
                        gvarDBSrc.Save();
                    }

                    //gvarDBOver = gvars.GetEntityByKey("StructureDBOver") as GloVar;

                    //if (gvarDBOver == null)
                    //{
                    //    gvarDBOver = new GloVar();
                    //    gvarDBOver.No = "StructureDBOver";
                    //    gvarDBOver.Name = "数据源SQL配置是否完成";
                    //    gvarDBOver.Val = "False";
                    //    gvarDBOver.Note = "若组织结构配置的SQL已经配置完成,且有效,则为True;反之,为False";
                    //    gvarDBOver.GroupKey = "IntegrationSet";
                    //    gvarDBOver.Save();
                    //}

                    SFDBSrcs srcs = new SFDBSrcs();
                    srcs.RetrieveAll(SFDBSrcAttr.DBSrcType);

                    //根据传来的数据源编号,变更当前的数据源
                    if (!string.IsNullOrWhiteSpace(Request.QueryString["src"]) && srcs.IsExits(SFDBSrcAttr.No, Request.QueryString["src"]))
                    {
                        gvarDBSrc.Val = Request.QueryString["src"];
                        gvarDBSrc.Update();
                    }

                    DDL ddl = new DDL();
                    ddl.CssClass = "easyui-combobox";
                    ddl.Attributes["data-options"] = "onSelect:function(rcd){location.href='Integration.aspx?step=4&src=' + rcd.value;}";
                    ddl.ID           = "DDL_DBSrcs";
                    ddl.AutoPostBack = true;
                    ddl.BindEntities(srcs);
                    ddl.SetSelectItem(gvarDBSrc.Val);

                    Pub1.AddBR();
                    Pub1.Add("选择数据源:");
                    Pub1.Add(ddl);
                    Pub1.AddSpace(1);
                    Pub1.Add("<a href=\"javascript: OpenEasyUiDialog('../../Comm/Sys/SFDBSrcNewGuide.aspx', 'eudlgframe', '新建数据源', 760, 470, 'icon-add', true, function () {location.href = location.href;})\" class='easyui-linkbutton' data-optinos=\"iconCls:'icon-add'\">新建数据源</a>");
                    Pub1.AddBR();
                    Pub1.AddBR();

                    //if (gvarDBSrc.Val == "local")
                    //{
                    //    Pub1.AddEasyUiPanelInfo("信息", string.Format("“<span style='font-weight:bold;'>{0}</span>”是CCFlow主数据源,不需要进行组织结构的SQL配置。", ddl.SelectedItem.Text));
                    //    Pub1.AddBR();
                    //    AddButton(NamesOfBtn.Back, "上一步");
                    //    return;
                    //}

                    Pub1.Add("选择此数据源,需要配置的相关表的SQL查询语句如下:");
                    Pub1.AddBR();
                    Pub1.AddBR();

                    if (gvarSModel.Val == "1")
                    {
                        #region     //一个用户一个部门
                        Pub1.Add("1.<span style='font-weight:bold;'>岗位类型数据</span>。<br />");
                        LinkBtn btn = new LinkBtn(false, NamesOfBtn.Edit, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编辑数据");
                        btn.PostBackUrl   = "javascript:void(0)";
                        btn.OnClientClick = "OpenEasyUiDialog('../../Comm/Sys/EnumList.aspx?RefNo=StaGrade&t=' + Math.random(), 'euiframe','编辑岗位类型',600,374,'icon-edit')";
                        Pub1.Add(btn);
                        Pub1.AddBR();
                        Pub1.AddBR();
                        #endregion
                    }

                    int idx = gvarSModel.Val == "1" ? 2 : 1;
                    TB  tb  = null;
                    foreach (BP.En.Map map in maps)
                    {
                        gvar = CheckGloVar(gvars, map.PhysicsTable, map.EnDesc);
                        Pub1.Add(GenerateAttrDescs(map, idx++));
                        tb          = new TB();
                        tb.ID       = "TB_" + map.PhysicsTable;
                        tb.TextMode = TextBoxMode.MultiLine;
                        tb.Text     = (gvar.Val ?? string.Empty).Replace('~', '\'');
                        tb.Wrap     = true;
                        tb.Width    = 760;
                        tb.Height   = 60;
                        Pub1.Add(tb);
                        Pub1.AddBR();
                        AddButton(NamesOfBtn.DataCheck + "_" + map.PhysicsTable, "检查正确性");
                        Pub1.AddSpace(1);
                        AddButton(NamesOfBtn.Open + "_" + map.PhysicsTable, "打开数据源");
                        Pub1.AddBR();
                        Pub1.AddBR();
                    }

                    AddButton(NamesOfBtn.Setting, "设置全部");
                    Pub1.AddSpace(1);
                    AddButton(NamesOfBtn.Back, "上一步");
                    Pub1.AddBR();
                    Pub1.AddBR();
                }
                #endregion

                break;
            }
        }