示例#1
0
        private void BindSearch()
        {
            Flow fl   = new Flow(this.FK_Flow);
            var  gwfs = new GenerWorkFlows();
            var  qo   = new QueryObject(gwfs);

            qo.AddWhere(GenerWorkFlowAttr.FK_Flow, FK_Flow);

            if (!string.IsNullOrWhiteSpace(Depts))
            {
                qo.addAnd();
                qo.AddWhereIn(GenerWorkFlowAttr.FK_Dept, "(" + Depts + ")");
            }

            if (!string.IsNullOrWhiteSpace(Emps))
            {
                qo.addAnd();
                qo.AddWhereIn(GenerWorkFlowAttr.Starter, "(" + Emps.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Aggregate(string.Empty, (curr, next) => curr + "'" + next + "',").TrimEnd(',') + ")");
            }

            if (!string.IsNullOrWhiteSpace(DateFrom))
            {
                qo.addAnd();
                qo.AddWhere(GenerWorkFlowAttr.RDT, ">", DateFrom);
            }

            if (!string.IsNullOrWhiteSpace(DateTo))
            {
                qo.addAnd();
                qo.AddWhere(GenerWorkFlowAttr.RDT, "<=", DateTo);
            }

            if (!string.IsNullOrWhiteSpace(Keywords))
            {
                qo.addAnd();
                qo.AddWhere(GenerWorkFlowAttr.Title, "LIKE", "%" + Keywords + "%");
            }

            qo.addOrderBy(GenerWorkFlowAttr.RDT);

            var url = string.Format("FlowDB.aspx?FK_Flow={0}&WorkID={1}&IsSearch=1&Depts={2}&DeptsText={3}&Emps={4}&EmpsText={5}&DateFrom={6}&DateTo={7}&Keywords={8}", FK_Flow, WorkID, Depts, DeptsText, Emps, EmpsText, DateFrom, DateTo, Keywords);

            Pub2.BindPageIdxEasyUi(qo.GetCount(), url, this.PageIdx, SystemConfig.PageSize);

            qo.DoQuery(gwfs.GetNewEntity.PK, SystemConfig.PageSize, this.PageIdx);

            this.Pub1.AddTable("class='Table' cellspacing='0' cellpadding='0' border='0' style='width:100%'");

            Pub1.AddTR();
            Pub1.AddTDGroupTitle("colspan='8'", fl.Name);
            Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("style='text-align:center'", "序号");
            this.Pub1.AddTDGroupTitle("部门");
            this.Pub1.AddTDGroupTitle("发起人");
            this.Pub1.AddTDGroupTitle("发起时间");
            this.Pub1.AddTDGroupTitle("当前停留节点");
            this.Pub1.AddTDGroupTitle("标题");
            this.Pub1.AddTDGroupTitle("处理人");
            this.Pub1.AddTDGroupTitle("操作");
            this.Pub1.AddTREnd();

            int idx = 0;

            foreach (GenerWorkFlow item in gwfs)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(SystemConfig.PageSize * (this.PageIdx - 1) + idx);
                this.Pub1.AddTD(item.DeptName);
                this.Pub1.AddTD(item.StarterName);
                this.Pub1.AddTD(item.RDT);
                this.Pub1.AddTD(item.NodeName);
                this.Pub1.AddTD(item.Title);
                this.Pub1.AddTD(item.TodoEmps);

                this.Pub1.AddTDBegin();
                this.Pub1.Add("<a href=\"javascript:WinOpen('./../../WFRpt.aspx?WorkID=" + item.WorkID + "&FK_Flow=" + this.FK_Flow + "&FID=" + item.FID + "','ds'); \" class='easyui-linkbutton'>轨迹</a>&nbsp;");
                //this.Pub1.Add("<a href=\"javascript:WinOpen('../../../WFRpt.aspx?WorkID=" + item.WorkID + "&FK_Flow=" + this.FK_Flow + "&FID=" + item.FID + "&FK_Node=" + item.FK_Node + "','ds'); \" >报告</a>-");
                this.Pub1.Add("<a href=\"javascript:DelIt('" + item.FK_Flow + "','" + item.WorkID + "');\" class='easyui-linkbutton' data-options=\"iconCls:'icon-delete'\" onclick=\"return confirm('您确定要删除吗?');\">删除</a>&nbsp;");
                this.Pub1.Add("<a href=\"javascript:FlowShift('" + item.FK_Flow + "','" + item.WorkID + "');\" class='easyui-linkbutton'>移交</a>&nbsp;");
                this.Pub1.Add("<a href=\"javascript:FlowSkip('" + item.FK_Flow + "','" + item.WorkID + "');\" class='easyui-linkbutton'>跳转</a>");
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //this.Response.Redirect("ImpTableField1504.aspx?EnsName=" + this.FK_MapData,
            //    true);
            //return;

            #region 第1步.
            if (this.Step == 1)
            {
                BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
                ens.RetrieveAll();

                Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "第1步:请选择数据源");
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.AddUL("class='navlist'");

                foreach (BP.Sys.SFDBSrc item in ens)
                {
                    Pub1.AddLi("<div><a href='ImpTableField.aspx?Step=2&FK_MapData=" + this.FK_MapData + "&FK_SFDBSrc=" + item.No + "'><span class='nav'>" + item.No + "  -  " + item.Name + "</span></a></div>");
                }

                Pub1.AddLi("<div><a href=\"javascript:WinOpen('/WF/Comm/RefFunc/UIEn.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='../Img/New.gif' align='middle' /><span class='nav'>新建数据源</span></a></div>");

                Pub1.AddULEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                Pub1.AddTableEnd();
            }
            #endregion 第1步.

            #region 第2步.
            if (this.Step == 2)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);

                this.Pub1.Add("<div class='easyui-layout' data-options=\"fit:true\">");
                this.Pub1.Add(string.Format("<div data-options=\"region:'west',split:true,title:'选择 {0} 数据表/视图'\" style='width:200px;'>",
                                            src.DBName));

                DataTable dt = src.GetTables();
                this.Pub1.AddUL();
                foreach (DataRow dr in dt.Rows)
                {
                    string url = "?Step=" + this.Step + "&FK_MapData=" + this.FK_MapData + "&FK_SFDBSrc=" + this.FK_SFDBSrc + "&STable=" + dr["No"].ToString();
                    if (dr["No"].ToString() == this.STable)
                    {
                        this.Pub1.Add("<li><font color=red><b>" + dr["Name"] + "</font></b></li>");
                    }
                    else
                    {
                        this.Pub1.Add("<li><a href='" + url + "' >" + dr["Name"] + "</a></li>");
                    }
                }
                this.Pub1.AddULEnd();

                Pub1.AddDivEnd();

                this.Pub1.Add("<div data-options=\"region:'center',title:'第2步:请选择要导入的数据列(" + this.STable + ")'\" style='padding:5px;'>");

                //加载选中数据表/视图的列信息
                this.Pub1.AddTable(); // ("id='maintable' class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");
                this.Pub1.AddTR();

                var cb = new CheckBox();
                cb.ID = "CB_CheckAll";
                cb.Attributes["onclick"] = "CheckAll(this.checked)";

                this.Pub1.AddTDGroupTitle("style='width:40px;text-align:center'", cb);
                this.Pub1.AddTDGroupTitle("序");
                this.Pub1.AddTDGroupTitle("字段名");
                this.Pub1.AddTDGroupTitle("中文描述");
                this.Pub1.AddTDGroupTitle("style='width:80px;text-align:center'", "类型");
                this.Pub1.AddTDGroupTitle("style='width:50px;text-align:center'", "最大长度");
                this.Pub1.AddTREnd();

                MapAttrs attrs  = new MapAttrs(this.FK_MapData);
                bool     isHave = false;

                var tableColumns = src.GetColumns(this.STable);
                foreach (DataRow dr in tableColumns.Rows)
                {
                    cb         = new CheckBox();
                    cb.ID      = "CB_Col_" + dr["name"];
                    cb.Checked = this.SColumns == null ? false : this.SColumns.Contains(dr["name"] + ",");

                    //如果已经有该字段,就放弃.
                    if (attrs.Contains(MapAttrAttr.KeyOfEn, dr["name"].ToString()))
                    {
                        continue;
                        cb.Enabled = false;
                    }

                    this.Pub1.AddTR();
                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD(dr["colid"].ToString());
                    this.Pub1.AddTD(dr["name"].ToString());
                    this.Pub1.AddTD(dr["Desc"].ToString());
                    this.Pub1.AddTD(dr["type"].ToString());
                    this.Pub1.AddTD(Convert.ToInt32(dr["length"]));
                    this.Pub1.AddTREnd();
                }


                this.Pub1.AddTableEnd();
                this.Pub1.AddBR();
                this.Pub1.AddBR();
                this.Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Next, "下一步");
                btn.Click += new EventHandler(btn_Click);
                this.Pub1.Add(btn);
                this.Pub1.AddSpace(1);

                this.Pub1.Add(string.Format("<a href='{0}?Step=1&FK_MapData={1}' class='easyui-linkbutton'>上一步</a>", Request.Url.AbsolutePath, this.FK_MapData));
                this.Pub1.AddBR();
                this.Pub1.AddBR();
                this.Pub1.AddDivEnd();
                this.Pub1.AddDivEnd();
            }
            #endregion 第2步.

            #region 第3步.
            if (this.Step == 3)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);
                this.Pub1.AddTable(); // ("id='maintable' class='Table' cellSpacing='0' cellPadding='0' border='0' style='width:100%'");
                this.Pub1.AddTDGroupTitle("序");
                this.Pub1.AddTDGroupTitle("字段名");
                this.Pub1.AddTDGroupTitle("中文描述");
                this.Pub1.AddTDGroupTitle("数据类型");
                this.Pub1.AddTDGroupTitle("逻辑类型");
                this.Pub1.AddTDGroupTitle("绑定值(双击选择)");
                this.Pub1.AddTDGroupTitle("最大长度");
                this.Pub1.AddTDGroupTitle("顺序");
                this.Pub1.AddTREnd();

                var tableColumns = src.GetColumns(this.STable);
                var idx          = 0;

                foreach (DataRow dr in tableColumns.Rows)
                {
                    if (this.SColumns.Contains(dr["name"] + ",") == false)
                    {
                        continue;
                    }

                    string typeString = dr["type"].ToString().ToLower();
                    int    mydatatype = 1;
                    if (typeString.Contains("int"))
                    {
                        mydatatype = BP.DA.DataType.AppInt;
                    }
                    if (typeString.Contains("float"))
                    {
                        mydatatype = BP.DA.DataType.AppFloat;
                    }
                    if (typeString.Contains("double"))
                    {
                        mydatatype = BP.DA.DataType.AppDouble;
                    }

                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(dr["name"].ToString());

                    //中文描述.
                    var tb = new TB();
                    tb.ID      = "TB_Desc_" + dr["name"];
                    tb.Columns = 20;
                    tb.Text    = dr["Desc"].ToString();
                    if (tb.Text.Length == 0)
                    {
                        tb.Text = dr["name"].ToString();
                    }
                    this.Pub1.AddTD(tb);

                    //数据类型.
                    var ddl = new DDL();
                    ddl.ID = "DDL_DBType_" + dr["name"];
                    ddl.SelfBindSysEnum(MapAttrAttr.MyDataType);
                    ddl.SetSelectItem(mydatatype); //设置选择的项目.
                    this.Pub1.AddTD(ddl);

                    //逻辑类型.
                    ddl    = new DDL();
                    ddl.ID = "DDL_LogicType_" + dr["name"];
                    ddl.SelfBindSysEnum(MapAttrAttr.LGType);
                    this.Pub1.AddTD(ddl);


                    //绑定的逻辑类型.
                    tb         = new TB();
                    tb.ID      = "TB_BindKey_" + dr["name"];
                    tb.Columns = 30;
                    tb.Text    = dr["name"].ToString();
                    tb.Attributes["ondblclick"] = "OpenSelectBindKey(this)";
                    this.Pub1.AddTD(tb);

                    //最大长度.
                    //绑定的逻辑类型.
                    tb         = new TB();
                    tb.ID      = "TB_Len_" + dr["name"];
                    tb.Columns = 5;
                    tb.Text    = dr["length"].ToString();
                    this.Pub1.AddTD(tb);

                    this.Pub1.AddTDBegin("style='text-align:center'");
                    var hiddenIdx = new HiddenField();
                    hiddenIdx.ID    = "HID_Idx_" + dr["name"];
                    hiddenIdx.Value = idx.ToString();
                    this.Pub1.Add(hiddenIdx);

                    this.Pub1.Add("<a href='javascript:void(0)' onclick='up(this, 6)' class='easyui-linkbutton' data-options=\"iconCls:'icon-up'\"></a>&nbsp;");
                    this.Pub1.Add("<a href='javascript:void(0)' onclick='down(this, 6)' class='easyui-linkbutton' data-options=\"iconCls:'icon-down'\"></a>");

                    this.Pub1.AddTDEnd();
                    this.Pub1.AddTREnd();
                }

                this.Pub1.AddTableEnd();
                this.Pub1.AddBR();
                this.Pub1.AddBR();
                this.Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Save, "导入字段,生成表单");
                btn.Click += new EventHandler(btn_Save_Click);
                this.Pub1.Add(btn);
                this.Pub1.AddSpace(1);

                this.Pub1.Add(string.Format("<a href='{0}' class='easyui-linkbutton'>上一步</a>", Request.Url.ToString().Replace("Step=3", "Step=2")));
                this.Pub1.AddBR();
                this.Pub1.AddBR();
            }
            #endregion 第3步.
        }
示例#3
0
        /// <summary>
        /// 新建文本框自动完成
        /// </summary>
        public void EditAutoFullDtl_TB()
        {
            MapExt  myme = new MapExt(this.MyPK);
            MapDtls dtls = new MapDtls(myme.FK_MapData);

            if (dtls.Count == 0)
            {
                this.Pub1.Clear();
                Pub1.AddEasyUiPanelInfo("设置自动填充从表", "<p>该表单下没有从表,所以您不能为从表设置自动填充。<a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a></p>");
                return;
            }

            Pub1.AddTableNormal();
            Pub1.AddTRGroupTitle("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");

            string[] strs = myme.Tag1.Split('$');
            foreach (MapDtl dtl in dtls)
            {
                TextBox tb = new TextBox();
                tb.ID      = "TB_" + dtl.No;
                tb.Columns = 70;
                tb.Style.Add("width", "100%");
                tb.Rows     = 5;
                tb.TextMode = TextBoxMode.MultiLine;
                foreach (string s in strs)
                {
                    if (s == null)
                    {
                        continue;
                    }

                    if (s.Contains(dtl.No + ":") == false)
                    {
                        continue;
                    }

                    string[] ss = s.Split(':');
                    tb.Text = ss[1];
                }

                //this.Pub1.AddFieldSet("编号:" + dtl.No + ",名称:" + dtl.Name);
                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.Add("编号:" + dtl.No + ",名称:" + dtl.Name);
                Pub1.AddBR();
                Pub1.Add(tb);
                Pub1.AddBR();

                string   fs    = "可填充的字段:";
                MapAttrs attrs = new MapAttrs(dtl.No);
                foreach (MapAttr item in attrs)
                {
                    if (item.KeyOfEn == "OID" || item.KeyOfEn == "RefPKVal")
                    {
                        continue;
                    }
                    fs += item.KeyOfEn + ",";
                }

                this.Pub1.Add(fs.Substring(0, fs.Length - 1));
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
            }

            //this.Pub1.AddHR();
            Pub1.AddTableEnd();
            Pub1.AddBR();

            //Button mybtn = new Button();
            var mybtn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            mybtn.Click += new EventHandler(mybtn_SaveAutoFullDtl_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddSpace(1);

            mybtn        = new LinkBtn(false, NamesOfBtn.Cancel, "取消");
            mybtn.Click += new EventHandler(mybtn_SaveAutoFullDtl_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddBR();
            //this.Pub1.AddFieldSetEnd();

            //this.Pub1.AddFieldSet("帮助:");
            Pub1.AddEasyUiPanelInfoBegin("帮助", "icon-help");
            this.Pub1.Add("在这里您需要设置一个查询语句");
            this.Pub1.AddBR("例如:SELECT XLMC AS suozaixianlu, bustype as V_BusType FROM [V_XLVsBusType] WHERE jbxx_htid='@Key'");
            this.Pub1.AddBR("这个查询语句要与从表的列对应上就可以在文本框的值发生改变时而自动填充。");
            this.Pub1.AddBR("注意:");
            this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
            this.Pub1.AddBR("2,从表列字段字名,与填充sql列字段大小写匹配。");
            //this.Pub1.AddFieldSetEnd();
            Pub1.AddEasyUiPanelInfoEnd();
        }
示例#4
0
        /// <summary>
        /// 新建文本框自动完成
        /// </summary>
        public void EditAutoFullM2M_TB()
        {
            MapExt  myme = new MapExt(this.MyPK);
            MapM2Ms m2ms = new MapM2Ms(myme.FK_MapData);

            if (m2ms.Count == 0)
            {
                this.Pub1.Clear();
                //this.Pub1.AddFieldSet("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");
                //this.Pub1.Add("该表单下没有从表,所以您不能为从表设置自动填充。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfo("设置自动填充从表", "<p>该表单下没有从表,所以您不能为从表设置自动填充。<a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a></p>");
                return;
            }

            Pub1.AddTableNormal();
            Pub1.AddTRGroupTitle("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");

            string[] strs       = myme.Tag2.Split('$');
            bool     isHaveM2M  = false;
            bool     isHaveM2MM = false;

            foreach (MapM2M m2m in m2ms)
            {
                if (m2m.HisM2MType == M2MType.M2M)
                {
                    isHaveM2M = true;
                }
                if (m2m.HisM2MType == M2MType.M2MM)
                {
                    isHaveM2MM = true;
                }

                TextBox tb = new TextBox();
                tb.ID      = "TB_" + m2m.NoOfObj;
                tb.Columns = 70;
                tb.Style.Add("width", "100%");
                tb.Rows     = 5;
                tb.TextMode = TextBoxMode.MultiLine;
                foreach (string s in strs)
                {
                    if (s == null)
                    {
                        continue;
                    }

                    if (s.Contains(m2m.NoOfObj + ":") == false)
                    {
                        continue;
                    }

                    string[] ss = s.Split(':');
                    tb.Text = ss[1];
                }

                //this.Pub1.AddFieldSet("编号:" + m2m.NoOfObj + ",名称:" + m2m.Name);
                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.Add("编号:" + m2m.NoOfObj + ",名称:" + m2m.Name);
                Pub1.Add(tb);
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                //this.Pub1.AddFieldSetEnd();
            }

            //this.Pub1.AddHR();
            Pub1.AddTableEnd();
            Pub1.AddBR();

            //Button mybtn = new Button();
            var mybtn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            mybtn.Click += new EventHandler(mybtn_SaveAutoFullM2M_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddSpace(1);

            mybtn        = new LinkBtn(false, NamesOfBtn.Cancel, "取消");
            mybtn.Click += new EventHandler(mybtn_SaveAutoFullM2M_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddBR();
            //this.Pub1.AddFieldSetEnd();

            if (isHaveM2M)
            {
                //this.Pub1.AddFieldSet("帮助:一对多");
                Pub1.AddEasyUiPanelInfoBegin("帮助:一对多", "icon-help");
                this.Pub1.Add("在主表相关数据发生变化后,一对多数据要发生变化,变化的格式为:");
                this.Pub1.AddBR("实例:SELECT No,Name FROM WF_Emp WHERE FK_Dept='@Key' ");
                this.Pub1.AddBR("相关内容的值发生改变时而自动填充checkbox。");
                this.Pub1.AddBR("注意:");
                this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
                this.Pub1.AddBR("2,必须并且仅有No,Name两个列,顺序不要颠倒。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfoEnd();
            }

            if (isHaveM2MM)
            {
                //this.Pub1.AddFieldSet("帮助:一对多多");
                Pub1.AddEasyUiPanelInfoBegin("帮助:一对多多", "icon-help");
                this.Pub1.Add("在主表相关数据发生变化后,一对多多数据要发生变化,变化的格式为:");
                this.Pub1.AddBR("实例:SELECT a.FK_Emp M1ID, a.FK_Station as M2ID, b.Name as M2Name FROM " + BP.WF.Glo.EmpStation + " a, Port_Station b WHERE  A.FK_Station=B.No and a.FK_Emp='@Key'");
                this.Pub1.AddBR("相关内容的值发生改变时而自动填充checkbox。");
                this.Pub1.AddBR("注意:");
                this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
                this.Pub1.AddBR("2,必须并且仅有3个列 M1ID,M2ID,M2Name,顺序不要颠倒。第1列的ID对应列表的ID,第2,3列对应的是列表数据源的ID与名称。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfoEnd();
            }
        }
示例#5
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            BP.WF.Node nd   = new BP.WF.Node(this.FK_MainNode);
            BP.WF.Node tond = new BP.WF.Node(this.ToNodeID);

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=3 class='GroupTitle'", "部门选择");
            this.Pub1.AddTREnd();

            Depts sts = new Depts();

            sts.RetrieveAllFromDBSource();

            int i = 0;

            foreach (Dept st in sts)
            {
                i++;

                if (i == 4)
                {
                    i = 1;
                }

                if (i == 1)
                {
                    Pub1.AddTR();
                }

                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + st.No;
                cb.Text = st.Name;
                if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                {
                    cb.Checked = true;
                }

                this.Pub1.AddTD(cb);

                if (i == 3)
                {
                    Pub1.AddTREnd();
                }
            }

            switch (i)
            {
            case 1:
                Pub1.AddTD();
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            case 2:
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            default:
                break;
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();
            Pub1.AddSpace(1);

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

            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PushMsgs msgs = new PushMsgs(this.FK_Flow);
            var      msg  = msgs.GetEntityByKey(PushMsgAttr.FK_Event, this.Event, PushMsgAttr.FK_Node, int.Parse(this.NodeID)) as PushMsg;

            if (msg == null)
            {
                msg          = new PushMsg();
                msg.FK_Event = this.Event;
                msg.FK_Node  = int.Parse(this.NodeID);
            }

            if (!string.IsNullOrWhiteSpace(this.ThePushWay))
            {
                if (this.ThePushWay != msg.PushWay.ToString())
                {
                    msg.PushDoc = string.Empty;
                    msg.Tag     = string.Empty;
                }

                msg.PushWay = int.Parse(this.ThePushWay);
            }

            this.Pub1.AddTable("class='Table' cellspacing='1' cellpadding='1' border='1' style='width:100%'");

            this.Pub1.AddTR();
            this.Pub1.AddTD("style='width:100px'", "推送设置方式:");
            var ddl = new DDL();

            ddl.BindSysEnum(PushMsgAttr.PushWay);
            ddl.ID = "DDL_" + PushMsgAttr.PushWay;
            ddl.SetSelectItem((int)msg.PushWay);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTREnd();

            switch ((PushWay)msg.PushWay)
            {
            case PushWay.ByParas:

                #region  照系统指定参数

                Pub1.AddTR();
                Pub1.AddTD("输入参数名:");
                Pub1.AddTDBegin();

                var rad = new RadioBtn();
                rad.GroupName = "Para";
                rad.ID        = "RB_0";
                rad.Text      = "系统参数";
                rad.Checked   = msg.PushDoc == "0";

                Pub1.Add(rad);

                var tb = new TB();
                tb.ID = "TB_" + PushMsgAttr.Tag;

                if (msg.PushDoc == "0")
                {
                    tb.Text = msg.Tag;
                }
                else
                {
                    tb.Text = "NoticeTo";
                }

                Pub1.Add(tb);

                Pub1.Add("&nbsp;默认为NoticeTo");
                Pub1.AddBR();

                rad           = new RadioBtn();
                rad.GroupName = "Para";
                rad.ID        = "RB_1";
                rad.Text      = "表单字段参数";
                rad.Checked   = msg.PushDoc == "1";

                Pub1.Add(rad);

                MapAttrs attrs = new MapAttrs();
                attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + this.NodeID);

                MapAttrs attrNs = new MapAttrs();

                foreach (MapAttr attr in attrs)
                {
                    if (attr.IsBigDoc)
                    {
                        continue;
                    }

                    switch (attr.KeyOfEn)
                    {
                    case "Title":
                    case "FK_Emp":
                    case "MyNum":
                    case "FK_NY":
                    case WorkAttr.Emps:
                    case WorkAttr.OID:
                    case StartWorkAttr.Rec:
                    case StartWorkAttr.FID:
                        continue;

                    default:
                        break;
                    }

                    attrNs.AddEntity(attr);
                }

                ddl    = new DDL();
                ddl.ID = "DDL_" + PushMsgAttr.Tag;
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack = false;

                if (msg.PushDoc == "1")
                {
                    ddl.SetSelectItem(msg.Tag);
                }

                Pub1.Add(ddl);
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.NodeWorker:

                #region  照指定结点的工作人员

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                Pub1.Add("请选择要推送到的节点工作人员:<br />");
                Nodes    nds = new Nodes(this.FK_Flow);
                CheckBox cb  = null;

                foreach (BP.WF.Node nd in nds)
                {
                    if (nd.NodeID == int.Parse(this.NodeID))
                    {
                        continue;
                    }

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + nd.NodeID;
                    cb.Text    = nd.NodeID + " &nbsp;" + nd.Name;
                    cb.Checked = msg.PushDoc.Contains("@" + nd.NodeID + "@");
                    Pub1.Add(cb);
                    Pub1.AddBR();
                }

                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecDepts:

                #region  照指定的部门

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                this.Pub1.AddTR();
                this.Pub1.AddTD("colspan='3' class='GroupTitle'", "部门选择");
                this.Pub1.AddTREnd();

                //NodeDepts ndepts = new NodeDepts(int.Parse(this.NodeID));
                Depts depts = new Depts();
                depts.RetrieveAll();
                int i = 0;

                //foreach (NodeDept dept in ndepts)
                foreach (Dept dept in depts)
                {
                    i++;

                    if (i == 4)
                    {
                        i = 1;
                    }

                    if (i == 1)
                    {
                        Pub1.AddTR();
                    }

                    cb = new CheckBox();
                    //cb.ID = "CB_" + dept.FK_Dept;
                    //cb.Text = (depts.GetEntityByKey(dept.FK_Dept) as Dept).Name;
                    cb.ID   = "CB_" + dept.No;
                    cb.Text = dept.Name;

                    //if (msg.PushDoc.Contains("@" + dept.FK_Dept + "@"))
                    if (msg.PushDoc.Contains("@" + dept.No + "@"))
                    {
                        cb.Checked = true;
                    }

                    this.Pub1.AddTD(cb);

                    if (i == 3)
                    {
                        Pub1.AddTREnd();
                    }
                }

                switch (i)
                {
                case 1:
                    Pub1.AddTD();
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                case 2:
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                default:
                    break;
                }

                this.Pub1.AddTableEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecEmps:

                #region  照指定的人员

                Pub1.AddTR();
                //Pub1.AddTDBegin("colspan='2'");

                Pub1.AddTD("选择人员:");
                Pub1.AddTDBegin();

                tb          = new TB();
                tb.ID       = "TB_Users";
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Style.Add("width", "99%");
                tb.Rows     = 4;
                tb.ReadOnly = true;

                var hf = new HiddenField();
                hf.ID = "HID_Users";

                //加载已经选择的人员
                if (!string.IsNullOrWhiteSpace(msg.PushDoc))
                {
                    hf.Value = msg.PushDoc.Replace("@@", ",").Trim('@');

                    var emps = new Emps();
                    emps.RetrieveAll();

                    tb.Text =
                        hf.Value.Split(',').Select(o => (emps.GetEntityByKey(o) as Emp).Name).Aggregate(
                            string.Empty, (curr, next) => curr + next + ",").TrimEnd(',');
                }

                Pub1.Add(tb);
                Pub1.Add(hf);
                Pub1.AddBR();
                Pub1.AddBR();

                Pub1.Add(
                    "<a class='easyui-linkbutton' data-options=\"iconCls:'icon-user'\" href='javascript:void(0)' onclick=\"showWin('../Comm/Port/SelectUser_Jq.aspx','" +
                    tb.ClientID + "','" + hf.ClientID + "');\">选择人员...</a>");
                Pub1.AddTDEnd();
                //Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                //depts = new Depts();
                //depts.RetrieveAll();
                //var emps = new Emps();
                //emps.RetrieveAll();
                //var empDepts = new EmpDepts();
                //empDepts.RetrieveAll();
                //var nemps = new NodeEmps(int.Parse(this.NodeID));

                //Emp emp = null;

                //foreach (Dept dept in depts)
                //{
                //    this.Pub1.AddTR();
                //    var mycb = new CheckBox();
                //    mycb.Text = dept.Name;
                //    mycb.ID = "CB_D_" + dept.No;
                //    this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                //    this.Pub1.AddTREnd();

                //    i = 0;
                //    string ctlIDs = "";

                //    foreach (EmpDept ed in empDepts)
                //    {
                //        if (ed.FK_Dept != dept.No)
                //            continue;

                //        //排除非当前结点绑定的人员
                //        if (nemps.GetEntityByKey(NodeEmpAttr.FK_Emp, ed.FK_Emp) == null)
                //            continue;

                //        i++;

                //        if (i == 4)
                //            i = 1;

                //        if (i == 1)
                //            Pub1.AddTR();

                //        emp = emps.GetEntityByKey(ed.FK_Emp) as Emp;

                //        cb = new CheckBox();
                //        cb.ID = "CB_E_" + emp.No;
                //        ctlIDs += cb.ID + ",";
                //        cb.Text = emp.Name;
                //        if (msg.PushDoc.Contains("@" + emp.No + "@"))
                //            cb.Checked = true;

                //        Pub1.AddTD(cb);

                //        if (i == 3)
                //            Pub1.AddTREnd();
                //    }

                //    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                //    switch (i)
                //    {
                //        case 1:
                //            Pub1.AddTD();
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        case 2:
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        default:
                //            break;
                //    }
                //}

                //Pub1.AddTableEnd();

                //Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecSQL:

                #region  照指定的SQL查询语句

                Pub1.AddTR();

                this.Pub1.AddTDBegin("colspan='2'");
                this.Pub1.Add("SQL查询语句:<br />");
                tb         = new TB();
                tb.ID      = "TB_" + PushMsgAttr.PushDoc;
                tb.Columns = 50;
                tb.Style.Add("width", "99%");
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Rows     = 4;
                tb.Text     = msg.PushDoc;
                this.Pub1.Add(tb);
                this.Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecStations:

                #region  照指定的岗位

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                if (BP.WF.Glo.OSModel == OSModel.WorkFlow)
                {
                    SysEnums ses = new SysEnums("StaGrade");
                    Stations sts = new Stations();
                    sts.RetrieveAll();

                    string    sql = "SELECT No,Name FROM Port_Station WHERE StaGrade  NOT IN (SELECT IntKey FROM Sys_Enum WHERE EnumKey='StaGrade')";
                    DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                    if (dt.Rows.Count != 0)
                    {
                        if (ses.Count == 0)
                        {
                            SysEnum se = new SysEnum();
                            se.EnumKey = "StaGrade";
                            se.Lab     = "普通岗";
                            se.IntKey  = 0;
                            se.Insert();

                            ses.AddEntity(se);
                        }

                        foreach (Station st in sts)
                        {
                            st.StaGrade = 0;
                            st.Save();
                        }
                    }

                    this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                    foreach (SysEnum se in ses)
                    {
                        this.Pub1.AddTR();
                        CheckBox mycb = new CheckBox();
                        mycb.Text = se.Lab;
                        mycb.ID   = "CB_SG_" + se.IntKey;
                        this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                        this.Pub1.AddTREnd();

                        i = 0;
                        string ctlIDs = "";

                        foreach (Station st in sts)
                        {
                            if (st.StaGrade != se.IntKey)
                            {
                                continue;
                            }

                            i++;

                            if (i == 4)
                            {
                                i = 1;
                            }

                            if (i == 1)
                            {
                                Pub1.AddTR();
                            }

                            cb      = new CheckBox();
                            cb.ID   = "CB_S_" + st.No;
                            ctlIDs += cb.ID + ",";
                            cb.Text = st.Name;

                            if (msg.PushDoc.Contains("@" + st.No + "@"))
                            {
                                cb.Checked = true;
                            }

                            Pub1.AddTD(cb);

                            if (i == 3)
                            {
                                Pub1.AddTREnd();
                            }
                        }

                        mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                        switch (i)
                        {
                        case 1:
                            Pub1.AddTD();
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        case 2:
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        default:
                            break;
                        }
                    }

                    this.Pub1.AddTableEnd();
                }
                else
                {
                    /*BPM 模式*/
                    BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
                    tps.RetrieveAll();

                    BP.GPM.Stations sts = new BP.GPM.Stations();
                    sts.RetrieveAll();

                    string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
                    DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                    if (dt.Rows.Count != 0)
                    {
                        if (tps.Count == 0)
                        {
                            var stp = new BP.GPM.StationType {
                                No = "01", Name = "普通岗"
                            };
                            stp.Save();

                            tps.AddEntity(stp);
                        }

                        //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                        foreach (BP.GPM.Station st in sts)
                        {
                            st.FK_StationType = tps[0].No;
                            st.Update();
                        }
                    }

                    this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                    foreach (BP.GPM.StationType tp in tps)
                    {
                        this.Pub1.AddTR();
                        CheckBox mycb = new CheckBox();
                        mycb.Text = tp.Name;
                        mycb.ID   = "CB_ST_" + tp.No;
                        this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                        this.Pub1.AddTREnd();

                        i = 0;
                        string ctlIDs = "";

                        foreach (BP.GPM.Station st in sts)
                        {
                            if (st.FK_StationType != tp.No)
                            {
                                continue;
                            }

                            i++;

                            if (i == 4)
                            {
                                i = 1;
                            }

                            if (i == 1)
                            {
                                Pub1.AddTR();
                            }

                            cb      = new CheckBox();
                            cb.ID   = "CB_S_" + st.No;
                            ctlIDs += cb.ID + ",";
                            cb.Text = st.Name;

                            if (msg.PushDoc.Contains("@" + st.No + "@"))
                            {
                                cb.Checked = true;
                            }

                            this.Pub1.AddTD(cb);

                            if (i == 3)
                            {
                                Pub1.AddTREnd();
                            }
                        }

                        mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                        switch (i)
                        {
                        case 1:
                            Pub1.AddTD();
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        case 2:
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        default:
                            break;
                        }
                    }

                    this.Pub1.AddTableEnd();
                }

                #region 原逻辑,只考虑了一种模式,停用
                //Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                //SysEnums ses = new SysEnums("StaGrade");
                //Stations sts = new Stations();
                //NodeStations nsts = new NodeStations(int.Parse(this.NodeID));
                //sts.RetrieveAll();

                //foreach (SysEnum se in ses)
                //{
                //    this.Pub1.AddTR();
                //    var mycb = new CheckBox();
                //    mycb.Text = se.Lab;
                //    mycb.ID = "CB_SG_" + se.IntKey;
                //    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                //    this.Pub1.AddTREnd();

                //    i = 0;
                //    string ctlIDs = "";

                //    foreach (Station st in sts)
                //    {
                //        if (st.StaGrade != se.IntKey)
                //            continue;

                //        //排除非当前结点的岗位
                //        if (nsts.GetEntityByKey(NodeStationAttr.FK_Station, st.No) == null)
                //            continue;

                //        i++;

                //        if (i == 4)
                //            i = 1;

                //        if (i == 1)
                //            Pub1.AddTR();

                //        cb = new CheckBox();
                //        cb.ID = "CB_S_" + st.No;
                //        ctlIDs += cb.ID + ",";
                //        cb.Text = st.Name;
                //        if (msg.PushDoc.Contains("@" + st.No + "@"))
                //            cb.Checked = true;

                //        Pub1.AddTD(cb);

                //        if (i == 3)
                //            Pub1.AddTREnd();
                //    }

                //    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                //    switch (i)
                //    {
                //        case 1:
                //            Pub1.AddTD();
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        case 2:
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        default:
                //            break;
                //    }
                //}
                //Pub1.AddTableEnd();
                #endregion

                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;
            }

            Pub1.AddTableEnd();

            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Click);
            Pub1.Add(btn);

            if (!string.IsNullOrWhiteSpace(msg.MyPK))
            {
                Pub1.AddSpace(1);
                btn        = new LinkBtn(false, NamesOfBtn.Delete, "删除");
                btn.Click += new EventHandler(btn_Delete_Click);
                btn.Attributes["onclick"] = "return confirm('你确定要删除此消息推送设置吗?');";
                Pub1.Add(btn);
            }
        }
示例#7
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            /*BPM 模式*/
            BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
            tps.RetrieveAll();

            BP.GPM.Stations sts = new BP.GPM.Stations();
            sts.RetrieveAll();

            string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
            DataTable dt  = DBAccess.RunSQLReturnTable(sql);

            if (dt.Rows.Count != 0)
            {
                if (tps.Count == 0)
                {
                    var stp = new BP.GPM.StationType {
                        No = "01", Name = "普通岗"
                    };
                    stp.Save();
                    tps.AddEntity(stp);
                }

                //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                foreach (BP.GPM.Station st in sts)
                {
                    st.FK_StationType = tps[0].No;
                    st.Update();
                }
            }

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            foreach (BP.GPM.StationType tp in tps)
            {
                this.Pub1.AddTR();
                CheckBox mycb = new CheckBox();
                mycb.Text = tp.Name;
                mycb.ID   = "CB_s_d" + tp.No;
                this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                this.Pub1.AddTREnd();

                int    i      = 0;
                string ctlIDs = "";

                foreach (BP.GPM.Station st in sts)
                {
                    if (st.FK_StationType != tp.No)
                    {
                        continue;
                    }

                    i++;

                    if (i == 4)
                    {
                        i = 1;
                    }

                    if (i == 1)
                    {
                        Pub1.AddTR();
                    }

                    CheckBox cb = new CheckBox();
                    cb.ID   = "CB_" + st.No;
                    ctlIDs += cb.ID + ",";
                    cb.Text = st.Name;
                    if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                    {
                        cb.Checked = true;
                    }

                    this.Pub1.AddTD(cb);

                    if (i == 3)
                    {
                        Pub1.AddTREnd();
                    }
                }

                mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                switch (i)
                {
                case 1:
                    Pub1.AddTD();
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                case 2:
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                default:
                    break;
                }
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();

            #region //增加“指定的操作员”选项,added by liuxc,2015-10-7
            var ddl = new DDL();
            ddl.ID    = "DDL_" + CondAttr.SpecOperWay;
            ddl.Width = 200;
            ddl.Items.Add(new ListItem("当前操作员", "0"));
            ddl.Items.Add(new ListItem("指定节点的操作员", "1"));
            ddl.Items.Add(new ListItem("指定表单字段作为操作员", "2"));
            ddl.Items.Add(new ListItem("指定操作员编号", "3"));
            ddl.SetSelectItem((int)cond.SpecOperWay);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            Pub1.Add("指定的操作员:");
            Pub1.Add(ddl);
            Pub1.AddBR();
            Pub1.AddBR();

            var lbl = new Label();
            lbl.ID = "LBL1";

            switch (cond.SpecOperWay)
            {
            case SpecOperWay.SpecNodeOper:
                lbl.Text = "节点编号:";
                break;

            case SpecOperWay.SpecSheetField:
                lbl.Text = "表单字段:";
                break;

            case SpecOperWay.SpenEmpNo:
                lbl.Text = "操作员编号:";
                break;

            case SpecOperWay.CurrOper:
                lbl.Text = "参数:";
                break;
            }

            Pub1.Add(lbl);

            var tb = new TB();
            tb.ID      = "TB_" + CondAttr.SpecOperPara;
            tb.Width   = 200;
            tb.Text    = cond.SpecOperPara;
            tb.Enabled = cond.SpecOperWay != SpecOperWay.CurrOper;
            Pub1.Add(tb);
            Pub1.AddSpace(1);
            Pub1.Add("多个值请用英文“逗号”来分隔。");
            Pub1.AddBR();
            Pub1.AddBR();
            #endregion

            Pub1.AddSpace(1);
            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapData ath = new MapData(this.FK_MapData);



            #region WebOffice控制方式.
            this.Pub1.AddTable("class='Table' cellpadding='0' cellspacing='0' border='0' style='width:100%'");

            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("colspan=3", "WebOffice控制方式.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            CheckBox cb = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableWF;
            cb.Text    = "是否启用weboffice?";
            cb.Checked = ath.IsWoEnableWF;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableSave;
            cb.Text    = "是否启用保存?";
            cb.Checked = ath.IsWoEnableSave;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableReadonly;
            cb.Text    = "是否只读?";
            cb.Checked = ath.IsWoEnableReadonly;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableRevise;
            cb.Text    = "是否启用修订?";
            cb.Checked = ath.IsWoEnableRevise;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableViewKeepMark;
            cb.Text    = "是否查看用户留痕?";
            cb.Checked = ath.IsWoEnableViewKeepMark;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnablePrint;
            cb.Text    = "是否打印?";
            cb.Checked = ath.IsWoEnablePrint;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableOver;
            cb.Text    = "是否启用套红?";
            cb.Checked = ath.IsWoEnableOver;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableSeal;
            cb.Text    = "是否启用签章?";
            cb.Checked = ath.IsWoEnableSeal;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableTemplete;
            cb.Text    = "是否启用模板文件?";
            cb.Checked = ath.IsWoEnableTemplete;
            this.Pub1.AddTD(cb);

            this.Pub1.AddTREnd();
            this.Pub1.AddTR();
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableCheck;
            cb.Text    = "是否记录节点信息?";
            cb.Checked = ath.IsWoEnableCheck;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFlow;
            cb.Text    = "是否启用插入流程?";
            cb.Checked = ath.IsWoEnableInsertFlow;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFengXian;
            cb.Text    = "是否启用插入风险点?";
            cb.Checked = ath.IsWoEnableInsertFengXian;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTR();
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableMarks;
            cb.Text    = "是否进入留痕模式?";
            cb.Checked = ath.IsWoEnableMarks;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableDown;
            cb.Text    = "是否启用下载?";
            cb.Checked = ath.IsWoEnableDown;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();
            #endregion WebOffice控制方式.

            //确定模板文件
            string moduleFile = getModuleFile(new[] { ".doc", ".docx" });

            Pub1.AddTR();
            Pub1.AddTDBegin("colspan='3'");
            this.Pub1.Add("模版文件(必须是*.doc/*.docx文件):");

            Literal lit = new Literal();
            lit.ID = "litInfo";

            if (!string.IsNullOrEmpty(moduleFile))
            {
                lit.Text = "[<span style='color:green'>已上传Word表单模板:<a href='" + moduleFile +
                           "' target='_blank' title='下载或打开模版'>" + moduleFile +
                           "</a></span>]<br /><br />";

                this.Pub1.Add(lit);
            }
            else
            {
                lit.Text = "[<span style='color:red'>还未上传Word表单模板</span>]<br /><br />";
                this.Pub1.Add(lit);
            }

            FileUpload fu = new FileUpload();
            fu.ID    = "FU";
            fu.Width = 300;
            this.Pub1.Add(fu);
            this.Pub1.AddSpace(2);
            LinkBtn btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_SaveWordFrm_Click);
            this.Pub1.Add(btn);

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
示例#9
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            if (BP.WF.Glo.OSModel == OSModel.WorkFlow)
            {
                SysEnums ses = new SysEnums("StaGrade");
                Stations sts = new Stations();
                sts.RetrieveAll();

                string    sql = "SELECT No,Name FROM Port_Station WHERE StaGrade  NOT IN (SELECT IntKey FROM Sys_Enum WHERE EnumKey='StaGrade')";
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count != 0)
                {
                    if (ses.Count == 0)
                    {
                        SysEnum se = new SysEnum();
                        se.EnumKey = "StaGrade";
                        se.Lab     = "普通岗";
                        se.IntKey  = 0;
                        se.Insert();

                        ses.AddEntity(se);
                    }

                    foreach (Station st in sts)
                    {
                        st.StaGrade = 0;
                        st.Save();
                    }

                    //Pub1.AddEasyUiPanelInfo("错误",
                    //                        "在ccflow的集成工作模式下,岗位表集成或者维护错误,有" + dt.Rows.Count +
                    //                        "个岗位枚举值对应不上:<br />{技术信息:排查的sql:" + sql + "}", "icon-no");
                    //return;
                }

                this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                foreach (SysEnum se in ses)
                {
                    this.Pub1.AddTR();
                    CheckBox mycb = new CheckBox();
                    mycb.Text = se.Lab;
                    mycb.ID   = "CB_s_d" + se.IntKey;
                    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                    this.Pub1.AddTREnd();

                    int    i      = 0;
                    string ctlIDs = "";

                    foreach (Station st in sts)
                    {
                        if (st.StaGrade != se.IntKey)
                        {
                            continue;
                        }

                        i++;

                        if (i == 4)
                        {
                            i = 1;
                        }

                        if (i == 1)
                        {
                            Pub1.AddTR();
                        }

                        CheckBox cb = new CheckBox();
                        cb.ID   = "CB_" + st.No;
                        ctlIDs += cb.ID + ",";
                        cb.Text = st.Name;
                        if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                        {
                            cb.Checked = true;
                        }

                        Pub1.AddTD(cb);

                        if (i == 3)
                        {
                            Pub1.AddTREnd();
                        }
                    }

                    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                    switch (i)
                    {
                    case 1:
                        Pub1.AddTD();
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    case 2:
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    default:
                        break;
                    }
                }
            }
            else
            {
                /*BPM 模式*/
                BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
                tps.RetrieveAll();

                BP.GPM.Stations sts = new BP.GPM.Stations();
                sts.RetrieveAll();

                string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count != 0)
                {
                    if (tps.Count == 0)
                    {
                        var stp = new BP.GPM.StationType {
                            No = "01", Name = "普通岗"
                        };
                        stp.Save();

                        tps.AddEntity(stp);
                    }

                    //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                    foreach (BP.GPM.Station st in sts)
                    {
                        st.FK_StationType = tps[0].No;
                        st.Update();
                    }

                    //Pub1.AddEasyUiPanelInfo("错误",
                    //                        "在ccflow的集成工作模式下,岗位表集成或者维护错误,有" + dt.Rows.Count +
                    //                        "个岗位外键对应不上:<br />{技术信息:排查的sql:" + sql + "}", "icon-no");
                    //return;
                }

                this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                foreach (BP.GPM.StationType tp in tps)
                {
                    this.Pub1.AddTR();
                    CheckBox mycb = new CheckBox();
                    mycb.Text = tp.Name;
                    mycb.ID   = "CB_s_d" + tp.No;
                    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                    this.Pub1.AddTREnd();

                    int    i      = 0;
                    string ctlIDs = "";

                    foreach (BP.GPM.Station st in sts)
                    {
                        if (st.FK_StationType != tp.No)
                        {
                            continue;
                        }

                        i++;

                        if (i == 4)
                        {
                            i = 1;
                        }

                        if (i == 1)
                        {
                            Pub1.AddTR();
                        }

                        CheckBox cb = new CheckBox();
                        cb.ID   = "CB_" + st.No;
                        ctlIDs += cb.ID + ",";
                        cb.Text = st.Name;
                        if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                        {
                            cb.Checked = true;
                        }

                        this.Pub1.AddTD(cb);

                        if (i == 3)
                        {
                            Pub1.AddTREnd();
                        }
                    }

                    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                    switch (i)
                    {
                    case 1:
                        Pub1.AddTD();
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    case 2:
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    default:
                        break;
                    }
                }
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();
            Pub1.AddSpace(1);

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

            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
示例#10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Step = 1

            if (this.Step == 1)
            {
                BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
                ens.RetrieveAll();


                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "第1步:请选择数据源");
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.AddUL("class='navlist'");

                Pub1.AddLi("<div><a href='SFGuide.aspx?Step=12&FK_SFDBsrc=local'><img src='../../Img/New.gif' align='middle' /><span>创建本地编码字典表</span></a></div>");

                foreach (BP.Sys.SFDBSrc item in ens)
                {
                    Pub1.AddLi("<div><a href='SFGuide.aspx?Step=2&FK_SFDBSrc=" + item.No + "'><span class='nav'>" + item.No + "  -  " + item.Name + "</span></a></div>");
                }

                Pub1.AddLi("<div><a href=\"javascript:WinOpen('../RefFunc/UIEn.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='../../Img/New.gif' align='middle' /><span class='nav'>新建数据源</span></a></div>");

                Pub1.AddULEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                Pub1.AddTableEnd();
            }
            #endregion

            #region Step = 2

            if (this.Step == 2)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);

                Pub1.Add("<div class='easyui-layout' data-options=\"fit:true\">");
                Pub1.Add(string.Format("<div data-options=\"region:'west',split:true,title:'选择 {0} 表/视图'\" style='width:200px;'>",
                                       src.No));

                var lb = new LB();
                lb.ID = "LB_Table";
                lb.BindByTableNoName(src.GetTables());
                lb.Style.Add("width", "100%");
                lb.Style.Add("height", "100%");
                lb.AutoPostBack          = true;
                lb.SelectedIndexChanged += new EventHandler(lb_SelectedIndexChanged);
                Pub1.Add(lb);

                Pub1.AddDivEnd();

                Pub1.Add("<div data-options=\"region:'center',title:'第2步:请填写基础信息'\" style='padding:5px;'>");
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");

                var dbType = src.DBSrcType;
                if (dbType == DBSrcType.Localhost)
                {
                    switch (SystemConfig.AppCenterDBType)
                    {
                    case DBType.MSSQL:
                        dbType = DBSrcType.SQLServer;
                        break;

                    case DBType.Oracle:
                        dbType = DBSrcType.Oracle;
                        break;

                    case DBType.MySQL:
                        dbType = DBSrcType.MySQL;
                        break;

                    case DBType.Informix:
                        dbType = DBSrcType.Infomax;
                        break;

                    default:
                        throw new Exception("没有涉及到的连接测试类型...");
                    }
                }

                var islocal = (src.DBSrcType == DBSrcType.Localhost).ToString().ToLower();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "值(编号):");
                var ddl = new DDL();
                ddl.ID = "DDL_ColValue";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;编号列,比如:类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("标签(名称):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColText";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;显示的列,比如:类别名称");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("父结点值(字段):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColParentNo";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;如果是树类型实体,该列设置有效,比如:上级类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("字典表类型:");

                ddl    = new DDL();
                ddl.ID = "DDL_SFTableType";
                ddl.SelfBindSysEnum(SFTableAttr.SFTableType);
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTD(ddl);
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("查询语句:");
                var tb = new TB();
                tb.ID       = "TB_SelectStatement";
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Columns  = 60;
                tb.Rows     = 10;
                tb.Style.Add("width", "99%");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("<br />&nbsp;说明:查询语句可以修改,但请保证查询语句的准确性及有效性!");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Next, "下一步");
                btn.Click += new EventHandler(btn_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");

                Pub1.AddDivEnd();
                Pub1.AddDivEnd();

                if (!IsPostBack && lb.Items.Count > 0)
                {
                    lb.SelectedIndex = 0;
                    ShowSelectedTableColumns();
                }
            }
            #endregion

            #region Step = 12

            if (this.Step == 12)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第2步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Local_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion

            #region Step = 3

            if (this.Step == 3)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第3步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion
        }
示例#11
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            BP.WF.Node nd   = new BP.WF.Node(this.FK_MainNode);
            BP.WF.Node tond = new BP.WF.Node(this.ToNodeID);

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=3 class='GroupTitle'", "部门选择");
            this.Pub1.AddTREnd();

            Depts sts = new Depts();

            sts.RetrieveAllFromDBSource();

            int i = 0;

            foreach (Dept st in sts)
            {
                i++;

                if (i == 4)
                {
                    i = 1;
                }

                if (i == 1)
                {
                    Pub1.AddTR();
                }

                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + st.No;
                cb.Text = st.Name;
                if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                {
                    cb.Checked = true;
                }

                this.Pub1.AddTD(cb);

                if (i == 3)
                {
                    Pub1.AddTREnd();
                }
            }

            switch (i)
            {
            case 1:
                Pub1.AddTD();
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            case 2:
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            default:
                break;
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();

            #region //增加“指定的操作员”选项,added by liuxc,2015-10-7
            var ddl = new DDL();
            ddl.ID    = "DDL_" + CondAttr.SpecOperWay;
            ddl.Width = 200;
            ddl.Items.Add(new ListItem("当前操作员", "0"));
            ddl.Items.Add(new ListItem("指定节点的操作员", "1"));
            ddl.Items.Add(new ListItem("指定表单字段作为操作员", "2"));
            ddl.Items.Add(new ListItem("指定操作员编号", "3"));
            ddl.SetSelectItem((int)cond.SpecOperWay);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            Pub1.Add("指定的操作员:");
            Pub1.Add(ddl);
            Pub1.AddBR();
            Pub1.AddBR();

            var lbl = new Label();
            lbl.ID = "LBL1";

            switch (cond.SpecOperWay)
            {
            case SpecOperWay.SpecNodeOper:
                lbl.Text = "节点编号:";
                break;

            case SpecOperWay.SpecSheetField:
                lbl.Text = "表单字段:";
                break;

            case SpecOperWay.SpenEmpNo:
                lbl.Text = "操作员编号:";
                break;

            case SpecOperWay.CurrOper:
                lbl.Text = "参数:";
                break;
            }

            Pub1.Add(lbl);

            var tb = new TB();
            tb.ID      = "TB_" + CondAttr.SpecOperPara;
            tb.Width   = 200;
            tb.Text    = cond.SpecOperPara;
            tb.Enabled = cond.SpecOperWay != SpecOperWay.CurrOper;
            Pub1.Add(tb);
            Pub1.AddSpace(1);
            Pub1.Add("多个值请用英文“逗号”来分隔。");
            Pub1.AddBR();
            Pub1.AddBR();
            #endregion

            Pub1.AddSpace(1);
            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
示例#12
0
    public void OutExcel(string desc)
    {
        Entities ens = BP.En.ClassFactory.GetEns(this.EnsName);
        Map      map = ens.GetNewEntity.EnMap;

        System.Collections.Generic.Dictionary <string, string> attrs =
            new System.Collections.Generic.Dictionary <string, string>();

        foreach (Attr attr in map.Attrs)
        {
            if (attr.Key.IndexOf("Text") == -1)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }
            }

            if (attr.MyFieldType == FieldType.Enum ||
                attr.MyFieldType == FieldType.PKEnum ||
                attr.MyFieldType == FieldType.PKFK ||
                attr.MyFieldType == FieldType.FK)
            {
                continue;
            }

            attrs.Add(attr.Key, attr.Desc);
        }

        //string strLine = "<table border=1 style='width:100%' >";
        //strLine += "<caption>"+desc+"</caption>";
        this.Pub1.AddTableNormal();
        this.Pub1.AddTRGroupTitle(attrs.Count, desc);
        this.Pub1.AddTR();

        //生成文件标题
        //strLine += "<TR>";
        //foreach (Attr attr in map.Attrs)
        //{
        //    if (attr.Key.IndexOf("Text") == -1)
        //    {
        //        if (attr.UIVisible == false)
        //            continue;
        //    }

        //    if (attr.MyFieldType == FieldType.Enum
        //        || attr.MyFieldType == FieldType.PKEnum
        //        || attr.MyFieldType == FieldType.PKFK
        //        || attr.MyFieldType == FieldType.FK)
        //        continue;

        //    strLine += "<th>" + attr.Desc + "</th>";
        //}
        //strLine += "</TR>";
        foreach (System.Collections.Generic.KeyValuePair <string, string> attr in attrs)
        {
            Pub1.AddTDGroupTitle(attr.Value);
        }

        Pub1.AddTREnd();

        for (int i = 0; i < 12; i++)
        {
            //strLine += "<TR>";
            //foreach (Attr attr in map.Attrs)
            //{
            //    if (attr.Key.IndexOf("Text") == -1)
            //    {
            //        if (attr.UIVisible == false)
            //            continue;
            //    }
            //    if (attr.MyFieldType == FieldType.Enum
            //        || attr.MyFieldType == FieldType.PKEnum
            //        || attr.MyFieldType == FieldType.PKFK
            //        || attr.MyFieldType == FieldType.FK)
            //        continue;
            //    strLine += "<td>&nbsp;</td>";
            //}
            //strLine += "</TR>";
            Pub1.AddTR();

            foreach (System.Collections.Generic.KeyValuePair <string, string> attr in attrs)
            {
                Pub1.AddTD("&nbsp;");
            }

            Pub1.AddTREnd();
        }

        //strLine += "</Table>";
        Pub1.AddTableEnd();


        //this.Pub1.DivInfoBlockBegin();

        //this.Pub1.Add(strLine);
        //this.Pub1.DivInfoBlockEnd();
    }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Step = 1

            if (this.Step == 1)
            {
                BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
                ens.RetrieveAll();

                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "第1步:选择下拉框数据来源类型");
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.AddUL("class='navlist'");

                this.Pub1.AddLi("<a href='/WF/MapDef/SFTable.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&FromApp=SL' ><b><img src='./Img/Table.png' border=0 style='width:17px;height:17px;' />外键型表或视图</b></a> -  比如:岗位、税种、行业、科目,本机上一个表组成一个下拉框。");
                this.Pub1.AddLi("<a href='/WF/MapDef/SFSQL.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&FromApp=SL'><b><img src='./Img/View.png' border=0  style='width:17px;height:17px;' />外部表SQL数据源</b></a> -  比如:配置一个SQL通过数据库连接或获取的外部数据,组成一个下拉框。");
                this.Pub1.AddLi("<a href='/WF/MapDef/SFWS.aspx?DoType=AddSFWebServeces&MyPK=" + this.MyPK + "&FType=Class&Idx=" + this.Idx + "&GroupField=" + this.GroupField + "&FromApp=SL'><b><img src='./Img/WS.png' border=0 />WebServices数据</b></a> -  比如:通过调用Webservices接口获得数据,组成一个下拉框。");

                //// Pub1.AddLi("<div><a href='SFGuide.aspx?Step=12&FK_SFDBsrc=local'><img src='../../Img/New.gif' align='middle' /><span>创建本地编码字典表</span></a></div>");
                // foreach (BP.Sys.SFDBSrc item in ens)
                // {
                //     Pub1.AddLi("<div><a href='SFGuide.aspx?Step=2&FK_SFDBSrc=" + item.No + "'><span class='nav'>" +item.IP+ item.No + "  -  " + item.Name + "</span></a></div>");
                // }

                // this.Pub1.AddFieldSet("新增下拉框(外键、外部表、WebServices)字段(通常只有编号名称两个列)");
                // this.Pub1.AddUL();
                // this.Pub1.AddLi("<a href='Do.aspx?DoType=AddSFTable&MyPK=" + this.MyPK + "&FType=Class&Idx=" + this.Idx + "&GroupField=" + this.GroupField + "'><b>外键型</b></a> -  比如:岗位、税种、行业、科目,本机上一个表组成一个下拉框。");
                // this.Pub1.AddLi("<a href='Do.aspx?DoType=AddSFSQL&MyPK=" + this.MyPK + "&FType=Class&Idx=" + this.Idx + "&GroupField=" + this.GroupField + "'><b>外部表</b></a> -  比如:配置一个SQL通过数据库连接或获取的外部数据,组成一个下拉框。");
                // this.Pub1.AddLi("<a href='Do.aspx?DoType=AddSFWebServeces&MyPK=" + this.MyPK + "&FType=Class&Idx=" + this.Idx + "&GroupField=" + this.GroupField + "'><b>WebServices</b></a> -  比如:通过调用Webservices接口获得数据,组成一个下拉框。");
                // this.Pub1.AddULEnd();
                // this.Pub1.AddFieldSetEnd();

                //创建.
                //Pub1.AddLi("<div><a href=\"javascript:WinOpen('../RefFunc/UIEn.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='../../Img/New.gif' align='middle' /><span class='nav'>新建数据源</span></a></div>");
                //Pub1.AddLi("<div><a href='SFGuide.aspx?Step=22'><img src='../../Img/New.gif' align='middle' /><span class='nav'>新建WebService数据源</span></a></div>");


                Pub1.AddULEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTREnd();


                Pub1.AddTableEnd();
            }
            #endregion

            #region Step = 2

            if (this.Step == 2)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);

                Pub1.Add("<div class='easyui-layout' data-options=\"fit:true\">");
                Pub1.Add(string.Format("<div data-options=\"region:'west',split:true,title:'选择 {0} 表/视图'\" style='width:200px;'>",
                                       src.No));

                var lb = new LB();
                lb.ID = "LB_Table";
                lb.BindByTableNoName(src.GetTables());
                lb.Style.Add("width", "100%");
                lb.Style.Add("height", "100%");
                lb.AutoPostBack          = true;
                lb.SelectedIndexChanged += new EventHandler(lb_SelectedIndexChanged);
                Pub1.Add(lb);

                Pub1.AddDivEnd();

                Pub1.Add("<div data-options=\"region:'center',title:'第2步:请填写基础信息'\" style='padding:5px;'>");
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");

                var dbType = src.DBSrcType;
                if (dbType == DBSrcType.Localhost)
                {
                    switch (SystemConfig.AppCenterDBType)
                    {
                    case DBType.MSSQL:
                        dbType = DBSrcType.SQLServer;
                        break;

                    case DBType.Oracle:
                        dbType = DBSrcType.Oracle;
                        break;

                    case DBType.MySQL:
                        dbType = DBSrcType.MySQL;
                        break;

                    case DBType.Informix:
                        dbType = DBSrcType.Informix;
                        break;

                    default:
                        throw new Exception("没有涉及到的连接测试类型...");
                    }
                }

                var islocal = (src.DBSrcType == DBSrcType.Localhost).ToString().ToLower();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "值(编号):");
                var ddl = new DDL();
                ddl.ID = "DDL_ColValue";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;编号列,比如:类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("标签(名称):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColText";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;显示的列,比如:类别名称");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("父结点值(字段):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColParentNo";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;如果是树类型实体,该列设置有效,比如:上级类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("字典表类型:");

                ddl    = new DDL();
                ddl.ID = "DDL_CodeStruct";
                ddl.SelfBindSysEnum(SFTableAttr.CodeStruct);
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTD(ddl);
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("查询语句:");
                var tb = new TB();
                tb.ID       = "TB_SelectStatement";
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Columns  = 60;
                tb.Rows     = 10;
                tb.Style.Add("width", "99%");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("<br />&nbsp;说明:查询语句可以修改,但请保证查询语句的准确性及有效性!");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Next, "下一步");
                btn.Click += new EventHandler(btn_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");

                Pub1.AddDivEnd();
                Pub1.AddDivEnd();

                if (!IsPostBack && lb.Items.Count > 0)
                {
                    lb.SelectedIndex = 0;
                    ShowSelectedTableColumns();
                }
            }
            #endregion

            #region Step = 12

            if (this.Step == 12)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第2步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Local_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion

            #region Step = 22

            if (this.Step == 22)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第2步:创建本地WebService数据源表");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "WebService数据源编号:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头,比如:HR,CRM");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "WebService数据源名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的数据源名称,比如:人力资源系统,客户关系管理系统.");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                tb.Style.Add("width", "300px");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "WebService连接Url:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;WebService地址,比如:http://127.0.0.1/CCFormTester.asmx");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.SrcTable;
                tb.Style.Add("width", "300px");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "WebService接口名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;比如:GetEmps");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.SelectStatement;
                tb.Style.Add("width", "300px");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "WebService接口参数:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("格式说明");
                Pub1.AddTDDoc("如:WorkId=@WorkID&FK_Flow=@FK_Flow&FK_Node=@FK_Node&SearchType=1,带@的参数值在运行时自动使用发起流程的相关参数值替换,而不带@的参数值使用后面的赋值;参数个数与WebServices接口方法的参数个数一致,且顺序一致,且值均为字符类型。");
                Pub1.AddTREnd();


                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_WebService_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }

            #endregion

            #region Step = 3

            if (this.Step == 3)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第3步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion
        }