Ejemplo n.º 1
0
        public Entities SetDGData(int pageIdx, bool isSearch)
        {
            //  this.BPToolBar1.SaveSearchState(this.EnsName, this.Key);
            this.ToolBar1.SaveSearchState(this.EnsName, this.Key);

            Entities    ens = this.HisEns;
            Entity      en  = ens.GetNewEntity;
            QueryObject qo  = new QueryObject(ens);

            qo = this.ToolBar1.GetnQueryObject(ens, en);
            string url = this.Request.RawUrl;

            if (url.IndexOf("PageIdx") != -1)
            {
                url = url.Substring(0, url.IndexOf("PageIdx") - 1);
            }

            this.UCSys2.Clear();
            int maxPageNum = 0;

            try
            {
                maxPageNum = this.UCSys2.BindPageIdx(qo.GetCount(), SystemConfig.PageSize, pageIdx, "Batch.aspx?EnsName=" + this.EnsName);
            }
            catch (Exception ex)
            {
                en.CheckPhysicsTable();
                throw ex;
            }

            if (isSearch)
            {
                return(null);
            }


            if (maxPageNum > 1)
            {
                this.UCSys2.Add("翻页键:← → PageUp PageDown");
            }

            qo.DoQuery(en.PK, SystemConfig.PageSize, pageIdx);

            this.UCSys1.DataPanelDtlCheckBox(ens);

            //if (this.IsS == false)
            //    this.UCSys3.Add("[<a href='Batch.aspx?EnsName=" + this.EnsName + "&PageIdx=" + this.PageIdx + "&IsS=1'>选择全部</a>]&nbsp;&nbsp;");
            //else
            //    this.UCSys3.Add("[<a href='Batch.aspx?EnsName=" + this.EnsName + "&PageIdx=" + this.PageIdx + "&IsS=0'>全不选</a>]&nbsp;&nbsp;");

            RefMethods rms = en.EnMap.HisRefMethods;

            foreach (RefMethod rm in rms)
            {
                if (rm.IsCanBatch == false)
                {
                    continue;
                }

                Button btn = new Button();
                btn.ID       = "Btn_" + rm.Index;
                btn.Text     = rm.Title;
                btn.CssClass = "Btn";
                if (rm.Warning == null)
                {
                    btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                }
                else
                {
                    btn.Attributes["onclick"] = " return confirm('" + rm.Warning + "');";
                }

                this.UCSys3.Add(btn);
                btn.Click += new EventHandler(btn_Click);
            }

            UAC uac = en.HisUAC;

            if (uac.IsDelete)
            {
                Button btn = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";

                btn.Text = "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Attributes["class"]   = "Button";
                this.UCSys3.Add(btn);
                btn.Click += new EventHandler(btn_Click);
            }

            MoveToShowWay showWay = (MoveToShowWay)ens.GetEnsAppCfgByKeyInt("MoveToShowWay");

            // 执行移动.
            if (showWay != MoveToShowWay.None)
            {
                string MoveTo = en.GetCfgValStr("MoveTo");
                if (en.EnMap.Attrs.Contains(MoveTo) == false)
                {
                    this.Alert("Moveto 字段设置错误,实体不包含字段:" + MoveTo);
                    return(null);
                }


                Attr attr = en.EnMap.GetAttrByKey(MoveTo);
                if (showWay == MoveToShowWay.DDL)
                {
                    Button btnM = new Button();
                    btnM.ID       = "Btn_Move";
                    btnM.CssClass = "Btn";

                    btnM.Text = "移动到";
                    btnM.Attributes["onclick"] = "return confirm('您确实要移动吗?');";
                    this.UCSys3.Add("&nbsp;&nbsp;");
                    this.UCSys3.Add(btnM);

                    btnM.Click += new EventHandler(btn_Move_Click);

                    DDL ddl = new DDL();
                    ddl.ID = "DDL_MoveTo1";
                    if (attr.IsEnum)
                    {
                        ddl.BindSysEnum(attr.Key);
                        ddl.Items.Insert(0, new ListItem("选择" + "=>" + attr.Desc, "all"));
                    }
                    else
                    {
                        EntitiesNoName ens1 = attr.HisFKEns as EntitiesNoName;
                        ens1.RetrieveAll();
                        ddl.BindEntities(ens1);
                        ddl.Items.Insert(0, new ListItem("选择" + "=>" + attr.Desc, "all"));
                    }
                    this.UCSys3.Add(ddl);
                }

                if (showWay == MoveToShowWay.Panel)
                {
                    if (attr.IsEnum)
                    {
                        SysEnums ses = new SysEnums(attr.Key);
                        foreach (SysEnum se in ses)
                        {
                            Button btn = new Button();
                            btn.CssClass = "Btn";

                            btn.ID   = "Btn_Move_" + se.IntKey;
                            btn.Text = "设置" + ":" + se.Lab;
                            btn.Attributes["onclick"] = "return confirm('您确实要执行设置[" + se.Lab + "]吗?');";
                            btn.Click += new EventHandler(btn_Move_Click);
                            this.UCSys3.Add(btn);
                            this.UCSys3.Add("&nbsp;&nbsp;");
                        }
                    }
                    else
                    {
                        EntitiesNoName ens1 = attr.HisFKEns as EntitiesNoName;
                        ens1.RetrieveAll();
                        foreach (EntityNoName en1 in ens1)
                        {
                            Button btn = new Button();
                            btn.CssClass = "Btn";
                            btn.ID       = "Btn_Move_" + en1.No;
                            btn.Text     = "设置:" + en1.Name;
                            btn.Attributes["onclick"] = "return confirm('您确实要设置[" + en1.Name + "]吗?');";
                            btn.Click += new EventHandler(btn_Move_Click);
                            this.UCSys3.Add(btn);
                            this.UCSys3.Add("&nbsp;&nbsp;");
                        }
                    }
                }
            }

            int ToPageIdx = this.PageIdx + 1;
            int PPageIdx  = this.PageIdx - 1;

            this.UCSys3.Add("<SCRIPT language=javascript>");
            this.UCSys3.Add("\t\n document.onkeydown = chang_page;");
            this.UCSys3.Add("\t\n function chang_page() {");
            //  this.UCSys3.Add("\t\n  alert(event.keyCode); ");
            if (this.PageIdx == 1)
            {
                this.UCSys3.Add("\t\n if (event.keyCode == 37 || event.keyCode == 33) alert('已经是第一页');");
            }
            else
            {
                this.UCSys3.Add("\t\n if (event.keyCode == 37  || event.keyCode == 38 || event.keyCode == 33) ");
                this.UCSys3.Add("\t\n     location='Batch.aspx?EnsName=" + this.EnsName + "&PageIdx=" + PPageIdx + "';");
            }
            if (this.PageIdx == maxPageNum)
            {
                this.UCSys3.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) alert('已经是最后一页');");
            }
            else
            {
                this.UCSys3.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) ");
                this.UCSys3.Add("\t\n     location='Batch.aspx?EnsName=" + this.EnsName + "&PageIdx=" + ToPageIdx + "';");
            }

            this.UCSys3.Add("\t\n } ");
            this.UCSys3.Add("</SCRIPT>");
            return(ens);
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapData md = new MapData(this.FK_MapData);

            this.Title = md.Name + " - 设计一对多";
            MapM2M m2m = new MapM2M(this.FK_MapData, this.NoOfObj);

            if (m2m.HisM2MType == M2MType.M2MM)
            {
                this.Response.Redirect("MapM2MM.aspx?FK_MapData=" + this.FK_MapData + "&NoOfObj=" + this.NoOfObj, true);
                return;
            }

            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("一对多属性");
            int idx = 1;

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("编号");
            TB tb = new TB();

            tb.ID   = "TB_" + MapM2MAttr.NoOfObj;
            tb.Text = m2m.NoOfObj;
            if (m2m.IsExits)
            {
                tb.Enabled = false;
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("描述");
            tb         = new TB();
            tb.ID      = "TB_" + MapM2MAttr.Name;
            tb.Text    = m2m.Name;
            tb.Columns = 50;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("主体数据源<font color=red>*</font>");
            tb          = new TB();
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 3;
            tb.ID       = "TB_" + MapM2MAttr.DBOfObjs;
            tb.Text     = m2m.DBOfObjs;
            tb.Columns  = 50;

            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("分组数据源");
            tb          = new TB();
            tb.ID       = "TB_" + MapM2MAttr.DBOfGroups;
            tb.Text     = m2m.DBOfGroups;
            tb.Columns  = 50;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 3;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架宽度");
            tb          = new TB();
            tb.ID       = "TB_" + MapM2MAttr.W;
            tb.ShowType = TBType.Num;
            tb.Text     = m2m.W.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架高度");
            tb          = new TB();
            tb.ID       = "TB_" + MapM2MAttr.H;
            tb.ShowType = TBType.Num;
            tb.Text     = m2m.H.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("记录呈现列数");
            tb          = new TB();
            tb.ID       = "TB_" + MapM2MAttr.Cols;
            tb.ShowType = TBType.Num;
            tb.Text     = m2m.Cols.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示方式");
            DDL ddl = new DDL();

            ddl.ID = "DDL_" + MapM2MAttr.ShowWay;
            ddl.BindSysEnum("FrmUrlShowWay", (int)m2m.ShowWay);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("请参考手册");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("权限");
            this.Pub1.AddTDBegin("colspan=2");

            CheckBox cb = new CheckBox();

            cb.Checked = m2m.IsDelete;
            cb.Text    = "是否可以删除?";
            cb.ID      = "CB_IsDelete";
            this.Pub1.Add(cb);

            cb         = new CheckBox();
            cb.Checked = m2m.IsDelete;
            cb.Text    = "是否可以增加?";
            cb.ID      = "CB_IsInsert";
            this.Pub1.Add(cb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            GroupFields gfs = new GroupFields(md.No);

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示在分组");
            ddl    = new DDL();
            ddl.ID = "DDL_GroupField";
            ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, AddAllLocation.None);
            ddl.SetSelectItem(m2m.GroupID);
            this.Pub1.AddTD("colspan=2", ddl);
            this.Pub1.AddTREnd();

            this.Pub1.AddTRSum();
            this.Pub1.AddTDBegin("colspan=4 align=center");

            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.CssClass = "Btn";
            btn.ID       = "Btn_SaveAndClose";
            btn.Text     = " 保存并关闭 ";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            if (m2m.IsExits)
            {
                btn          = new Button();
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Del";
                btn.Text     = "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.Add(btn);
            }

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

            this.Pub1.AddFieldSet("SQL事例");
            this.Pub1.Add("主体数据源:");
            this.Pub1.AddBR("SELECT No,Name,FK_Dept FROM Port_Emp");
            this.Pub1.AddBR();
            this.Pub1.Add("分组数据源:");
            this.Pub1.AddBR("SELECT No,Name FROM Port_Dept ");
            this.Pub1.AddFieldSetEnd();
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "从表设计";

            MapData.IsEditDtlModel = true;
            MapData md  = new MapData(this.FK_MapData);
            MapDtl  dtl = new MapDtl(this.FK_MapDtl);

            if (dtl.IsView == false)
            {
                return;
            }

            MapAttrs attrs      = new MapAttrs(this.MyPK);
            MapAttrs attrs2     = new MapAttrs();
            MapExts  mes        = new MapExts(this.MyPK);
            string   LinkFields = ",";

            if (mes.Count != 0)
            {
                foreach (MapExt me in mes)
                {
                    switch (me.ExtType)
                    {
                    case MapExtXmlList.Link:
                        LinkFields += me.AttrOfOper + ",";
                        break;

                    default:
                        break;
                    }
                }

                this.Page.RegisterClientScriptBlock("s8",
                                                    "<script language='JavaScript' src='../Scripts/jquery-1.4.1.min.js' ></script>");

                this.Page.RegisterClientScriptBlock("b8",
                                                    "<script language='JavaScript' src='../CCForm/MapExt.js' ></script>");

                this.Page.RegisterClientScriptBlock("dCd",
                                                    "<script language='JavaScript' src='/DataUser/JSLibData/" + this.FK_MapDtl + ".js' ></script>");

                this.Pub1.Add("<div id='divinfo' style='width: 155px; position: absolute; color: Lime; display: none;cursor: pointer;align:left'></div>");
            }

            string t = DateTime.Now.ToString("MM-dd-hh:mm:ss");

            if (attrs.Count == 0)
            {
                dtl.IntMapAttrs();
            }


            this.Title = md.Name + " - 设计明细";
            this.Pub1.AddTable("class='Table' border='0' ID='Tab' cellspacing='0' cellpadding='0' ");
            //     this.Pub1.AddCaptionLeftTX("<a href='MapDef.aspx?MyPK=" + md.No + "' ><img src='../Img/Btn/Back.gif' border=0/>" + this.ToE("Back","返回") + ":" + md.Name + "</a> - <img src='../Img/Btn/Table.gif' border=0/>" + dtl.Name + " - <a href=\"javascript:AddF('" + this.MyPK + "');\" ><img src='../Img/Btn/New.gif' border=0/>" + "新建字段" + "</a> ");
            this.Pub1.Add(dtl.MTR);

            #region 输出标题.
            this.Pub1.AddTR();
            if (dtl.IsShowIdx)
            {
                this.Pub1.AddTDTitle("");
            }

            foreach (MapAttr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                this.Pub1.Add("<TH style='width:" + attr.UIWidthInt + "px'>");
                this.Pub1.Add("<a href=\"javascript:Up('" + this.MyPK + "','" + attr.MyPK + "','" + t + "');\" ><img src='../Img/Btn/Left.gif' class=Arrow alt='向左移动' border=0/></a>");
                if (attr.HisEditType == EditType.UnDel || attr.HisEditType == EditType.Edit)
                {
                    switch (attr.LGType)
                    {
                    case FieldTypeS.Normal:
                        this.Pub1.Add("<a href=\"javascript:Edit('" + this.MyPK + "','" + attr.MyPK + "','" + attr.MyDataType + "');\"  alt='" + attr.KeyOfEn + "'>" + attr.Name + "</a>");
                        break;

                    case FieldTypeS.Enum:
                        this.Pub1.Add("<a href=\"javascript:EditEnum('" + this.MyPK + "','" + attr.MyPK + "');\" alt='" + attr.KeyOfEn + "' >" + attr.Name + "</a>");
                        break;

                    case FieldTypeS.FK:
                        this.Pub1.Add("<a href=\"javascript:EditTable('" + this.MyPK + "','" + attr.MyPK + "','" + attr.MyDataTypeS + "');\"  alt='" + attr.KeyOfEn + "'>" + attr.Name + "</a>");
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    this.Pub1.Add(attr.Name);
                }
                //  this.Pub1.Add("[<a href=\"javascript:Insert('" + this.MyPK + "','" + attr.Idx + "');\" ><img src='../Img/Btn/Insert.gif' border=0/>插入</a>]");
                this.Pub1.Add("<a href=\"javascript:Down('" + this.MyPK + "','" + attr.MyPK + "','" + t + "');\" ><img src='../Img/Btn/Right.gif' class=Arrow alt='向右移动' border=0/></a>");
                this.Pub1.Add("</TH>");
            }

            if (dtl.IsEnableAthM)
            {
                this.Pub1.AddTDTitle("<a href=\"javascript:Attachment('" + dtl.No + "');\"><img src='./../Img/set.gif' border=0 width='16px' /></a>");
            }

            if (dtl.IsEnableM2M)
            {
                this.Pub1.AddTDTitle("<a href=\"javascript:MapM2M('" + dtl.No + "');\"><img src='./../Img/set.gif' border=0 width='16px' /></a>");
            }

            if (dtl.IsEnableM2MM)
            {
                this.Pub1.AddTDTitle("<a href=\"javascript:window.showModalDialog('MapM2MM.aspx?NoOfObj=M2MM&FK_MapData=" + this.FK_MapDtl + "','m2m','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='./../Img/set.gif' border=0 width='16px' /></a>");
            }

            if (dtl.IsEnableLink)
            {
                this.Pub1.AddTDTitle(dtl.LinkLabel);
            }

            //Pub1.AddTDTitle("&nbsp;");

            this.Pub1.AddTREnd();
            #endregion 输出标题.

            #region 输出行.
            for (int i = 1; i <= dtl.RowsOfList; i++)
            {
                this.Pub1.AddTR();
                if (dtl.IsShowIdx)
                {
                    this.Pub1.AddTDIdx(i);
                }
                foreach (MapAttr attr in attrs)
                {
                    if (attr.UIVisible == false)
                    {
                        continue;
                    }

                    #region 是否输出超连接.
                    if (attr.UIIsEnable == false && LinkFields.Contains("," + attr.KeyOfEn + ","))
                    {
                        MapExt meLink = mes.GetEntityByKey(MapExtAttr.ExtType, MapExtXmlList.Link) as MapExt;
                        string url    = meLink.Tag;
                        if (url.Contains("?") == false)
                        {
                            url = url + "?a3=2";
                        }
                        url = url + "&WebUserNo=" + WebUser.No + "&SID=" + WebUser.SID + "&EnName=" + this.FK_MapDtl;
                        if (url.Contains("@AppPath"))
                        {
                            url = url.Replace("@AppPath", "http://" + this.Request.Url.Host + this.Request.ApplicationPath);
                        }
                        if (url.Contains("@"))
                        {
                            if (attrs2.Count == 0)
                            {
                                attrs2 = new MapAttrs(this.FK_MapDtl);
                            }
                            foreach (MapAttr item in attrs2)
                            {
                                url = url.Replace("@" + item.KeyOfEn, item.DefVal);
                                if (url.Contains("@") == false)
                                {
                                    break;
                                }
                            }
                        }
                        this.Pub1.AddTD("<a href='" + url + "' target='" + meLink.Tag1 + "' >" + attr.DefVal + "</a>");
                        continue;
                    }
                    #endregion 是否输出超连接.

                    #region 输出字段.
                    switch (attr.LGType)
                    {
                    case FieldTypeS.Normal:
                        if (attr.MyDataType == BP.DA.DataType.AppBoolean)
                        {
                            CheckBox cb = new CheckBox();
                            cb.Checked = attr.DefValOfBool;
                            cb.Enabled = attr.UIIsEnable;
                            cb.Text    = attr.Name;
                            this.Pub1.AddTD(cb);
                            break;
                        }
                        TextBox tb = new TextBox();
                        tb.ID       = "TB_" + attr.KeyOfEn + "_" + i;
                        tb.Text     = attr.DefVal;
                        tb.ReadOnly = !attr.UIIsEnable;
                        this.Pub1.AddTD(tb);
                        switch (attr.MyDataType)
                        {
                        case BP.DA.DataType.AppString:
                            tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border: none;";
                            if (attr.UIHeight > 25)
                            {
                                tb.TextMode             = TextBoxMode.MultiLine;
                                tb.Attributes["Height"] = attr.UIHeight + "px";
                                tb.Rows = attr.UIHeightInt / 25;
                            }
                            break;

                        case BP.DA.DataType.AppDateTime:
                            tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border: none;";
                            if (attr.UIIsEnable)
                            {
                                tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                                //tb.Attributes["class"] = "TBcalendar";
                            }
                            break;

                        case BP.DA.DataType.AppDate:
                            tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border: none;";
                            if (attr.UIIsEnable)
                            {
                                tb.Attributes["onfocus"] = "WdatePicker();";
                                //  tb.Attributes["class"] = "TBcalendar";
                            }
                            break;

                        default:
                            tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border: none;";
                            if (tb.ReadOnly == false)
                            {
                                // OnKeyPress="javascript:return VirtyNum(this);"
                                //tb.Attributes["OnKeyDown"] = "javascript:return VirtyNum(this);";

                                if (attr.MyDataType == DataType.AppInt)
                                {
                                    tb.Attributes["OnKeyDown"] = "javascript:return VirtyInt(this);";
                                }
                                else
                                {
                                    tb.Attributes["OnKeyDown"] = "javascript:return VirtyNum(this);";
                                }

                                tb.Attributes["onkeyup"] += "javascript:C" + i + "();C" + attr.KeyOfEn + "();";
                                tb.Attributes["class"]    = "TBNum";
                            }
                            else
                            {
                                // tb.Attributes["onpropertychange"] += "C" + attr.KeyOfEn + "();";
                                tb.Attributes["class"] = "TBNumReadonly";
                            }
                            break;
                        }
                        break;

                    case FieldTypeS.Enum:
                        DDL ddl = new DDL();
                        ddl.ID = "DDL_" + attr.KeyOfEn + "_" + i;
                        try
                        {
                            ddl.BindSysEnum(attr.KeyOfEn);
                            ddl.SetSelectItem(attr.DefVal);
                        }
                        catch (Exception ex)
                        {
                            BP.Sys.PubClass.Alert(ex.Message);
                        }
                        ddl.Enabled = attr.UIIsEnable;
                        this.Pub1.AddTDCenter(ddl);
                        break;

                    case FieldTypeS.FK:
                        DDL ddl1 = new DDL();
                        ddl1.ID = "DDL_" + attr.KeyOfEn + "_" + i;
                        try
                        {
                            EntitiesNoName ens = attr.HisEntitiesNoName;
                            ens.RetrieveAll();
                            ddl1.BindEntities(ens);
                            if (ddl1.SetSelectItem(attr.DefVal) == false)
                            {
                                ddl1.Items.Insert(0, new ListItem("请选择", attr.DefVal));
                                ddl1.SelectedIndex = 0;
                            }
                        }
                        catch
                        {
                        }
                        ddl1.Enabled = attr.UIIsEnable;
                        this.Pub1.AddTDCenter(ddl1);
                        break;

                    default:
                        break;
                    }
                    #endregion s输出字段.
                }

                #region 输出附件,m2m
                if (dtl.IsEnableAthM)
                {
                    this.Pub1.AddTD("<a href=\"javascript:EnableAthM('" + this.FK_MapDtl + "');\" ><img src='../Img/AttachmentM.png' border=0 width='16px' /></a>");
                }

                if (dtl.IsEnableM2M)
                {
                    this.Pub1.AddTD("<a href=\"javascript:window.showModalDialog('../CCForm/M2M.aspx?NoOfObj=M2M&IsTest=1&OID=0&FK_MapData=" + this.FK_MapDtl + "','m2m','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='./../Img/M2M.png' border=0 width='16px' /></a>");
                }

                if (dtl.IsEnableM2MM)
                {
                    this.Pub1.AddTD("<a href=\"javascript:window.showModalDialog('../CCForm/M2MM.aspx?NoOfObj=M2MM&IsTest=1&OID=0&FK_MapData=" + this.FK_MapDtl + "','m2m','dialogHeight: 500px; dialogWidth: 600px;center: yes; help: no')\"><img src='./../Img/M2MM.png' border=0 width='16px' /></a>");
                }

                if (dtl.IsEnableLink)
                {
                    this.Pub1.AddTD("<a href='" + dtl.LinkUrl + "' target='" + dtl.LinkTarget + "' >" + dtl.LinkLabel + "</a>");
                }
                #endregion 输出附件,m2m

                //Pub1.AddTD("&nbsp;");
                this.Pub1.AddTREnd();
            }
            #endregion 输出行.

            #region 合计.
            if (dtl.IsShowSum)
            {
                this.Pub1.AddTRSum();
                if (dtl.IsShowIdx)
                {
                    this.Pub1.AddTD("合计");
                }

                foreach (MapAttr attr in attrs)
                {
                    if (attr.UIVisible == false)
                    {
                        continue;
                    }
                    if (attr.IsNum && attr.LGType == FieldTypeS.Normal)
                    {
                        TB tb = new TB();
                        tb.ID                  = "TB_" + attr.KeyOfEn;
                        tb.Text                = attr.DefVal;
                        tb.ShowType            = attr.HisTBType;
                        tb.ReadOnly            = true;
                        tb.Font.Bold           = true;
                        tb.BackColor           = System.Drawing.Color.FromName("#FFFFFF");
                        tb.Attributes["class"] = "TBNumReadonly";
                        this.Pub1.AddTD(tb);
                    }
                    else
                    {
                        this.Pub1.AddTD();
                    }
                }
                if (dtl.IsEnableAthM)
                {
                    this.Pub1.AddTD();
                }

                if (dtl.IsEnableM2M)
                {
                    this.Pub1.AddTD();
                }

                if (dtl.IsEnableM2MM)
                {
                    this.Pub1.AddTD();
                }

                if (dtl.IsEnableLink)
                {
                    this.Pub1.AddTD();
                }

                //    Pub1.AddTD("&nbsp;");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
            #endregion 合计.

            #region 处理设计时自动填充从表.
            if (this.Key != null)
            {
                MapExt   me   = new MapExt(this.FK_MapExt);
                string[] strs = me.Tag1.Split('$');
                foreach (string str in strs)
                {
                    if (str.Contains(this.FK_MapDtl) == false)
                    {
                        continue;
                    }

                    string[] ss = str.Split(':');

                    string sql = ss[1];
                    sql = sql.Replace("@Key", this.Key);
                    sql = sql.Replace("@key", this.Key);
                    sql = sql.Replace("@val", this.Key);
                    sql = sql.Replace("@Val", this.Key);

                    DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                    int       idx = 0;
                    foreach (DataRow dr in dt.Rows)
                    {
                        idx++;
                        foreach (DataColumn dc in dt.Columns)
                        {
                            string val = dr[dc.ColumnName].ToString();
                            try
                            {
                                this.Pub1.GetTextBoxByID("TB_" + dc.ColumnName + "_" + idx).Text = val;
                            }
                            catch
                            {
                            }

                            try
                            {
                                this.Pub1.GetDDLByID("DDL_" + dc.ColumnName + "_" + idx).SetSelectItem(val);
                            }
                            catch
                            {
                            }
                        }
                    }
                }
            }
            #endregion 处理设计时自动填充从表.

            #region 处理拓展属性.
            for (int i = 1; i <= dtl.RowsOfList; i++)
            {
                foreach (MapExt me in mes)
                {
                    switch (me.ExtType)
                    {
                    case MapExtXmlList.DDLFullCtrl:     // 自动填充.
                        DDL ddlOper = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper);
                        if (ddlOper == null)
                        {
                            continue;
                        }
                        ddlOper.Attributes["onchange"] = "DDLFullCtrl(this.value,\'" + ddlOper.ClientID + "\', \'" + me.MyPK + "\')";
                        break;

                    case MapExtXmlList.ActiveDDL:
                        DDL ddlPerant = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                        if (ddlPerant == null)
                        {
                            me.Delete();
                            continue;
                        }

                        DDL ddlChild = this.Pub1.GetDDLByID("DDL_" + me.AttrsOfActive + "_" + i);
                        if (ddlChild == null)
                        {
                            me.Delete();
                            continue;
                        }

                        ddlPerant.Attributes["onchange"] = "DDLAnsc(this.value,\'" + ddlChild.ClientID + "\', \'" + me.MyPK + "\')";
                        if (ddlPerant.Items.Count == 0)
                        {
                            continue;
                        }

                        string val = ddlPerant.SelectedItemStringVal;

                        string valC1 = ddlChild.SelectedItemStringVal;


                        DataTable dt = DBAccess.RunSQLReturnTable(me.Doc.Replace("@Key", val));

                        ddlChild.Items.Clear();
                        foreach (DataRow dr in dt.Rows)
                        {
                            ddlChild.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
                        }
                        ddlChild.SetSelectItem(valC1);
                        break;

                    case MapExtXmlList.AutoFullDLL:     //自动填充下拉框的范围.
                        DDL ddlFull = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                        if (ddlFull == null)
                        {
                            me.Delete();
                            continue;
                        }

                        string valOld = ddlFull.SelectedItemStringVal;
                        ddlFull.Items.Clear();
                        string fullSQL = me.Doc.Replace("@WebUser.No", WebUser.No);
                        fullSQL = fullSQL.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                        fullSQL = fullSQL.Replace("@WebUser.Name", WebUser.Name);

                        if (fullSQL.Contains("@"))
                        {
                            //Attrs attrsFull = mydtl.EnMap.Attrs;
                            //foreach (Attr attr in attrsFull)
                            //{
                            //    if (fullSQL.Contains("@") == false)
                            //        break;
                            //    fullSQL = fullSQL.Replace("@" + attr.Key, mydtl.GetValStrByKey(attr.Key));
                            //}
                        }
                        ddlFull.Bind(DBAccess.RunSQLReturnTable(fullSQL), "No", "Name");
                        ddlFull.SetSelectItem(valOld);
                        break;

                    case MapExtXmlList.TBFullCtrl:     // 自动填充.
                        TextBox tbAuto = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                        if (tbAuto == null)
                        {
                            me.Delete();
                            continue;
                        }
                        tbAuto.Attributes["onkeyup"]      = "DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                        tbAuto.Attributes["AUTOCOMPLETE"] = "OFF";
                        if (me.Tag != "")
                        {
                            /* 处理下拉框的选择范围的问题 */
                            string[] strs = me.Tag.Split('$');
                            foreach (string str in strs)
                            {
                                string[] myCtl = str.Split(':');
                                string   ctlID = myCtl[0];
                                DDL      ddlC  = this.Pub1.GetDDLByID("DDL_" + ctlID + "_" + i);
                                if (ddlC == null)
                                {
                                    continue;
                                }

                                string sql = myCtl[1].Replace("~", "'");
                                sql = sql.Replace("@WebUser.No", WebUser.No);
                                sql = sql.Replace("@WebUser.Name", WebUser.Name);
                                sql = sql.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                                sql = sql.Replace("@Key", tbAuto.Text.Trim());
                                dt  = DBAccess.RunSQLReturnTable(sql);
                                string valC = ddlC.SelectedItemStringVal;
                                ddlC.Items.Clear();
                                foreach (DataRow dr in dt.Rows)
                                {
                                    ddlC.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
                                }
                                ddlC.SetSelectItem(valC);
                            }
                        }
                        // tbAuto.Attributes["onkeyup"] = "DoAnscToFillDiv(this,this.value);";
                        // tbAuto.Attributes["onkeyup"] = "DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                        break;

                    case MapExtXmlList.InputCheck:
                        TextBox tbCheck = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                        if (tbCheck != null)
                        {
                            tbCheck.Attributes[me.Tag2] += " rowPK=" + i + ";" + me.Tag1 + "(this);";
                        }
                        else
                        {
                            me.Delete();
                        }
                        break;

                    case MapExtXmlList.PopVal:     //弹出窗.
                        TextBox tb = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                        if (tb == null)
                        {
                            continue;
                        }
                        //tb.Attributes["ondblclick"] = "return ReturnValCCFormPopVal(this,'" + me.MyPK + "','33');";
                        tb.Attributes["ondblclick"] = "ReturnValCCFormPopVal(this,'" + me.MyPK + "','33');";
                        //    throw new Exception("ssssrrrss");
                        break;

                    default:
                        break;
                    }
                }
            }
            #endregion 处理拓展属性.

            #region 输出自动计算公式
            this.Pub1.Add("\n <script language='JavaScript'>");
            MapExts exts = new MapExts(dtl.No);
            foreach (MapExt ext in exts)
            {
                if (ext.ExtType != MapExtXmlList.AutoFull)
                {
                    continue;
                }

                for (int i = 1; i <= dtl.RowsOfList; i++)
                {
                    string top    = "\n function C" + i + "() { \n ";
                    string script = "";
                    foreach (MapAttr attr in attrs)
                    {
                        if (attr.UIVisible == false)
                        {
                            continue;
                        }
                        if (attr.IsNum == false)
                        {
                            continue;
                        }

                        if (attr.LGType != FieldTypeS.Normal)
                        {
                            continue;
                        }

                        if (ext.Tag == "1" && ext.Doc != "")
                        {
                            script += this.GenerAutoFull(i.ToString(), attrs, ext);
                        }
                    }
                    string end = " \n  } ";
                    this.Pub1.Add(top + script + end);
                }
            }
            this.Pub1.Add("\n</script>");

            // 输出合计算计公式
            foreach (MapAttr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                if (attr.LGType != FieldTypeS.Normal)
                {
                    continue;
                }

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

                if (attr.MyDataType == DataType.AppBoolean)
                {
                    continue;
                }

                string top = "\n<script language='JavaScript'> function C" + attr.KeyOfEn + "() { \n ";
                string end = "\n } </script>";
                this.Pub1.Add(top + this.GenerSum(attr, dtl) + " ; \t\n" + end);
            }
            #endregion 输出自动计算公式
        }
Ejemplo n.º 4
0
        public void Bind()
        {
            #region 生成标题
            Entity en    = this.HisEn;
            Map    map   = this.HisEn.EnMap;
            Attrs  attrs = map.Attrs;
            bool   isFJ  = false;
            if (attrs.Contains("MyFileName"))
            {
                isFJ = true;
            }

            this.ucsys1.AddTable();
            this.ucsys1.AddTR();
            this.ucsys1.AddTDTitle();

            string str1 = "<INPUT id='checkedAll' onclick='SelectAll(this);' type='checkbox' name='checkedAll'>";
            this.ucsys1.AddTDTitle(str1);
            foreach (Attr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                this.ucsys1.AddTDTitle(attr.Desc);
            }
            if (isFJ)
            {
                this.ucsys1.AddTDTitle();
            }

            this.ucsys1.AddTREnd();
            #endregion 生成标题

            this.Page.Title = en.EnDesc;

            Entities    dtls = this.HisEns;
            QueryObject qo   = new QueryObject(dtls);
            qo.AddWhere(this.RefKey, this.RefVal);

            #region 生成翻页
            this.ucsys2.Clear();
            try
            {
                this.ucsys2.BindPageIdx(qo.GetCount(), BP.SystemConfig.PageSize, this.PageIdx, "Dtl.aspx?EnName=" + this.EnName + "&PK=" + this.RefVal + "&EnsName=" + this.EnsName + "&RefVal=" + this.RefVal + "&RefKey=" + this.RefKey + "&MainEnsName=" + this.MainEnsName);
                qo.DoQuery(en.PK, this.PageSize, this.PageIdx, false);
            }
            catch
            {
                dtls.GetNewEntity.CheckPhysicsTable();
                //   this.Response.Redirect("Ens.aspx?EnsName=" + this.EnsName + "&RefPKVal=" + this.RefPKVal, true);
                return;
            }
            #endregion 生成翻页
            UAC uac = en.HisUAC;
            if (uac.IsDelete == false)
            {
                this.ToolBar1.GetBtnByID(NamesOfBtn.Delete).Enabled = false;
            }

            if (uac.IsInsert)
            {
                en.PKVal = "0";
                dtls.AddEntity(en);
            }

            DDL      ddl = new DDL();
            CheckBox cb  = new CheckBox();
            bool     is1 = false;

            #region 生成数据
            int i = 0;
            foreach (Entity dtl in dtls)
            {
                i++;
                if (dtl.PKVal == "0" || dtl.PKVal == "")
                {
                    this.ucsys1.AddTRSum();
                    this.ucsys1.AddTD("colspan=2", "<b>*</B>");
                }
                else
                {
                    //  is1 = this.ucsys1.AddTR(is1, "ondblclick=\"WinOpen( 'UIEn.aspx?EnsName=" + this.EnsName + "&PK=" + dtl.PKVal + "', 'cd' )\"");
                    is1 = this.ucsys1.AddTR(is1);

                    //  is1 = this.ucsys1.AddTR(is1);
                    this.ucsys1.AddTDIdx(i);
                    cb    = new CheckBox();
                    cb.ID = "CB_" + dtl.PKVal;
                    this.ucsys1.AddTD(cb);
                }

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

                    if (attr.Key == "OID")
                    {
                        continue;
                    }

                    string val = dtl.GetValByKey(attr.Key).ToString();
                    switch (attr.UIContralType)
                    {
                    case UIContralType.TB:
                        TB tb = new TB();
                        this.ucsys1.AddTD(tb);
                        tb.LoadMapAttr(attr);
                        tb.ID = "TB_" + attr.Key + "_" + dtl.PKVal;
                        tb.Attributes["style"] = "width:" + attr.UIWidth + "px;border-width:0px;";
                        switch (attr.MyDataType)
                        {
                        case DataType.AppMoney:
                        case DataType.AppRate:
                            tb.TextExtMoney = decimal.Parse(val);
                            break;

                        case DataType.AppDate:
                            tb.Text     = val.ToString();
                            tb.ShowType = TBType.Date;
                            if (attr.UIIsReadonly == false)
                            {
                                tb.Attributes["onfocus"] = "WdatePicker();";
                            }
                            break;

                        case DataType.AppDateTime:
                            tb.Text     = val.ToString();
                            tb.ShowType = TBType.DateTime;
                            if (attr.UIIsReadonly == false)
                            {
                                tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                            }
                            break;

                        default:
                            tb.Text = val;
                            break;
                        }

                        if (attr.IsNum && attr.IsFKorEnum == false)
                        {
                            if (tb.Enabled)
                            {
                                // OnKeyPress="javascript:return VirtyNum(this);"
                                //  tb.Attributes["OnKeyDown"] = "javascript:return VirtyNum(this);";
                                // tb.Attributes["onkeyup"] += "javascript:C" + dtl.PKVal + "();C" + attr.Key + "();";
                                tb.Attributes["class"] = "TBNum";
                            }
                            else
                            {
                                //   tb.Attributes["onpropertychange"] += "C" + attr.Key + "();";
                                tb.Attributes["class"] = "TBNumReadonly";
                            }
                        }
                        break;

                    case UIContralType.DDL:
                        ddl    = new DDL();
                        ddl.ID = "DDL_" + attr.Key + "_" + dtl.PKVal;
                        if (attr.UIIsReadonly == false)
                        {
                            ddl.Items.Add(new ListItem(dtl.GetValRefTextByKey(attr.Key), val));
                            ddl.Enabled = false;
                        }
                        else
                        {
                            if (attr.IsEnum)
                            {
                                ddl.BindSysEnum(attr.UIBindKey);
                            }
                            else
                            {
                                ddl.BindEntities(attr.HisFKEns, attr.UIRefKeyValue, attr.UIRefKeyText);
                            }
                        }
                        this.ucsys1.AddTD(ddl);
                        ddl.SetSelectItem(val);
                        break;

                    case UIContralType.CheckBok:
                        cb      = new CheckBox();
                        cb.ID   = "CB_" + attr.Key + "_" + dtl.PKVal;
                        cb.Text = attr.Desc;
                        if (val == "1")
                        {
                            cb.Checked = true;
                        }
                        else
                        {
                            cb.Checked = false;
                        }
                        this.ucsys1.AddTD("nowarp=true", cb);
                        break;

                    default:
                        break;
                    }
                }

                if (isFJ)
                {
                    string ext = dtl.GetValStrByKey("MyFileExt");
                    if (ext != "")
                    {
                        this.ucsys1.AddTD("<img src='../Images/FileType/" + ext + ".gif' border=0/>" + dtl.GetValStrByKey("MyFileName"));
                    }
                }
                this.ucsys1.AddTREnd();
            }
            #region 生成合计
            //this.ucsys1.AddTRSum();
            //this.ucsys1.AddTD("colspan=2", "合计");
            //foreach (Attr attr in attrs)
            //{
            //    if (attr.UIVisible == false)
            //        continue;
            //    if (attr.IsNum && attr.IsFKorEnum == false)
            //    {
            //        TB tb = new TB();
            //        tb.ID = "TB_" + attr.Key;
            //        tb.Text = attr.DefaultVal.ToString();
            //        tb.ShowType = attr.HisTBType;
            //        tb.ReadOnly = true;
            //        tb.Font.Bold = true;
            //        tb.BackColor = System.Drawing.Color.FromName("infobackground");

            //        switch (attr.MyDataType)
            //        {
            //            case DataType.AppRate:
            //            case DataType.AppMoney:
            //                tb.TextExtMoney = dtls.GetSumDecimalByKey(attr.Key);
            //                break;
            //            case DataType.AppInt:
            //                tb.TextExtInt = dtls.GetSumIntByKey(attr.Key);
            //                break;
            //            case DataType.AppFloat:
            //                tb.TextExtFloat = dtls.GetSumFloatByKey(attr.Key);
            //                break;
            //            default:
            //                break;
            //        }
            //        this.ucsys1.AddTD(tb);
            //    }
            //    else
            //    {
            //        this.ucsys1.AddTD();
            //    }
            //}
            //this.ucsys1.AddTD();
            //this.ucsys1.AddTREnd();
            #endregion 生成合计

            #endregion 生成数据
            this.ucsys1.AddTableEnd();
        }
Ejemplo n.º 5
0
        public void BindList()
        {
            string text = "";

            BP.WF.Node nd  = new BP.WF.Node(this.FK_Node);
            FrmNodes   fns = new FrmNodes(this.FK_Flow, this.FK_Node);

            #region 如果没有ndFrm 就增加上.
            bool isHaveNDFrm = false;
            foreach (FrmNode fn in fns)
            {
                if (fn.FK_Frm == "ND" + this.FK_Node)
                {
                    isHaveNDFrm = true;
                    break;
                }
            }
            if (isHaveNDFrm == false)
            {
                FrmNode fn = new FrmNode();
                fn.FK_Flow = this.FK_Flow;
                fn.FK_Frm  = "ND" + this.FK_Node;
                fn.FK_Node = this.FK_Node;

                fn.FrmEnableRole = FrmEnableRole.Disable; //就是默认不启用.
                fn.FrmSln        = 0;
                //  fn.IsEdit = true;
                fn.IsEnableLoadData = true;
                fn.Insert();
                fns.AddEntity(fn);
            }
            #endregion 如果没有ndFrm 就增加上.

            string tfModel = SystemConfig.AppSettings["TreeFrmModel"];
            this.Pub1.AddTable("width=100%");
            this.Pub1.AddCaption("设置节点:(" + nd.Name + ")绑定表单");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            if (tfModel == "1")
            {
                this.Pub1.AddTDTitle("关键字段");
            }

            this.Pub1.AddTDTitle("启用规则");
            // this.Pub1.AddTDTitle("可编辑否?");
            this.Pub1.AddTDTitle("可打印否?");
            this.Pub1.AddTDTitle("是否启用<br>装载填充事件");
            this.Pub1.AddTDTitle("权限控制<br>方案");
            this.Pub1.AddTDTitle("表单元素<br>自定义设置");
            this.Pub1.AddTDTitle("谁是主键?");
            this.Pub1.AddTDTitle("文件模版");

            if (nd.HisRunModel == RunModel.FL || nd.HisRunModel == RunModel.FHL)
            {
                this.Pub1.AddTDTitle("是否1变N"); //add by zhoupeng 2016.03.25 for hainan.
            }
            if (nd.HisRunModel == RunModel.SubThread)
            {
                this.Pub1.AddTDTitle("数据汇总"); //add by zhoupeng 2016.03.25 for hainan.
            }
            this.Pub1.AddTDTitle("顺序");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTDTitle("");
            this.Pub1.AddTREnd();

            int idx = 1;
            foreach (FrmNode fn in fns)
            {
                MapData md = new MapData();
                md.No = fn.FK_Frm;
                if (md.RetrieveFromDBSources() == 0)
                {
                    fn.Delete();  //说明该表单不存在了,就需要把这个删除掉.
                    continue;
                }

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD(fn.FK_Frm);

                if (fn.FK_Frm == "ND" + this.FK_Node)
                {
                    this.Pub1.AddTDB("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>");
                }
                else
                {
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>");
                }

                DDL ddl = new DDL();
                //获取当前独立表单中的所有字段  add by 海南  zqp
                if (tfModel == "1")
                {
                    //获取它的字段集合
                    MapAttrs attrs = new MapAttrs();
                    attrs.Retrieve(MapAttrAttr.FK_MapData, md.No);

                    MapAttrs attrNs = new MapAttrs();
                    //去掉一些基础字段
                    foreach (MapAttr attr in attrs)
                    {
                        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 myddl = new DDL();
                    myddl.ID = "DDL_Attr_" + md.No;
                    myddl.BindEntities(attrNs, MapAttrAttr.KeyOfEn, MapAttrAttr.Name);
                    myddl.SetSelectItem(fn.GuanJianZiDuan);
                    this.Pub1.AddTD(myddl);
                }

                //为了扩充的需要,把下拉框的模式去掉了.
                //ddl = new DDL();
                //ddl.ID = "DDL_FrmEnableRole_" + md.No;
                //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.Items.Add(new ListItem("按SQL表达式", "4"));
                //ddl.SetSelectItem(fn.FrmEnableRoleInt); //设置权限控制方案.
                //this.Pub1.AddTD(ddl);

                this.Pub1.AddTD("<a href=\"javascript:WinOpen('./FlowFrm/FrmEnableRole.aspx?FK_Node=" + fn.FK_Node + "&FK_MapData=" + fn.FK_Frm + "')\">设置(" + fn.FrmEnableRoleText + ")</a>");

                CheckBox cb = new CheckBox();
                //cb.ID = "CB_IsEdit_" + md.No;
                //cb.Text = "可编辑否?";
                //cb.Checked = fn.IsEdit;
                //this.Pub1.AddTD(cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsPrint_" + md.No;
                cb.Text    = "打印否?";
                cb.Checked = fn.IsPrint;
                this.Pub1.AddTD(cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsEnableLoadData_" + md.No;
                cb.Text    = "启用否?";
                cb.Checked = fn.IsEnableLoadData;
                this.Pub1.AddTD(cb);

                ddl    = new DDL();
                ddl.ID = "DDL_Sln_" + md.No;
                ddl.Items.Add(new ListItem("默认方案", "0"));
                ddl.Items.Add(new ListItem("自定义", this.FK_Node.ToString()));
                ddl.Items.Add(new ListItem("不可编辑", "1")); //让其不可编辑.

                ddl.SetSelectItem(fn.FrmSln);             //设置权限控制方案.
                this.Pub1.AddTD(ddl);

                this.Pub1.AddTDBegin();
                this.Pub1.Add("<a href=\"javascript:WinField('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >字段</a>");
                this.Pub1.Add("-<a href=\"javascript:WinFJ('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >附件</a>");
                this.Pub1.Add("-<a href=\"javascript:WinDtl('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >从表</a>");

                if (md.HisFrmType == FrmType.ExcelFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarExcel('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarExcel</a>");
                }

                if (md.HisFrmType == FrmType.WordFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarWord('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarWord</a>");
                }

                this.Pub1.AddTDEnd();

                ddl    = new DDL();
                ddl.ID = "DDL_WhoIsPK_" + md.No;
                ddl.BindSysEnum("WhoIsPK");
                ddl.SetSelectItem((int)fn.WhoIsPK); //谁是主键?.
                this.Pub1.AddTD(ddl);

                if (md.HisFrmType == FrmType.ExcelFrm || md.HisFrmType == FrmType.WordFrm)
                {
                    ddl    = new DDL();
                    ddl.ID = "DDL_File_" + md.No;
                    string[] files = System.IO.Directory.GetFiles(BP.Sys.SystemConfig.PathOfDataUser + "\\FrmOfficeTemplate\\", md.No + "*.xls");
                    foreach (string str in files)
                    {
                        //System.IO.FileInfo info=new System.IO.FileInfo(
                        ddl.Items.Add(new ListItem(str.Substring(str.LastIndexOf(md.No)), str));
                    }
                    this.Pub1.AddTD(ddl);
                }
                else
                {
                    this.Pub1.AddTD("无效");
                }

                if (nd.HisRunModel == RunModel.FL || nd.HisRunModel == RunModel.FHL)
                {
                    cb         = new CheckBox();
                    cb.ID      = "CB_Is1ToN_" + md.No;
                    cb.Text    = "是否1变N?";
                    cb.Checked = fn.Is1ToN;
                    this.Pub1.AddTD(cb);//add by zhoupeng 2016.03.25 for hainan.
                }

                if (nd.HisRunModel == RunModel.SubThread)
                {
                    ddl    = new DDL();
                    ddl.ID = "DDL_HuiZong_" + md.No;
                    ddl.Items.Add(new ListItem("不汇总数据", "0"));

                    BP.WF.Template.FrmNodes myfns = new FrmNodes();
                    myfns.Retrieve(FrmNodeAttr.FK_Flow, nd.FK_Flow);

                    //组合这个字符串.
                    string strs = ";" + fn.FK_Frm + ";";
                    foreach (BP.WF.Template.FrmNode myfrn in myfns)
                    {
                        if (strs.Contains(";" + myfrn.FK_Frm + ";") == true)
                        {
                            continue;
                        }

                        strs += ";" + myfrn.FK_Frm + ";";

                        //检查该frm 是否有dtl.
                        MapDtls dtls = new MapDtls(myfrn.FK_Frm);
                        if (dtls.Count == 0)
                        {
                            continue;
                        }

                        foreach (MapDtl dtl in dtls)
                        {
                            ddl.Items.Add(new ListItem("汇总到:" + myfrn.HisFrm.Name + "-" + dtl.Name, myfrn.HisFrm.No + "@" + dtl.No));
                        }
                    }
                    ddl.SetSelectItem(fn.HuiZong); //设置汇总..
                    this.Pub1.AddTD(ddl);
                }

                TextBox tb = new TextBox();
                tb.ID      = "TB_Idx_" + md.No;
                tb.Text    = fn.Idx.ToString();
                tb.Columns = 5;
                this.Pub1.AddTD(tb);

                this.Pub1.AddTDA("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Up", "上移");
                this.Pub1.AddTDA("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Down", "下移");

                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();

            text = "<input type=button onclick=\"javascript:BindFrms('" + this.FK_Node + "','" + this.FK_Flow + "');\" value='修改表单绑定'  class=Btn />";
            this.Pub1.Add(text);

            Button btn = new Button();
            btn.ID       = "Save";
            btn.Text     = "保存";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);
            this.Pub1.Add(btn);

            text = "<input type=button onclick=\"javascript:window.close();\" value='关闭'  class=Btn />";
            this.Pub1.Add(text);
        }
Ejemplo n.º 6
0
        public void BindEdit(MapData md, MapFrame dtl)
        {
            this.Pub1.AddTable();
            //  this.Pub1.AddCaptionLeftTX("<a href='MapDef.aspx?MyPK=" + md.No + "'>" + "返回" + ":" + md.Name + "</a> -  " + this.ToE("DtlTable", "从表") + ":(" + dtl.Name + ")");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("ID");
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("备注");
            this.Pub1.AddTREnd();

            int idx = 1;

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("编号");
            TB tb = new TB();

            tb.ID   = "TB_" + MapFrameAttr.NoOfObj;
            tb.Text = dtl.NoOfObj;
            if (this.DoType == "Edit")
            {
                tb.Enabled = false;
            }
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("描述");
            tb         = new TB();
            tb.ID      = "TB_Name";
            tb.Text    = dtl.Name;
            tb.Columns = 50;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架连接");
            tb         = new TB();
            tb.ID      = "TB_URL";
            tb.Text    = dtl.URL;
            tb.Columns = 50;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架宽度");
            tb          = new TB();
            tb.ID       = "TB_W";
            tb.Text     = dtl.W;
            tb.ShowType = TBType.TB;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("框架高度");
            tb          = new TB();
            tb.ID       = "TB_H";
            tb.ShowType = TBType.TB;
            tb.Text     = dtl.H;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTDBegin("colspan=3");

            RadioBtn rb = new RadioBtn();

            rb.Text      = "指定框架宽度高度";
            rb.ID        = "RB_IsAutoSize_0";
            rb.GroupName = "s";
            if (dtl.IsAutoSize)
            {
                rb.Checked = false;
            }
            else
            {
                rb.Checked = true;
            }

            this.Pub1.Add(rb);


            rb           = new RadioBtn();
            rb.Text      = "让框架自适应大小";
            rb.ID        = "RB_IsAutoSize_1";
            rb.GroupName = "s";

            if (dtl.IsAutoSize)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            this.Pub1.Add(rb);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            GroupFields gfs = new GroupFields(md.No);

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示在分组");
            DDL ddl = new DDL();

            ddl.ID = "DDL_GroupField";
            ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, AddAllLocation.None);
            ddl.SetSelectItem(dtl.GroupID);
            this.Pub1.AddTD("colspan=2", ddl);
            this.Pub1.AddTREnd();


            this.Pub1.AddTRSum();
            this.Pub1.AddTDBegin("colspan=4 align=center");

            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndClose";
            btn.CssClass = "Btn";
            btn.Text     = " 保存并关闭 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            if (this.FK_MapFrame != null)
            {
                btn          = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";
                btn.Text     = "删除"; // "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.Add(btn);

                btn          = new Button();
                btn.ID       = "Btn_New";
                btn.CssClass = "Btn";
                btn.Text     = "新建"; // "删除";
                btn.Click   += new EventHandler(btn_New_Click);
                this.Pub1.Add(btn);
            }

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Request.QueryString["FK_Node"] == null)
            {
                // 如果没有接收到节点ID参数,就绑定当前人员可以执行批量审核的待办工作.
                int num = this.BindNodeList();
                return;
            }

            BP.WF.Node nd  = new BP.WF.Node(this.FK_Node);
            Flow       fl  = nd.HisFlow;
            string     sql = "";

            if (nd.HisRunModel == RunModel.SubThread)
            {
                sql = "SELECT a.*, b.Starter,b.ADT,b.WorkID FROM " + fl.PTable
                      + " a , WF_EmpWorks b WHERE a.OID=B.FID AND b.WFState Not IN (7) AND b.FK_Node=" + nd.NodeID
                      + " AND b.FK_Emp='" + WebUser.No + "'";
            }
            else
            {
                sql = "SELECT a.*, b.Starter,b.ADT,b.WorkID FROM " + fl.PTable
                      + " a , WF_EmpWorks b WHERE a.OID=B.WorkID AND b.WFState Not IN (7) AND b.FK_Node=" + nd.NodeID
                      + " AND b.FK_Emp='" + WebUser.No + "'";
            }


            // string sql = "SELECT Title,RDT,ADT,SDT,FID,WorkID,Starter FROM WF_EmpWorks WHERE FK_Emp='" + WebUser.No + "'";
            DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql);

            if (nd.HisBatchRole == BatchRole.None)
            {
                this.Pub1.AddFieldSetRed("错误", "节点(" + nd.Name + ")不能执行批量处理操作.");
                return;
            }

            string inSQL = "SELECT WorkID FROM WF_EmpWorks WHERE FK_Emp='" + WebUser.No + "' AND WFState!=7 AND FK_Node=" + this.FK_Node;
            Works  wks   = nd.HisWorks;

            wks.RetrieveInSQL(inSQL);

            BtnLab btnLab = new BtnLab(this.FK_Node);

            this.Pub1.AddTable("width='100%'");

            //移动按钮位置
            if (nd.HisBatchRole == BatchRole.Group)
            {
                this.Pub1.AddCaptionMsgLong("<a href='Batch.aspx'>返回</a>&nbsp;&nbsp;<input  ID=\"btnGroup\" type=\"button\" value=\"合卷批复\" CssClass=\"Btn\" onclick=\"BatchGroup()\" />");
            }
            else
            {
                this.Pub1.AddCaptionMsgLong(nd.FlowName + " - <a href='Batch.aspx'>返回</a>");
            }

            #region 生成标题.
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序号");
            string str1 = "<INPUT id='checkedAll' onclick='SelectAll()'  text='选择' value='选择' type='checkbox' name='checkedAll'>";
            this.Pub1.AddTDTitle("align='left'", str1 + "选择");
            this.Pub1.AddTDTitle("标题");
            this.Pub1.AddTDTitle("发起人");
            this.Pub1.AddTDTitle("接受日期");

            // 显示出来字段. BatchParas 的规则为 @字段中文名=fieldName@字段中文名1=fieldName1
            MapAttrs attrs = new MapAttrs(this.FK_MapData);
            string[] strs  = nd.BatchParas.Split(',');
            foreach (string str in strs)
            {
                if (string.IsNullOrEmpty(str) ||
                    str.Contains("@PFlowNo") == true)
                {
                    continue;
                }

                foreach (MapAttr attr in attrs)
                {
                    if (str != attr.KeyOfEn)
                    {
                        continue;
                    }
                    this.Pub1.AddTDTitle(attr.Name);
                }
            }
            this.Pub1.AddTREnd();
            #endregion 生成标题.

            GERpt rpt = nd.HisFlow.HisGERpt;
            bool  is1 = false;
            int   idx = 0;
            foreach (Work wk in wks)
            {
                idx++;
                if (idx == nd.BatchListCount)
                {
                    break;
                }

                #region 显示必要的列.
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(idx);
                CheckBox cb = new CheckBox();
                cb.ID = "CB_" + wk.OID.ToString();
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["WorkID"].ToString() != wk.OID.ToString())
                    {
                        continue;
                    }
                    cb.Text = "选择";
                    this.Pub1.AddTD(cb);

                    //this.Pub1.AddTD("<a href=\"javascript:WinOpen('MyFlow.aspx?WorkID=" + wk.OID + "&FK_Node=" + this.FK_Node + "&FK_Flow="+nd.FK_Flow+"','s')\" >" + dr["Title"].ToString() + "</a>");
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('FlowFormTree/Default.aspx?WorkID=" + wk.OID + "&FK_Node=" + this.FK_Node + "&IsSend=0&FK_Flow=" + nd.FK_Flow + "','s')\" >" + dr["Title"].ToString() + "</a>");
                    this.Pub1.AddTD(dr["Starter"].ToString());
                    this.Pub1.AddTD(dr["ADT"].ToString());
                    break;
                }
                #endregion 显示必要的列.

                #region 显示出来自定义的字段数据..
                foreach (string str in strs)
                {
                    if (string.IsNullOrEmpty(str) || str.Contains("@PFlowNo") == true)
                    {
                        continue;
                    }
                    foreach (MapAttr attr in attrs)
                    {
                        if (str != attr.KeyOfEn)
                        {
                            continue;
                        }

                        TB tb = new TB();
                        tb.ID = "TB_" + attr.KeyOfEn + "_" + wk.OID;
                        switch (attr.LGType)
                        {
                        case FieldTypeS.Normal:
                            switch (attr.MyDataType)
                            {
                            case BP.DA.DataType.AppString:
                                if (attr.UIRows == 1)
                                {
                                    tb.Text = wk.GetValStringByKey(attr.KeyOfEn);
                                    tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 15px;padding: 0px;margin: 0px;";
                                    if (attr.UIIsEnable)
                                    {
                                        tb.CssClass = "TB";
                                    }
                                    else
                                    {
                                        tb.CssClass = "TBReadonly";
                                    }
                                    this.Pub1.AddTD(tb);
                                }
                                else
                                {
                                    tb.TextMode                = TextBoxMode.MultiLine;
                                    tb.Text                    = wk.GetValStringByKey(attr.KeyOfEn);
                                    tb.Attributes["style"]     = "width: " + attr.UIWidth + "px; text-align: left;padding: 0px;margin: 0px;";
                                    tb.Attributes["maxlength"] = attr.MaxLen.ToString();
                                    tb.Rows                    = attr.UIRows;
                                    if (attr.UIIsEnable)
                                    {
                                        tb.CssClass = "TBDoc";
                                    }
                                    else
                                    {
                                        tb.CssClass = "TBReadonly";
                                    }
                                    this.Pub1.AddTD(tb);
                                }
                                break;

                            case BP.DA.DataType.AppDate:
                                tb.ShowType = TBType.Date;
                                tb.Text     = wk.GetValStrByKey(attr.KeyOfEn);

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["onfocus"] = "WdatePicker();";
                                }

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TB";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppDateTime:
                                tb.ShowType = TBType.DateTime;
                                tb.Text     = wk.GetValStrByKey(attr.KeyOfEn);     // en.GetValStrByKey(attr.KeyOfEn);

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TBcalendar";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                                }
                                tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppBoolean:
                                cb = new CheckBox();
                                //cb.Width = 350;
                                cb.Text    = attr.Name;
                                cb.ID      = "CB_" + attr.KeyOfEn + "_" + wk.OID;
                                cb.Checked = attr.DefValOfBool;
                                cb.Enabled = attr.UIIsEnable;
                                cb.Checked = wk.GetValBooleanByKey(attr.KeyOfEn);

                                if (cb.Enabled == false)
                                {
                                    cb.Enabled = false;
                                }
                                else
                                {
                                    //add by dgq 2013-4-9,添加内容修改后的事件
                                    // cb.Attributes["onmousedown"] = "Change('" + attr.FK_MapData + "')";
                                    cb.Enabled = true;
                                }
                                this.Pub1.AddTD(cb);
                                break;

                            case BP.DA.DataType.AppDouble:
                            case BP.DA.DataType.AppFloat:
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;word-break: keep-all;";
                                tb.Text = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d+\.*\d*$]/g,'');TB_ClickNum(this,0);");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'float');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppInt:
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;word-break: keep-all;";
                                tb.Text = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d]/g,'');TB_ClickNum(this,0);");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'int');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppMoney:
                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d+\.*\d*$]/g,'');TB_ClickNum(this,'0.00');");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'float');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                //  tb.ShowType = TBType.Moneny;
                                tb.Text = wk.GetValIntByKey(attr.KeyOfEn).ToString("0.00");

                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppRate:
                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }
                                tb.ShowType            = TBType.Moneny;
                                tb.Text                = wk.GetValMoneyByKey(attr.KeyOfEn).ToString("0.00");
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            default:
                                break;
                            }
                            break;

                        case FieldTypeS.Enum:
                            if (attr.UIContralType == UIContralType.DDL)
                            {
                                DDL ddle = new DDL();
                                ddle.ID = "DDL_" + attr.KeyOfEn + "_" + wk.OID;
                                ddle.BindSysEnum(attr.UIBindKey);
                                ddle.SetSelectItem(wk.GetValIntByKey(attr.KeyOfEn));
                                ddle.Enabled = attr.UIIsEnable;
                                ddle.Attributes["tabindex"] = attr.Idx.ToString();
                                if (attr.UIIsEnable)
                                {
                                    //add by dgq 2013-4-9,添加内容修改后的事件
                                    ddle.Attributes["onchange"] = "Change('" + attr.FK_MapData + "')";
                                }
                                //    ddle.Enabled = false;
                                this.Pub1.AddTD(ddle);
                            }
                            else
                            {
                            }
                            break;

                        case FieldTypeS.FK:
                            DDL ddl1 = new DDL();
                            ddl1.ID = "DDL_" + attr.KeyOfEn + "_" + wk.OID;
                            ddl1.Attributes["tabindex"] = attr.Idx.ToString();
                            if (ddl1.Enabled)
                            {
                                EntitiesNoName ens = attr.HisEntitiesNoName;
                                ens.RetrieveAll();
                                ddl1.BindEntities(ens);
                                ddl1.SetSelectItem(wk.GetValStrByKey(attr.KeyOfEn));
                            }
                            else
                            {
                                ddl1.Attributes["style"] = "width: " + attr.UIWidth + "px;height: 19px;";
                                if (ddl1.Enabled == true)
                                {
                                    ddl1.Enabled = false;
                                }
                                ddl1.Attributes["Width"] = attr.UIWidth.ToString();
                                ddl1.Items.Add(new ListItem(wk.GetValRefTextByKey(attr.KeyOfEn), wk.GetValStrByKey(attr.KeyOfEn)));
                            }
                            ddl1.Enabled = attr.UIIsEnable;
                            this.Pub1.AddTD(ddl1);
                            break;

                        default:
                            break;
                        }
                    }
                }
                #endregion 显示出来自定义的字段数据..

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

            MapExts mes = new MapExts(this.FK_MapData);

            #region 处理扩展属性.
            if (mes.Count != 0)
            {
                this.Page.RegisterClientScriptBlock("s81",
                                                    "<script language='JavaScript' src='/WF/Scripts/jquery-1.4.1.min.js' ></script>");
                this.Page.RegisterClientScriptBlock("b81",
                                                    "<script language='JavaScript' src='/WF/CCForm/MapExt.js' defer='defer' type='text/javascript' ></script>");
                this.Pub1.Add("<div id='divinfo' style='width: 155px; position: absolute; color: Lime; display: none;cursor: pointer;align:left'></div>");
                this.Page.RegisterClientScriptBlock("dCd",
                                                    "<script language='JavaScript' src='/DataUser/JSLibData/" + this.FK_MapData + ".js' ></script>");

                foreach (Work wk in wks)
                {
                    foreach (MapExt me in mes)
                    {
                        switch (me.ExtType)
                        {
                        case MapExtXmlList.DDLFullCtrl:     // 自动填充.
                            DDL ddlOper = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + wk.OID);
                            if (ddlOper == null)
                            {
                                continue;
                            }
                            ddlOper.Attributes["onchange"] = "DDLFullCtrl(this.value,\'" + ddlOper.ClientID + "\', \'" + me.MyPK + "\')";
                            break;

                        case MapExtXmlList.ActiveDDL:
                            DDL    ddlPerant = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + wk.OID);
                            string val, valC;
                            if (ddlPerant == null || wk.OID < 100)
                            {
                                continue;
                            }

#warning 此处需要优化
                            string ddlC = "ContentPlaceHolder1_Batch1_DDL_" + me.AttrsOfActive + "_" + wk.OID;
                            //  ddlPerant.Attributes["onchange"] = " isChange=true; DDLAnsc(this.value, \'" + ddlC + "\', \'" + me.MyPK + "\')";
                            ddlPerant.Attributes["onchange"] = "DDLAnsc(this.value, \'" + ddlC + "\', \'" + me.MyPK + "\')";

                            DDL ddlChild = this.Pub1.GetDDLByID("DDL_" + me.AttrsOfActive + "_" + wk.OID);
                            val = ddlPerant.SelectedItemStringVal;
                            if (ddlChild.Items.Count == 0)
                            {
                                valC = wk.GetValStrByKey(me.AttrsOfActive);
                            }
                            else
                            {
                                valC = ddlChild.SelectedItemStringVal;
                            }

                            string mysql = me.Doc.Replace("@Key", val);
                            if (mysql.Contains("@"))
                            {
                                mysql = BP.WF.Glo.DealExp(mysql, wk, null);
                            }

                            ddlChild.Bind(DBAccess.RunSQLReturnTable(mysql), "No", "Name");
                            if (ddlChild.SetSelectItem(valC) == false)
                            {
                                ddlChild.Items.Insert(0, new ListItem("请选择" + valC, valC));
                                ddlChild.SelectedIndex = 0;
                            }
                            break;

                        case MapExtXmlList.AutoFullDLL:     //自动填充下拉框的范围.
                            DDL ddlFull = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + wk.OID);
                            if (ddlFull == null)
                            {
                                continue;
                            }

                            string valOld = wk.GetValStrByKey(me.AttrOfOper);

                            string fullSQL = me.Doc.Replace("@WebUser.No", WebUser.No);
                            fullSQL = fullSQL.Replace("@WebUser.Name", WebUser.Name);
                            fullSQL = fullSQL.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                            fullSQL = fullSQL.Replace("@WebUser.FK_DeptName", WebUser.FK_DeptName);
                            fullSQL = fullSQL.Replace("@Key", this.Request.QueryString["Key"]);

                            if (fullSQL.Contains("@"))
                            {
                                Attrs attrsFull = wk.EnMap.Attrs;
                                foreach (Attr attr in attrsFull)
                                {
                                    if (fullSQL.Contains("@") == false)
                                    {
                                        break;
                                    }
                                    fullSQL = fullSQL.Replace("@" + attr.Key, wk.GetValStrByKey(attr.Key));
                                }
                            }

                            ddlFull.Items.Clear();
                            ddlFull.Bind(DBAccess.RunSQLReturnTable(fullSQL), "No", "Name");
                            if (ddlFull.SetSelectItem(valOld) == false)
                            {
                                ddlFull.Items.Insert(0, new ListItem("请选择" + valOld, valOld));
                                ddlFull.SelectedIndex = 0;
                            }
                            // ddlFull.Attributes["onchange"] = " isChange=true;";
                            break;

                        case MapExtXmlList.TBFullCtrl:     // 自动填充.
                            TextBox tbAuto = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + wk.OID);
                            if (tbAuto == null)
                            {
                                continue;
                            }
                            // tbAuto.Attributes["onkeyup"] = " isChange=true; DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                            tbAuto.Attributes["onkeyup"]      = " DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                            tbAuto.Attributes["AUTOCOMPLETE"] = "OFF";
                            if (me.Tag != "")
                            {
                                /* 处理下拉框的选择范围的问题 */
                                string[] strsTmp = me.Tag.Split('$');
                                foreach (string str in strsTmp)
                                {
                                    string[] myCtl = str.Split(':');
                                    string   ctlID = myCtl[0];
                                    DDL      ddlC1 = this.Pub1.GetDDLByID("DDL_" + ctlID + "_" + wk.OID);
                                    if (ddlC1 == null)
                                    {
                                        //me.Tag = "";
                                        // me.Update();
                                        continue;
                                    }
                                    sql = myCtl[1].Replace("~", "'");
                                    sql = sql.Replace("@WebUser.No", WebUser.No);
                                    sql = sql.Replace("@WebUser.Name", WebUser.Name);
                                    sql = sql.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                                    sql = sql.Replace("@Key", tbAuto.Text.Trim());
                                    dt  = DBAccess.RunSQLReturnTable(sql);
                                    string valC1 = ddlC1.SelectedItemStringVal;
                                    ddlC1.Items.Clear();
                                    foreach (DataRow dr in dt.Rows)
                                    {
                                        ddlC1.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
                                    }
                                    ddlC1.SetSelectItem(valC1);
                                }
                            }
                            break;

                        case MapExtXmlList.InputCheck:
                            TextBox tbCheck = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + wk.OID);
                            if (tbCheck != null)
                            {
                                tbCheck.Attributes[me.Tag2] += " rowPK=" + wk.OID + "; " + me.Tag1 + "(this);";
                            }
                            break;

                        case MapExtXmlList.PopVal:     //弹出窗.
                            TB tb = this.Pub1.GetTBByID("TB_" + me.AttrOfOper + "_" + wk.OID);
                            //  tb.Attributes["ondblclick"] = " isChange=true; ReturnVal(this,'" + me.Doc + "','sd');";
                            tb.Attributes["ondblclick"] = " ReturnVal(this,'" + me.Doc + "','sd');";
                            break;

                        case MapExtXmlList.Link:     // 超链接.
                            //TB tb = this.Pub1.GetTBByID("TB_" + me.AttrOfOper + "_" + mydtl.OID);
                            //tb.Attributes["ondblclick"] = " isChange=true; ReturnVal(this,'" + me.Doc + "','sd');";
                            break;

                        case MapExtXmlList.RegularExpression:    //正则表达式,对数据控件处理
                            TextBox tbExp = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + wk.OID);
                            if (tbExp == null || me.Tag == "onsubmit")
                            {
                                continue;
                            }
                            //验证输入的正则格式
                            string regFilter = me.Doc;
                            if (regFilter.LastIndexOf("/g") < 0 && regFilter.LastIndexOf('/') < 0)
                            {
                                regFilter = "'" + regFilter + "'";
                            }
                            //处理事件
                            tbExp.Attributes.Add("" + me.Tag + "", "return txtTest_Onkeyup(this," + regFilter + ",'" + me.Tag1 + "')");    //[me.Tag] += "this.value=this.value.replace(" + regFilter + ",'')";
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            #endregion 拓展属性

            Button btn = new Button();
            if (nd.HisBatchRole == BatchRole.Ordinary)
            {
                /*如果普通的批处理.*/
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Send";
                if (nd.BatchParas_IsSelfUrl == true)
                {
                    btn.Text = "选择要批量处理的工作";
                }
                else
                {
                    btn.Text = "批量处理:" + btnLab.SendLab;
                }
                btn.Click += new EventHandler(btn_Send_Click);
                btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                this.Pub1.Add(btn);
                if (btnLab.ReturnEnable == false)
                {
                    btn          = new Button();
                    btn.CssClass = "Btn";
                    btn.ID       = "Btn_Return";
                    btn.Text     = "批量处理:" + btnLab.ReturnEnable;
                    btn.Click   += new EventHandler(btnDelete_Return_Click);
                    btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                    this.Pub1.Add(btn);
                }
            }

            if (nd.HisBatchRole == BatchRole.Group)
            {
                /*如果分组审核?*/
                btn          = new Button();
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Group";
                //btn.Text = btnLab.SendLab;
                btn.Text   = "合卷批复";
                btn.Click += new EventHandler(btn_Group_Click);
                btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                this.Pub1.Add(btn);
            }

            if (btnLab.ReturnEnable == false)
            {
                btn          = new Button();
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Return";
                btn.Text     = "批量处理:" + btnLab.ReturnEnable;
                btn.Click   += new EventHandler(btnDelete_Return_Click);
                btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                this.Pub1.Add(btn);
            }

            if (btnLab.DeleteEnable != 0)
            {
                btn          = new Button();
                btn.CssClass = "Btn";
                btn.ID       = "Btn_Del";
                btn.Text     = "批量处理:" + btnLab.DeleteLab;
                btn.Click   += new EventHandler(btnDelete_Click);
                btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
                this.Pub1.Add(btn);
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (BP.WF.Dev2Interface.Flow_IsCanStartThisFlow(this.FK_Flow, WebUser.No) == false)
            {
            }

            Flow fl = new Flow(this.FK_Flow);

            this.Page.Title = fl.Name;
            MapAttrs attrs = new MapAttrs(this.FK_MapData);

            if (fl.BatchStartFields.Length == 0)
            {
                this.Pub1.AddFieldSet("流程属性设置错误");
                this.Pub1.Add("您需要在流程属性里设置批量发起需要填写的字段。");
                this.Pub1.AddFieldSetEnd();
            }

            MapExts mes = new MapExts(this.FK_MapData);

            BP.WF.Node nd = new BP.WF.Node(int.Parse(this.FK_Flow + "01"));
            Work       wk = nd.HisWork;

            wk.ResetDefaultVal();

            this.Pub1.AddTable();
            this.Pub1.AddCaptionMsg("批量发起:" + fl.Name);

            #region 输出标题.
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序");

            string str1 = "<INPUT id='checkedAll' onclick=\"SelectAllBS(this);\" value='选择' type='checkbox' name='checkedAll' >全部选择";
            this.Pub1.AddTDTitle("align='left'", str1);

            //this.Pub1.AddTDTitle("align='left'", "");

            string[] strs = fl.BatchStartFields.Split(',');
            foreach (string str in strs)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                foreach (MapAttr attr in attrs)
                {
                    if (str != attr.KeyOfEn)
                    {
                        continue;
                    }
                    this.Pub1.AddTDTitle(attr.Name);
                }
            }
            this.Pub1.AddTREnd();
            #endregion 输出标题.

            #region 输出标题.
            for (int i = 1; i <= this.RowNum; i++)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(i);
                CheckBox cbIdx = new CheckBox();
                cbIdx.Checked = false;
                cbIdx.Text    = "发起否?";
                cbIdx.ID      = "CB_IDX_" + i;
                this.Pub1.AddTD(cbIdx);

                foreach (string str in strs)
                {
                    if (string.IsNullOrEmpty(str))
                    {
                        continue;
                    }
                    foreach (MapAttr attr in attrs)
                    {
                        if (str != attr.KeyOfEn)
                        {
                            continue;
                        }

                        TB tb = new TB();
                        tb.ID = "TB_" + attr.KeyOfEn + "_" + i;
                        switch (attr.LGType)
                        {
                        case FieldTypeS.Normal:
                            switch (attr.MyDataType)
                            {
                            case BP.DA.DataType.AppString:
                                if (attr.UIRows == 1)
                                {
                                    tb.Text = attr.DefVal;
                                    tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 15px;padding: 0px;margin: 0px;";
                                    if (attr.UIIsEnable)
                                    {
                                        tb.CssClass = "TB";
                                    }
                                    else
                                    {
                                        tb.CssClass = "TBReadonly";
                                    }
                                    this.Pub1.AddTD(tb);
                                }
                                else
                                {
                                    tb.TextMode = TextBoxMode.MultiLine;
                                    tb.Text     = attr.DefVal;

                                    tb.Attributes["style"]     = "width: " + attr.UIWidth + "px; text-align: left;padding: 0px;margin: 0px;";
                                    tb.Attributes["maxlength"] = attr.MaxLen.ToString();
                                    tb.Rows = attr.UIRows;

                                    if (attr.UIIsEnable)
                                    {
                                        tb.CssClass = "TBDoc";
                                    }
                                    else
                                    {
                                        tb.CssClass = "TBReadonly";
                                    }

                                    this.Pub1.AddTD(tb);
                                }
                                break;

                            case BP.DA.DataType.AppDate:
                                tb.ShowType = TBType.Date;
                                tb.Text     = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["onfocus"] = "WdatePicker();";
                                }

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TB";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppDateTime:
                                tb.ShowType = TBType.DateTime;
                                tb.Text     = attr.DefVal;     // en.GetValStrByKey(attr.KeyOfEn);

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TBcalendar";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                                }
                                tb.Attributes["style"] = "width: " + attr.UIWidth + "px; text-align: left; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppBoolean:
                                CheckBox cb = new CheckBox();
                                //cb.Width = 350;
                                cb.Text    = attr.Name;
                                cb.ID      = "CB_" + attr.KeyOfEn + "_" + i;
                                cb.Checked = attr.DefValOfBool;
                                cb.Enabled = attr.UIIsEnable;
                                cb.Checked = attr.DefValOfBool;

                                if (cb.Enabled == false)
                                {
                                    cb.Enabled = false;
                                }
                                else
                                {
                                    //add by dgq 2013-4-9,添加内容修改后的事件
                                    // cb.Attributes["onmousedown"] = "Change('" + attr.FK_MapData + "')";
                                    cb.Enabled = true;
                                }
                                this.Pub1.AddTD(cb);
                                break;

                            case BP.DA.DataType.AppDouble:
                            case BP.DA.DataType.AppFloat:
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;word-break: keep-all;";
                                tb.Text = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d+\.*\d*$]/g,'');TB_ClickNum(this,0);");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'float');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppInt:
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;word-break: keep-all;";
                                tb.Text = attr.DefVal;

                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d]/g,'');TB_ClickNum(this,0);");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'int');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }

                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppMoney:
                                if (attr.UIIsEnable)
                                {
                                    //增加验证
                                    tb.Attributes.Add("onkeyup", @"Change('" + attr.FK_MapData + "');");
                                    tb.Attributes.Add("onblur", @"value=value.replace(/[^-?\d+\.*\d*$]/g,'');TB_ClickNum(this,'0.00');");
                                    tb.Attributes.Add("onClick", "TB_ClickNum(this)");
                                    tb.Attributes["OnKeyPress"] += @"javascript:return  VirtyNum(this,'float');";
                                    tb.Attributes["class"]       = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }
                                //  tb.ShowType = TBType.Moneny;
                                tb.Text = attr.DefVal;

                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            case BP.DA.DataType.AppRate:
                                if (attr.UIIsEnable)
                                {
                                    tb.Attributes["class"] = "TBNum";
                                }
                                else
                                {
                                    tb.Attributes["class"] = "TBReadonly";
                                }
                                tb.ShowType            = TBType.Moneny;
                                tb.Text                = attr.DefVal;
                                tb.Attributes["style"] = "width: " + attr.GetValStrByKey("UIWidth") + "px; text-align: right; height: 19px;";
                                this.Pub1.AddTD(tb);
                                break;

                            default:
                                break;
                            }
                            break;

                        case FieldTypeS.Enum:
                            if (attr.UIContralType == UIContralType.DDL)
                            {
                                DDL ddle = new DDL();
                                ddle.ID = "DDL_" + attr.KeyOfEn + "_" + i;
                                ddle.BindSysEnum(attr.UIBindKey);
                                ddle.SetSelectItem(attr.DefVal);
                                ddle.Enabled = attr.UIIsEnable;
                                ddle.Attributes["tabindex"] = attr.Idx.ToString();
                                if (attr.UIIsEnable)
                                {
                                    //add by dgq 2013-4-9,添加内容修改后的事件
                                    //   ddle.Attributes["onchange"] = "Change('" + attr.FK_MapData + "')";
                                }
                                //    ddle.Enabled = false;
                                this.Pub1.AddTD(ddle);
                            }
                            else
                            {
                            }
                            break;

                        case FieldTypeS.FK:
                            DDL ddl1 = new DDL();
                            ddl1.ID = "DDL_" + attr.KeyOfEn + "_" + i;
                            ddl1.Attributes["tabindex"] = attr.Idx.ToString();
                            if (ddl1.Enabled)
                            {
                                EntitiesNoName ens = attr.HisEntitiesNoName;
                                ens.RetrieveAll();
                                ddl1.BindEntities(ens);
                                ddl1.SetSelectItem(attr.DefVal);
                                //add by dgq 2013-4-9,添加内容修改后的事件
                                //  ddl1.Attributes["onchange"] = "Change('" + attr.FK_MapData + "')";
                            }
                            else
                            {
                                ddl1.Attributes["style"] = "width: " + attr.UIWidth + "px;height: 19px;";
                                if (ddl1.Enabled == true)
                                {
                                    ddl1.Enabled = false;
                                }
                                ddl1.Attributes["Width"] = attr.UIWidth.ToString();
                                ddl1.Items.Add(new ListItem(attr.DefVal, attr.DefVal));
                            }
                            ddl1.Enabled = attr.UIIsEnable;
                            this.Pub1.AddTD(ddl1);
                            break;

                        default:
                            break;
                        }
                    }
                }
                this.Pub1.AddTREnd();
            }
            #endregion 输出标题.

            this.Pub1.AddTableEnd();

            #region 处理扩展属性.
            if (mes.Count != 0)
            {
                this.Page.RegisterClientScriptBlock("s81",
                                                    "<script language='JavaScript' src='/WF/Scripts/jquery-1.4.1.min.js' ></script>");
                this.Page.RegisterClientScriptBlock("b81",
                                                    "<script language='JavaScript' src='/WF/CCForm/MapExt.js' defer='defer' type='text/javascript' ></script>");
                this.Pub1.Add("<div id='divinfo' style='width: 155px; position: absolute; color: Lime; display: none;cursor: pointer;align:left'></div>");
                this.Page.RegisterClientScriptBlock("dCd",
                                                    "<script language='JavaScript' src='/DataUser/JSLibData/" + this.FK_MapData + ".js' ></script>");

                for (int i = 1; i <= this.RowNum; i++)
                {
                    foreach (MapExt me in mes)
                    {
                        switch (me.ExtType)
                        {
                        case MapExtXmlList.DDLFullCtrl:     // 自动填充.
                            DDL ddlOper = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                            if (ddlOper == null)
                            {
                                continue;
                            }
                            ddlOper.Attributes["onchange"] = "DDLFullCtrl(this.value,\'" + ddlOper.ClientID + "\', \'" + me.MyPK + "\')";
                            break;

                        case MapExtXmlList.ActiveDDL:
                            DDL       ddlPerant = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                            string    val, valC;
                            DataTable dt;
                            if (ddlPerant == null)
                            {
                                continue;
                            }
#warning 此处需要优化
                            string ddlC = "ContentPlaceHolder1_BatchStart1_DDL_" + me.AttrsOfActive + "_" + i;
                            //  ddlPerant.Attributes["onchange"] = " isChange=true; DDLAnsc(this.value, \'" + ddlC + "\', \'" + me.MyPK + "\')";
                            ddlPerant.Attributes["onchange"] = "DDLAnsc(this.value, \'" + ddlC + "\', \'" + me.MyPK + "\')";

                            DDL ddlChild = this.Pub1.GetDDLByID("DDL_" + me.AttrsOfActive + "_" + i);
                            val = ddlPerant.SelectedItemStringVal;
                            if (ddlChild.Items.Count == 0)
                            {
                                valC = wk.GetValStrByKey(me.AttrsOfActive);
                            }
                            else
                            {
                                valC = ddlChild.SelectedItemStringVal;
                            }

                            string mysql = me.Doc.Replace("@Key", val);
                            if (mysql.Contains("@") && i >= 100)
                            {
                                mysql = BP.WF.Glo.DealExp(mysql, wk, null);
                            }
                            else
                            {
                                continue;
                            }

                            dt = DBAccess.RunSQLReturnTable(mysql);

                            ddlChild.Bind(dt, "No", "Name");
                            if (ddlChild.SetSelectItem(valC) == false)
                            {
                                ddlChild.Items.Insert(0, new ListItem("请选择" + valC, valC));
                                ddlChild.SelectedIndex = 0;
                            }
                            //  ddlChild.Attributes["onchange"] = " isChange=true;";

                            break;

                        case MapExtXmlList.AutoFullDLL:     //自动填充下拉框的范围.
                            DDL ddlFull = this.Pub1.GetDDLByID("DDL_" + me.AttrOfOper + "_" + i);
                            if (ddlFull == null)
                            {
                                continue;
                            }

                            string valOld = wk.GetValStrByKey(me.AttrOfOper);
                            //string valOld =ddlFull.SelectedItemStringVal;

                            string fullSQL = me.Doc.Replace("@WebUser.No", WebUser.No);
                            fullSQL = fullSQL.Replace("@WebUser.Name", WebUser.Name);
                            fullSQL = fullSQL.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                            fullSQL = fullSQL.Replace("@WebUser.FK_DeptName", WebUser.FK_DeptName);
                            fullSQL = fullSQL.Replace("@Key", this.Request.QueryString["Key"]);

                            if (fullSQL.Contains("@"))
                            {
                                Attrs attrsFull = wk.EnMap.Attrs;
                                foreach (Attr attr in attrsFull)
                                {
                                    if (fullSQL.Contains("@") == false)
                                    {
                                        break;
                                    }
                                    fullSQL = fullSQL.Replace("@" + attr.Key, wk.GetValStrByKey(attr.Key));
                                }
                            }

                            //if (fullSQL.Contains("@"))
                            //{
                            //    /*从主表中取数据*/
                            //    Attrs attrsFull = this.MainEn.EnMap.Attrs;
                            //    foreach (Attr attr in attrsFull)
                            //    {
                            //        if (fullSQL.Contains("@") == false)
                            //            break;

                            //        if (fullSQL.Contains("@" + attr.Key) == false)
                            //            continue;

                            //        fullSQL = fullSQL.Replace("@" + attr.Key, this.MainEn.GetValStrByKey(attr.Key));
                            //    }
                            //}

                            ddlFull.Items.Clear();
                            ddlFull.Bind(DBAccess.RunSQLReturnTable(fullSQL), "No", "Name");
                            if (ddlFull.SetSelectItem(valOld) == false)
                            {
                                ddlFull.Items.Insert(0, new ListItem("请选择" + valOld, valOld));
                                ddlFull.SelectedIndex = 0;
                            }
                            // ddlFull.Attributes["onchange"] = " isChange=true;";
                            break;

                        case MapExtXmlList.TBFullCtrl:     // 自动填充.
                            TextBox tbAuto = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                            if (tbAuto == null)
                            {
                                continue;
                            }
                            // tbAuto.Attributes["onkeyup"] = " isChange=true; DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";
                            tbAuto.Attributes["onkeyup"] = " DoAnscToFillDiv(this,this.value,\'" + tbAuto.ClientID + "\', \'" + me.MyPK + "\');";

                            tbAuto.Attributes["AUTOCOMPLETE"] = "OFF";
                            if (me.Tag != "")
                            {
                                /* 处理下拉框的选择范围的问题 */
                                string[] strsTmp = me.Tag.Split('$');
                                foreach (string str in strsTmp)
                                {
                                    string[] myCtl = str.Split(':');
                                    string   ctlID = myCtl[0];
                                    DDL      ddlC1 = this.Pub1.GetDDLByID("DDL_" + ctlID + "_" + i);
                                    if (ddlC1 == null)
                                    {
                                        //me.Tag = "";
                                        // me.Update();
                                        continue;
                                    }

                                    string sql = myCtl[1].Replace("~", "'");
                                    sql = sql.Replace("@WebUser.No", WebUser.No);
                                    sql = sql.Replace("@WebUser.Name", WebUser.Name);
                                    sql = sql.Replace("@WebUser.FK_Dept", WebUser.FK_Dept);
                                    sql = sql.Replace("@Key", tbAuto.Text.Trim());
                                    dt  = DBAccess.RunSQLReturnTable(sql);
                                    string valC1 = ddlC1.SelectedItemStringVal;
                                    ddlC1.Items.Clear();
                                    foreach (DataRow dr in dt.Rows)
                                    {
                                        ddlC1.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
                                    }
                                    ddlC1.SetSelectItem(valC1);
                                }
                            }
                            break;

                        case MapExtXmlList.InputCheck:
                            TextBox tbCheck = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                            if (tbCheck != null)
                            {
                                tbCheck.Attributes[me.Tag2] += " rowPK=" + i + "; " + me.Tag1 + "(this);";
                            }
                            break;

                        case MapExtXmlList.PopVal:     //弹出窗.
                            TB tb = this.Pub1.GetTBByID("TB_" + me.AttrOfOper + "_" + i);
                            //  tb.Attributes["ondblclick"] = " isChange=true; ReturnVal(this,'" + me.Doc + "','sd');";
                            tb.Attributes["ondblclick"] = " ReturnVal(this,'" + me.Doc + "','sd');";
                            break;

                        case MapExtXmlList.Link:     // 超链接.
                            //TB tb = this.Pub1.GetTBByID("TB_" + me.AttrOfOper + "_" + mydtl.OID);
                            //tb.Attributes["ondblclick"] = " isChange=true; ReturnVal(this,'" + me.Doc + "','sd');";
                            break;

                        case MapExtXmlList.RegularExpression:    //正则表达式,对数据控件处理
                            TextBox tbExp = this.Pub1.GetTextBoxByID("TB_" + me.AttrOfOper + "_" + i);
                            if (tbExp == null || me.Tag == "onsubmit")
                            {
                                continue;
                            }
                            //验证输入的正则格式
                            string regFilter = me.Doc;
                            if (regFilter.LastIndexOf("/g") < 0 && regFilter.LastIndexOf('/') < 0)
                            {
                                regFilter = "'" + regFilter + "'";
                            }
                            //处理事件
                            tbExp.Attributes.Add("" + me.Tag + "", "return txtTest_Onkeyup(this," + regFilter + ",'" + me.Tag1 + "')");    //[me.Tag] += "this.value=this.value.replace(" + regFilter + ",'')";
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            #endregion 拓展属性

            Button btn = new Button();
            btn.Text          = "执行发起";
            btn.ID            = "Btn_Start";
            btn.Click        += new EventHandler(btn_Send_Click);
            btn.OnClientClick = "return checkType()";
            this.Pub1.Add(btn);

            #region 文件上传.
            this.Pub1.AddFieldSet("通过Excel导入方式发起:<a href='/DataUser/BatchStartFlowTemplete/" + this.FK_Flow + ".xls'><img src='/WF/Img/FileType/xls.gif' />下载Excel模版</a>");
            this.Pub1.Add("文件名:");
            FileUpload fu = new FileUpload();
            fu.ID = "File1";
            this.Pub1.Add(fu);
            btn        = new Button();
            btn.Text   = "导入";
            btn.ID     = "Btn_Imp";
            btn.Click += new EventHandler(btn_Upload_Click);
            this.Pub1.Add(btn);
            this.Pub1.AddFieldSetEnd();
            #endregion 文件上传.
        }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "流程报表定义";
        switch (this.DoType)
        {
        case "Reset":
            BP.WF.Flow fl = new BP.WF.Flow(this.FK_Flow);
            fl.CheckRptOfReset();
            this.Response.Redirect("WFRpt.aspx?FK_MapData=" + this.FK_MapData, true);
            return;

        default:
            break;
        }

        Cash.Map_Cash.Remove(this.FK_MapData);

        MapData  md     = new MapData(this.FK_MapData);
        MapAttrs mattrs = new MapAttrs(md.No);
        int      count  = mattrs.Count;

        if (mattrs.Count == 0)
        {
            BP.WF.Flow f = new BP.WF.Flow(this.FK_Flow);
            f.CheckRpt();
            this.Response.Redirect(this.Request.RawUrl, true);
            return;
        }

        if (gfs.Count == 1)
        {
            GroupField mygf = (GroupField)gfs[0];
            if (mygf.Lab != md.Name)
            {
                mygf.Lab = md.Name;
                mygf.Update();
            }
        }

        this.Pub1.AddB(this.Title + "&nbsp;&nbsp;<a href=\"javascript:GroupFieldNew('" + md.No + "')\">字段分组</a>");
        //  this.Pub1.AddB("-<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=" + this.MyPK + "')\">查询预览</a>");
        // this.Pub1.AddB("-<a href=\"javascript:WinOpen('/WF/Comm/Group.aspx?EnsName=" + this.MyPK + "')\">分析预览</a>");

        if (this.FK_MapData.Contains("RptDtl") == false)
        {
            this.Pub1.AddB("-<a href=\"javascript:DoReset('" + this.FK_Flow + "','" + this.FK_MapData + "')\">重设字段</a>");

            /* 说明是主表:判断它是否有从表。*/
            string sql = "SELECT COUNT(No) FROM Sys_MapDtl WHERE No LIKE 'ND" + int.Parse(this.FK_Flow) + "%'";
            if (BP.DA.DBAccess.RunSQLReturnValInt(sql) >= 1)
            {
                // this.Pub1.AddB("-<a href=\"javascript:AddDtl('" + md.No + "')\">插入从表</a>");
                //sql = "SELECT No FROM Sys_MapData WHERE No LIKE '" + this.MyPK + "Dtl%'";
                //DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql);
                //switch (dt.Rows.Count)
                //{
                //    case 0:
                //        break;
                //    case 1:
                //        this.Pub1.AddB("-<a href='WFRpt.aspx?MyPK=" + dt.Rows[0][0].ToString() + "'>明细报表设计</a>");
                //        break;
                //    default:
                //        this.Pub1.AddB("-<a href='WFRpt.aspx?DoType=DeDtl&MyPK=" + this.MyPK + "'>明细报表设计</a>");
                //        break;
                //}
            }
        }
        else
        {
            this.Pub1.AddB("-<a href=\"WFRpt.aspx?MyPK=ND" + int.Parse(this.FK_Flow) + "Rpt\">" + "返回" + "</a>");
        }

        this.Pub1.AddHR();

        this.Pub1.AddTable("width='100%'");

        /*
         * 根据 GroupField 循环出现菜单。
         */
        foreach (GroupField gf in gfs)
        {
            string gfAttr = " onmouseover=GFOnMouseOver('" + gf.OID + "','" + rowIdx + "') onmouseout=GFOnMouseOut()";
            currGF = gf;
            this.Pub1.AddTR(gfAttr);
            if (gfs.Count == 1)
            {
                this.Pub1.AddTD("colspan=4 class=GroupField valign='top' align:left style='height: 24px;align:left' ", "<div style='text-align:left; float:left'>&nbsp;<a href=\"javascript:GroupField('" + this.FK_MapData + "','" + gf.OID + "')\" >" + gf.Lab + "</a></div><div style='text-align:right; float:right'></div>");
            }
            else
            {
                this.Pub1.AddTD("colspan=4 class=GroupField valign='top' align:left style='height: 24px;align:left' onclick=\"GroupBarClick('" + gf.Idx + "')\" ", "<div style='text-align:left; float:left'><img src='../Style/Min.gif' alert='Min' id='Img" + gf.Idx + "'   border=0 />&nbsp;<a href=\"javascript:GroupField('" + this.FK_MapData + "','" + gf.OID + "')\" >" + gf.Lab + "</a></div><div style='text-align:right; float:right'> <a href=\"javascript:GFDoUp('" + gf.OID + "')\" ><img src='./WF/Img/Btn/Up.gif' class='Arrow' border=0/></a> <a href=\"javascript:GFDoDown('" + gf.OID + "')\" ><img src='./WF/Img/Btn/Down.gif' class='Arrow' border=0/></a></div>");
            }

            this.Pub1.AddTREnd();
            int i   = -1;
            int idx = -1;
            isLeftNext = true;
            rowIdx     = 0;
            foreach (MapAttr attr in mattrs)
            {
                gfAttr = " onmouseover=GFOnMouseOver('" + gf.OID + "','" + rowIdx + "') onmouseout=GFOnMouseOut()";
                if (attr.GroupID == 0)
                {
                    attr.GroupID = gf.OID;
                    attr.Update();
                }

                if (attr.GroupID != gf.OID)
                {
                    if (gf.Idx == 0 && attr.GroupID == 0)
                    {
                    }
                    else
                    {
                        continue;
                    }
                }

                if (attr.HisAttr.IsRefAttr || attr.UIVisible == false)
                {
                    continue;
                }

                if (isLeftNext)
                {
                    if (gfs.Count == 0)
                    {
                        this.InsertObjects(false);
                    }
                    else
                    {
                        this.InsertObjects(true);
                    }
                }

                // 显示的顺序号.
                idx++;
                if (attr.IsBigDoc && attr.UIIsLine)
                {
                    if (isLeftNext == false)
                    {
                        this.Pub1.AddTD();
                        this.Pub1.AddTD();
                        this.Pub1.AddTREnd();
                    }
                    rowIdx++;
                    this.Pub1.AddTR(" ID='" + currGF.Idx + "_" + rowIdx + "'  " + gfAttr);
                    this.Pub1.Add("<TD class=FDesc colspan=4 width='100%' >");
                    this.Pub1.Add(this.GenerLab(attr, idx, 0, count));
                    TextBox mytbLine = new TextBox();
                    mytbLine.ID                  = "TB_" + attr.KeyOfEn;
                    mytbLine.TextMode            = TextBoxMode.MultiLine;
                    mytbLine.Rows                = 8;
                    mytbLine.Attributes["style"] = "width:100%;padding: 0px;margin: 0px;";
                    mytbLine.Enabled             = attr.UIIsEnable;
                    if (mytbLine.Enabled == false)
                    {
                        mytbLine.Attributes["class"] = "TBReadonly";
                    }
                    this.Pub1.Add(mytbLine);
                    this.Pub1.AddTDEnd();
                    this.Pub1.AddTREnd();
                    isLeftNext = true;
                    continue;
                }

                if (attr.IsBigDoc)
                {
                    if (isLeftNext)
                    {
                        rowIdx++;
                        this.Pub1.AddTR(" ID='" + currGF.Idx + "_" + rowIdx + "' " + gfAttr);
                    }
                    this.Pub1.Add("<TD class=FDesc colspan=2 width='50%' >");
                    this.Pub1.Add(this.GenerLab(attr, idx, 0, count));
                    TextBox mytbLine = new TextBox();
                    mytbLine.TextMode            = TextBoxMode.MultiLine;
                    mytbLine.Rows                = 8;
                    mytbLine.Attributes["style"] = "width:100%;padding: 0px;margin: 0px;";
                    mytbLine.ID = "TB_" + attr.KeyOfEn;

                    mytbLine.Enabled = attr.UIIsEnable;
                    if (mytbLine.Enabled == false)
                    {
                        mytbLine.Attributes["class"] = "TBReadonly";
                    }


                    this.Pub1.Add(mytbLine);
                    this.Pub1.AddTDEnd();
                    if (isLeftNext == false)
                    {
                        this.Pub1.AddTREnd();
                    }

                    isLeftNext = !isLeftNext;
                    continue;
                }

                //计算 colspanOfCtl .
                int colspanOfCtl = 1;
                if (attr.UIIsLine)
                {
                    colspanOfCtl = 3;
                }

                if (attr.UIIsLine)
                {
                    if (isLeftNext == false)
                    {
                        this.Pub1.AddTD();
                        this.Pub1.AddTD();
                        this.Pub1.AddTREnd();
                    }
                    isLeftNext = true;
                }

                if (isLeftNext)
                {
                    rowIdx++;
                    this.Pub1.AddTR(" ID='" + currGF.Idx + "_" + rowIdx + "' " + gfAttr);
                }

                TB tb = new TB();
                tb.Attributes["width"] = "100%";
                tb.Columns             = 60;
                tb.ID = "TB_" + attr.KeyOfEn;

                #region add contrals.
                switch (attr.LGType)
                {
                case FieldTypeS.Normal:

                    tb.Enabled = attr.UIIsEnable;
                    switch (attr.MyDataType)
                    {
                    case BP.DA.DataType.AppString:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.TB;
                        tb.Text     = attr.DefVal;
                        if (colspanOfCtl == 3)
                        {
                            this.Pub1.AddTD(" width=80% colspan=" + colspanOfCtl, tb);
                        }
                        else
                        {
                            if (attr.IsSigan)
                            {
                                this.Pub1.AddTD("colspan=" + colspanOfCtl, "<img src='/DataUser/Siganture/" + WebUser.No + ".jpg' border=0 onerror=\"this.src='/DataUser/Siganture/UnName.jpg'\"/>");
                            }
                            else
                            {
                                this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                            }
                        }
                        break;

                    case BP.DA.DataType.AppDate:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.Date;

                        tb.Text = attr.DefVal;

                        if (attr.UIIsEnable)
                        {
                            tb.Attributes["onfocus"] = "WdatePicker();";
                        }

                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                        break;

                    case BP.DA.DataType.AppDateTime:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.DateTime;
                        tb.Text     = attr.DefVal;
                        if (attr.UIIsEnable)
                        {
                            tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
                        }

                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                        break;

                    case BP.DA.DataType.AppBoolean:
                        if (attr.UIIsLine)
                        {
                            this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        }
                        else
                        {
                            this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        }

                        CheckBox cb = new CheckBox();
                        cb.Text    = attr.Name;
                        cb.Checked = attr.DefValOfBool;
                        cb.Enabled = attr.UIIsEnable;
                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, cb);
                        break;

                    case BP.DA.DataType.AppDouble:
                    case BP.DA.DataType.AppFloat:
                    case BP.DA.DataType.AppInt:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.Num;
                        tb.Text     = attr.DefVal;
                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                        break;

                    case BP.DA.DataType.AppMoney:
                    case BP.DA.DataType.AppRate:
                        this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                        tb.ShowType = TBType.Moneny;
                        tb.Text     = attr.DefVal;
                        this.Pub1.AddTD("width='40%' colspan=" + colspanOfCtl, tb);
                        break;

                    default:
                        break;
                    }

                    tb.Attributes["width"] = "100%";
                    switch (attr.MyDataType)
                    {
                    case BP.DA.DataType.AppString:
                    case BP.DA.DataType.AppDateTime:
                    case BP.DA.DataType.AppDate:
                        if (tb.Enabled)
                        {
                            tb.Attributes["class"] = "TB";
                        }
                        else
                        {
                            tb.Attributes["class"] = "TBReadonly";
                        }
                        break;

                    default:
                        if (tb.Enabled)
                        {
                            tb.Attributes["class"] = "TBNum";
                        }
                        else
                        {
                            tb.Attributes["class"] = "TBNumReadonly";
                        }
                        break;
                    }
                    break;

                case FieldTypeS.Enum:
                    this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                    DDL ddle = new DDL();
                    ddle.ID = "DDL_" + attr.KeyOfEn;
                    ddle.BindSysEnum(attr.KeyOfEn);
                    ddle.SetSelectItem(attr.DefVal);
                    ddle.Enabled = attr.UIIsEnable;
                    this.Pub1.AddTD("colspan=" + colspanOfCtl, ddle);
                    break;

                case FieldTypeS.FK:
                    this.Pub1.AddTDDesc(this.GenerLab(attr, idx, i, count));
                    DDL ddl1 = new DDL();
                    ddl1.ID = "DDL_" + attr.KeyOfEn;
                    try
                    {
                        EntitiesNoName ens = attr.HisEntitiesNoName;
                        ens.RetrieveAll();
                        ddl1.BindEntities(ens);
                        ddl1.SetSelectItem(attr.DefVal);
                    }
                    catch
                    {
                    }
                    ddl1.Enabled = attr.UIIsEnable;
                    this.Pub1.AddTD("colspan=" + colspanOfCtl, ddl1);
                    break;

                default:
                    break;
                }
                #endregion add contrals.

                if (colspanOfCtl == 3)
                {
                    isLeftNext = true;
                    this.Pub1.AddTREnd();
                    continue;
                }

                if (isLeftNext == false)
                {
                    isLeftNext = true;
                    this.Pub1.AddTREnd();
                    continue;
                }
                isLeftNext = false;
            }
            // 最后处理补充上它。
            if (isLeftNext == false)
            {
                this.Pub1.AddTD();
                this.Pub1.AddTD();
                this.Pub1.AddTREnd();
            }
            this.InsertObjects(false);
        }
        this.Pub1.AddTableEnd();


        #region 处理异常情况。
        foreach (MapDtl dtl in dtls)
        {
            if (dtl.IsUse == false)
            {
                dtl.RowIdx  = 0;
                dtl.GroupID = 0;
                dtl.Update();
                //    this.Response.Redirect(this.Request.RawUrl, true);
            }
        }
        #endregion 处理异常情况。


        #region 处理iFrom 的自适应的问题。
        string js = "\t\n<script type='text/javascript' >";
        foreach (MapDtl dtl in dtls)
        {
            js += "\t\n window.setInterval(\"ReinitIframe('F" + dtl.No + "','TD" + dtl.No + "')\", 200);";
        }

        js += "\t\n</script>";
        this.Pub1.Add(js);
        #endregion 处理iFrom 的自适应的问题。

        #region 处理隐藏字段。
        string msg = ""; // +++++++ 编辑隐藏字段 +++++++++ <br>";
        foreach (MapAttr attr in mattrs)
        {
            if (attr.UIVisible)
            {
                continue;
            }
            switch (attr.KeyOfEn)
            {
            case "OID":
            case "FID":
            case "FK_NY":
            case "Emps":
            case "FK_Dept":
            case "WFState":
            case "RDT":
            case "MyNum":
            case "Rec":
            case "CDT":
                continue;

            default:
                break;
            }
            msg += "<a href=\"javascript:Edit('" + this.FK_MapData + "','" + attr.MyPK + "','" + attr.MyDataType + "');\">" + attr.Name + "</a> ";
        }

        if (msg.Length > 10)
        {
            this.Pub1.AddFieldSet("编辑隐藏字段");
            this.Pub1.Add(msg);
            this.Pub1.Add("<br>说明:隐藏字段是不显示在表单里面,多用于属性的计算、方向条件的设置,报表的体现。");
            this.Pub1.AddFieldSetEnd();
        }
        #endregion 处理隐藏字段。

        #region 查询条件定义
        this.Pub1.AddFieldSet("查询条件定义" + " - <a href=\"javascript:WinOpen('../Rpt/Search.aspx?FK_Flow=" + this.FK_Flow + "')\">查询预览</a>-<a href=\"javascript:WinOpen('/WF/Comm/Group.aspx?EnsName=" + this.MyPK + "')\">分析预览</a>");
        foreach (MapAttr mattr in mattrs)
        {
            if (mattr.UIContralType != UIContralType.DDL)
            {
                continue;
            }

            CheckBox cb = new CheckBox();
            cb.ID = "CB_F_" + mattr.KeyOfEn;
            if (md.RptSearchKeys.Contains("@" + mattr.KeyOfEn))
            {
                cb.Checked = true;
            }

            cb.Text = mattr.Name;
            this.Pub1.Add(cb);
        }

        this.Pub1.AddHR();
        Button btn = new Button();
        btn.CssClass = "Btn";
        btn.Text     = "保存";
        btn.ID       = "Btn_Save";
        btn.Click   += new EventHandler(btn_Click);
        this.Pub1.Add(btn);

        this.Pub1.AddFieldSetEnd();
        #endregion
    }
Ejemplo n.º 10
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);
            }
        }
        /// <summary>
        /// 绑定节点
        /// </summary>
        public void BindNode()
        {
            if (this.DoType == "Del")
            {
                TurnTo condDel = new TurnTo();
                condDel.MyPK = this.MyPK;
                condDel.Delete();
                this.Response.Redirect("TurnTo.aspx?FK_Node=" + this.FK_Node, true);
                return;
            }

            BP.WF.Node nd    = new BP.WF.Node(this.FK_NodeInt);
            TurnTos    conds = new TurnTos();

            conds.Retrieve(TurnToAttr.FK_Node, this.FK_Node);

            TurnTo cond = new TurnTo();

            if (this.MyPK != null)
            {
                cond.MyPK = this.MyPK;
                cond.RetrieveFromDBSources();
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
            }
            if (this.FK_Attr != null)
            {
                cond.FK_Attr = this.FK_Attr;
            }

            this.Title = "节点完成后转向条件";
            this.Pub1.AddTable("align=center");
            this.Pub1.AddCaptionLeft("节点完成后转向条件" + nd.Name);
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("描述");
            this.Pub1.AddTREnd();

            // 属性/字段
            MapAttrs attrs  = new MapAttrs("ND" + this.FK_Node);
            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 ddl = new DDL();

            ddl.ID = "DDL_Attr";
            ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_Node_SelectedIndexChanged);
            ddl.SetSelectItem(cond.FK_Attr);
            if (attrNs.Count == 0)
            {
                BP.WF.Node tempND = new BP.WF.Node(cond.FK_Node);
                nd.CreateMap();
                this.Pub1.AddTR();
                this.Pub1.AddTD("");
                this.Pub1.AddTD("colspan=2", "节点没有找到合适的条件");
                this.Pub1.AddTREnd();
                return;
            }
            this.Pub1.AddTR();
            this.Pub1.AddTD("属性/字段");
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("请选择节点表单字段。");
            this.Pub1.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.Pub1.AddTR();
            this.Pub1.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    break;
                }
                break;

            default:
                break;
            }
            ddl.SetSelectItem(cond.FK_Operator.ToString());
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("操作符号");
            this.Pub1.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.Pub1.AddTR();
                this.Pub1.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.KeyOfEn);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD("");
                this.Pub1.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.Pub1.AddTR();
                this.Pub1.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD("");
                this.Pub1.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.Pub1.AddTR();
                    this.Pub1.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.Pub1.AddTD(ddl);
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                else
                {
                    this.Pub1.AddTR();
                    this.Pub1.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.Pub1.AddTD(tb);
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                break;
            }

            this.Pub1.AddTR();
            this.Pub1.AddTD("转向Url");
            TextBox mytb = new TextBox();

            mytb.ID      = "TB_TurnToUrl";
            mytb.Text    = cond.TurnToURL;
            mytb.Columns = 90;
            this.Pub1.AddTD("colspan=3", mytb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD class=TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保 存 ";
            btn.Click   += new EventHandler(btn_Save_Node_Click);
            this.Pub1.Add(btn);

            if (cond.IsExits == true)
            {
                Btn btnN = new Btn();
                btnN.ShowType = BP.Web.Controls.BtnType.Confirm;
                btnN.ID       = "Btn_Del";
                btnN.Text     = " 删 除 ";
                btnN.Click   += new EventHandler(btn_Del_Node_Click);
                this.Pub1.Add(btnN);
            }

            this.Pub1.AddBR();
            this.Pub1.AddBR("提示:Url中除系统的参数(FromFlow,FromNode,SID,WebUser.No)外,您还可以增加约定的变量。");
            this.Pub1.AddBR("&nbsp;&nbsp;&nbsp;例如: ../EIP/aaa.aspx?Jiner=@jiner,@jiner为表单字段");
            this.Pub1.AddBR("&nbsp;&nbsp;&nbsp;系统处理后的转向url为: <br>../EIP/aaa.aspx?Jiner=123&UserNo=abc&SID=xxxx&FromFlow=010&FromNode=108。");

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

            if (conds.Count > 0)
            {
                this.Pub1.AddTable();
                this.Pub1.AddCaption("方向条件列表");

                this.Pub1.AddTR();
                this.Pub1.AddTDTitle("IDX");
                this.Pub1.AddTDTitle("属性键");
                this.Pub1.AddTDTitle("名称");
                this.Pub1.AddTDTitle("操作符号");
                this.Pub1.AddTDTitle("值");
                this.Pub1.AddTDTitle("值描述");
                this.Pub1.AddTDTitle("Url");
                this.Pub1.AddTDTitle("编辑");
                this.Pub1.AddTDTitle("删除");
                this.Pub1.AddTREnd();

                int idx = 0;
                foreach (TurnTo tt in conds)
                {
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(tt.AttrKey);
                    this.Pub1.AddTD(tt.AttrT);

                    this.Pub1.AddTD(tt.FK_Operator);
                    this.Pub1.AddTD(tt.OperatorValueStr);
                    this.Pub1.AddTD(tt.OperatorValueT);
                    this.Pub1.AddTDBigDoc(tt.TurnToURL);

                    this.Pub1.AddTDA("TurnTo.aspx?MyPK=" + tt.MyPK + "&FK_Node=" + tt.FK_Node, "<img src='../Img/Btn/Edit.gif' />");
                    this.Pub1.AddTDA("TurnTo.aspx?MyPK=" + tt.MyPK + "&FK_Node=" + tt.FK_Node + "&DoType=Del", "<img src='../Img/Btn/Delete.gif' />");

                    this.Pub1.AddTREnd();
                }
                this.Pub1.AddTableEnd();
            }
        }
Ejemplo n.º 12
0
        public void BindEdit(MapData md, MapDtl dtl)
        {
            bool isItem = false;

            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("ID");
            this.Pub1.AddTDTitle("colspan=3", "基本设置");
            this.Pub1.AddTREnd();

            int idx = 1;

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("表英文名称");
            TB tb = new TB();

            tb.ID   = "TB_No";
            tb.Text = dtl.No;
            if (this.DoType == "Edit")
            {
                tb.Enabled = false;
            }

            tb.Columns = 40;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("表中文名称");
            tb         = new TB();
            tb.ID      = "TB_Name";
            tb.Text    = dtl.Name;
            tb.Columns = 40;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("物理表名");
            tb         = new TB();
            tb.ID      = "TB_PTable";
            tb.Text    = dtl.PTable;
            tb.Columns = 40;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            DDL ddl = new DDL();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("工作模式");
            DDL workModelDDl = new DDL();

            workModelDDl.BindSysEnum(MapDtlAttr.Model, (int)dtl.DtlModel);
            workModelDDl.ID = "DDL_Model";
            this.Pub1.AddTD(workModelDDl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();


            if (dtl.DtlModel == DtlModel.FixRow)
            {
                tb         = new TB();
                tb.ID      = "TB_" + MapDtlAttr.ImpFixTreeSql;
                tb.Text    = dtl.ImpFixTreeSql;
                tb.Columns = 80;

                isItem = this.Pub1.AddTR(isItem);
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("树形结构数据源");
                this.Pub1.AddTD("colspan=2", tb);
                this.Pub1.AddTREnd();

                tb         = new TB();
                tb.ID      = "TB_" + MapDtlAttr.ImpFixDataSql;
                tb.Text    = dtl.ImpFixDataSql;
                tb.Columns = 80;

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("明细表数据源");
                this.Pub1.AddTD("colspan=2", tb);
                this.Pub1.AddTREnd();
            }

            #region 权限控制.
            CheckBox cb = new CheckBox();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb.ID      = "CB_IsView";
            cb.Text    = "是否可见";
            cb.Checked = dtl.IsView;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsUpdate";
            cb.Text    = "是否可以修改行"; // "是否可以修改行";
            cb.Checked = dtl.IsUpdate;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsInsert";
            cb.Text    = "是否可以新增行"; // "是否可以新增行";
            cb.Checked = dtl.IsInsert;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsDelete";
            cb.Text    = "是否可以删除行"; // "是否可以删除行";
            cb.Checked = dtl.IsDelete;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsShowIdx";
            cb.Text    = "是否显示序号列"; //"是否显示序号列";
            cb.Checked = dtl.IsShowIdx;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsShowSum";
            cb.Text    = "是否合计行";// "是否合计行";
            cb.Checked = dtl.IsShowSum;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsEnableAthM";
            cb.Text    = "是否启用多附件";
            cb.Checked = dtl.IsEnableAthM;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableM2M;
            cb.Text    = "是否启用一对多";
            cb.Checked = dtl.IsEnableM2M;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableM2MM;
            cb.Text    = "是否启用一对多多";
            cb.Checked = dtl.IsEnableM2MM;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsRowLock;
            cb.Text    = "是否启用锁定行(如果启用就需要增加IsRowLock一个隐藏的列,默认值为0。)?";// "是否合计行";
            cb.Checked = dtl.IsRowLock;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsShowTitle;
            cb.Text    = "是否显示标头(如果是多表表头的明细表,就不要显示表头了)?";;
            cb.Checked = dtl.IsShowTitle;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();
            #endregion 权限控制.


            //this.Pub1.AddTR();
            //this.Pub1.AddTDIdx(idx++);
            //cb = new CheckBox();
            //cb.ID = "CB_IsShowTitle";
            //cb.Text = "是否显示标头";// "是否显示标头";
            //cb.Checked = dtl.IsShowTitle;
            //this.Pub1.AddTD(cb);
            //this.Pub1.AddTREnd();


            //cb = new CheckBox();
            //cb.ID = "CB_IsEnableAth";
            //cb.Text = "是否启用单附件";
            //cb.Checked = dtl.IsEnablePass;
            //this.Pub1.AddTD(cb);
            //this.Pub1.AddTREnd();


            //为精英修改.
            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("增加记录方式");
            ddl    = new DDL();
            ddl.ID = "DDL_DtlAddRecModel";
            ddl.BindSysEnum(MapDtlAttr.DtlAddRecModel, (int)dtl.DtlAddRecModel);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("满足不同的用户习惯");
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("初始化行数");
            tb    = new TB();
            tb.ID = "TB_RowsOfList";
            tb.Attributes["class"] = "TBNum";
            tb.TextExtInt          = dtl.RowsOfList;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();


            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示格式");
            ddl    = new DDL();
            ddl.ID = "DDL_DtlShowModel";
            ddl.BindSysEnum(MapDtlAttr.DtlShowModel, (int)dtl.HisDtlShowModel);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("越出处理");
            ddl    = new DDL();
            ddl.ID = "DDL_WhenOverSize";
            ddl.BindSysEnum(MapDtlAttr.WhenOverSize, (int)dtl.HisWhenOverSize);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            isItem = this.Pub1.AddTR(isItem);
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("存盘方式");
            ddl    = new DDL();
            ddl.ID = "DDL_DtlSaveModel";
            ddl.BindSysEnum(MapDtlAttr.DtlSaveModel, (int)dtl.DtlSaveModel);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("用于设置在明细表自动存盘还是,手动存盘.");
            this.Pub1.AddTREnd();

            #region 与工作流相关设置.
            if (this.FK_Node != 0)
            {
                this.Pub1.AddTRSum();
                this.Pub1.AddTDTitle("colspan=4", "与工作流相关设置");
                this.Pub1.AddTREnd();

                this.Pub1.AddTR1();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("操作权限");
                ddl = new DDL();
                ddl.BindSysEnum(MapDtlAttr.DtlOpenType, (int)dtl.DtlOpenType);
                ddl.ID = "DDL_DtlOpenType";
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD();
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                cb         = new CheckBox();
                cb.ID      = "CB_IsEnablePass";
                cb.Text    = "是否起用审核字段?";// "是否合计行";
                cb.Checked = dtl.IsEnablePass;
                this.Pub1.AddTD(cb);

                //   string sql = "SELECT KeyOfEn as No, Name FROM Sys_MapAttr WHERE FK_MapData='" + dtl.No + "' AND  ((MyDataType in (1,4,6) and UIVisible=1 ) or (UIContralType=1))";

                string    sql = "SELECT KeyOfEn as No, Name FROM Sys_MapAttr WHERE FK_MapData='" + dtl.No + "'";
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count == 0)
                {
                    this.Pub1.AddTD();
                    this.Pub1.AddTD();
                }
                else
                {
                    this.Pub1.AddTDBegin("colspan=2");
                    cb         = new CheckBox();
                    cb.ID      = "CB_IsEnableGroupField";
                    cb.Text    = "是否起用分组字段?";// "是否合计行";
                    cb.Checked = dtl.IsEnableGroupField;
                    this.Pub1.Add(cb);

                    ddl    = new DDL();
                    ddl.ID = "DDL_GroupField";
                    ddl.BindSQL(sql, "No", "Name", dtl.GroupField);
                    this.Pub1.Add(ddl);
                    this.Pub1.AddTDEnd();
                }
                this.Pub1.AddTREnd();


                this.Pub1.AddTR1();
                this.Pub1.AddTDIdx(idx++);
                cb         = new CheckBox();
                cb.ID      = "CB_IsCopyNDData";
                cb.Text    = "是允许从上一个节点Copy数据";
                cb.Checked = dtl.IsCopyNDData;
                this.Pub1.AddTD("colspan=3", cb);
                this.Pub1.AddTREnd();


                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                cb         = new CheckBox();
                cb.ID      = "CB_IsHLDtl";
                cb.Text    = "是否是合流汇总从表(当前节点是合流节点有效)";
                cb.Checked = dtl.IsHLDtl;
                this.Pub1.AddTD("colspan=3", cb);
                this.Pub1.AddTREnd();


                #region 与分流点发送到子线程,处理子线程处理人相关的设置. for yangtai .
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                cb         = new CheckBox();
                cb.ID      = "CB_IsFLDtl";
                cb.Text    = "是否是分流点从表(当前节点是分流节点有效)";
                cb.Checked = dtl.IsFLDtl;
                this.Pub1.AddTD("colspan=3", cb);
                this.Pub1.AddTREnd();

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("子线程处理人字段");
                sql = "SELECT KeyOfEn as No, Name FROM Sys_MapAttr WHERE FK_MapData='" + dtl.No + "' AND  ( (MyDataType =1 and UIVisible=1 ) or (UIContralType=1))";
                dt  = DBAccess.RunSQLReturnTable(sql);

                ddl    = new DDL();
                ddl.ID = "DDL_SubThreadWorker";
                ddl.BindSQL(sql, "No", "Name", dtl.SubThreadWorker);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("子线程批次号字段");
                DataRow dr = dt.NewRow();
                dr[0] = "";
                dr[1] = "无";
                dt.Rows.Add(dr);

                ddl    = new DDL();
                ddl.ID = "DDL_SubThreadGroupMark";
                ddl.BindSQL(sql, "No", "Name", dtl.SubThreadGroupMark);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();
            }
            #endregion 与分流点发送到子线程,处理子线程处理人相关的设置. for yangtai .


            #endregion 与工作流相关设置.

            #region 明细表的数据导入导出.
            this.Pub1.AddTRSum();
            this.Pub1.AddTDTitle("colspan=4", "数据导入导出");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsExp";
            cb.Text    = "是否可以导出?";// "是否可以导出";
            cb.Checked = dtl.IsExp;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsImp";
            cb.Text    = "是否可以导入?";// "是否可以导出";
            cb.Checked = dtl.IsImp;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableSelectImp;
            cb.Text    = "是否启用选择性导入(如果true就要配置数据源呈现的sql)?";
            cb.Checked = dtl.IsEnableSelectImp;
            this.Pub1.AddTD("colspan=3", cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("初始化SQL");
            tb         = new TB();
            tb.ID      = "TB_" + MapDtlAttr.ImpSQLInit;
            tb.Text    = dtl.ImpSQLInit;
            tb.Columns = 80;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("查询SQL");
            tb         = new TB();
            tb.ID      = "TB_" + MapDtlAttr.ImpSQLSearch;
            tb.Text    = dtl.ImpSQLSearch;
            tb.Columns = 80;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("填充SQL");
            tb         = new TB();
            tb.ID      = "TB_" + MapDtlAttr.ImpSQLFull;
            tb.Text    = dtl.ImpSQLFull;
            tb.Columns = 80;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            #endregion 明细表的数据导入导出.

            #region 超连接.
            this.Pub1.AddTRSum();
            this.Pub1.AddTDTitle("colspan=4", "表格右边列超连接配置");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableLink;
            cb.Text    = "是否启用超连接?";
            cb.Checked = dtl.IsEnableLink;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("超连接标签");

            tb      = new TB();
            tb.ID   = "TB_" + MapDtlAttr.LinkLabel;
            tb.Text = dtl.LinkLabel;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("colspan=3", "连接URL");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            tb         = new TB();
            tb.ID      = "TB_" + MapDtlAttr.LinkUrl;
            tb.Text    = dtl.LinkUrl;
            tb.Columns = 90;
            this.Pub1.AddTD("colspan=3", tb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("连接目标");
            tb      = new TB();
            tb.ID   = "TB_" + MapDtlAttr.LinkTarget;
            tb.Text = dtl.LinkTarget;
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();
            #endregion 超连接.

            GroupFields gfs = new GroupFields(md.No);
            if (gfs.Count > 1)
            {
                this.Pub1.AddTR1();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("显示在分组");
                ddl    = new DDL();
                ddl.ID = "DDL_GroupID";
                ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, AddAllLocation.None);
                ddl.SetSelectItem(dtl.GroupID);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTREnd();
            }
            if (gfs.Count > 1)
            {
                this.Pub1.AddTR();
            }
            else
            {
                this.Pub1.AddTR1();
            }

            this.Pub1.AddTRSum();
            this.Pub1.AddTD("");
            this.Pub1.AddTDBegin("colspan=3 align=center");

            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndClose";
            btn.CssClass = "Btn";
            btn.Text     = " 保存并关闭 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            if (this.FK_MapDtl != null)
            {
                //btn = new Button();
                //btn.ID = "Btn_D";
                //btn.Text = this.ToE("DesignSheet", "设计表单"); // "设计表单";
                //btn.Click += new EventHandler(btn_Go_Click);
                //this.Pub1.Add(btn);

                btn          = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";
                btn.Text     = "删除"; // "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.Add(btn);


                btn          = new Button();
                btn.ID       = "Btn_New";
                btn.CssClass = "Btn";
                btn.Text     = "新建"; // "删除";
                btn.Click   += new EventHandler(btn_New_Click);
                this.Pub1.Add(btn);

                //btn = new Button();
                //btn.ID = "Btn_MapExt";
                //btn.CssClass = "Btn";
                //btn.Text = "扩展设置"; // "删除";
                //btn.Click += new EventHandler(btn_MapExt_Click);
                //this.Pub1.Add(btn);

                if (dtl.IsEnableAthM)
                {
                    btn          = new Button();
                    btn.CssClass = "Btn";
                    btn.ID       = "Btn_IsEnableAthM";
                    btn.Text     = "附件属性"; // "删除";
                    btn.Click   += new EventHandler(btn_MapAth_Click);
                    this.Pub1.Add(btn);
                }

                // btn = new Button();
                // btn.ID = "Btn_DtlTR";
                // btn.Text = "多表头";
                // btn.Attributes["onclick"] = "javascript:WinOpen('')";
                //// btn.Click += new EventHandler(btn_DtlTR_Click);
                // this.Pub1.Add(btn);
            }
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Ejemplo n.º 13
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            BP.WF.Cond cond = new Cond();
            cond.MyPK = this.MyPK;
            if (cond.RetrieveFromDBSources() == 0)
            {
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
                if (this.FK_MainNode != 0)
                {
                    cond.NodeID = this.FK_MainNode;
                }
                if (this.FK_Node != 0)
                {
                    cond.FK_Node = this.FK_Node;
                }
                if (this.FK_Flow != null)
                {
                    cond.FK_Flow = this.FK_Flow;
                }
            }
            this.AddTable("border=0 widht='500px'");
            //this.AddCaptionLeft("");
            this.AddTR();
            this.AddTDTitle("项目");
            this.AddTDTitle("采集");
            this.AddTDTitle("描述");
            this.AddTREnd();

            this.AddTR();
            this.AddTD("节点");
            Nodes nds  = new Nodes(cond.FK_Flow);
            Nodes ndsN = new Nodes();

            foreach (BP.WF.Node mynd in nds)
            {
                ndsN.AddEntity(mynd);
            }
            DDL ddl = new DDL();

            ddl.ID = "DDL_Node";
            ddl.BindEntities(ndsN, "NodeID", "Name");
            ddl.SetSelectItem(cond.FK_Node);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.AddTD(ddl);
            this.AddTD("节点");
            this.AddTREnd();

            // 属性/字段
            MapAttrs attrs = new MapAttrs();

            attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + ddl.SelectedItemStringVal);

            MapAttrs attrNs = new MapAttrs();

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

                switch (attr.KeyOfEn)
                {
                case "Title":
                //case "RDT":
                //case "CDT":
                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_Attr";
            if (attrNs.Count == 0)
            {
                BP.WF.Node nd = new BP.WF.Node(cond.FK_Node);
                nd.RepareMap();
                this.AddTR();
                this.AddTD("");
                this.AddTD("colspan=2", "节点没有找到合适的条件");
                this.AddTREnd();
                this.AddTableEnd();
                return;
            }
            else
            {
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
                ddl.SetSelectItem(cond.FK_Attr);
            }

            this.AddTR();
            this.AddTD("属性/字段");
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.AddTR();
            this.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                ddl.Items.Add(new ListItem("<>", "<>"));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;
                }
                break;

            default:
                break;
            }

            if (cond != null)
            {
                try
                {
                    ddl.SetSelectItem(cond.OperatorValueInt);
                }
                catch
                {
                }
            }
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.AddTR();
                this.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.UIBindKey);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.AddTR();
                this.AddTD("值");

                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.AddTR();
                    this.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.AddTD(ddl);
                    this.AddTD();
                    this.AddTREnd();
                }
                else
                {
                    this.AddTR();
                    this.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.AddTD(tb);
                    this.AddTD();
                    this.AddTREnd();
                }
                break;
            }


            Conds       conds = new Conds();
            QueryObject qo    = new QueryObject(conds);

            qo.AddWhere(CondAttr.NodeID, this.FK_MainNode);
            qo.addAnd();
            qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.Form);
            qo.addAnd();
            qo.AddWhere(CondAttr.CondType, (int)this.HisCondType);

            if (this.ToNodeID != 0)
            {
                qo.addAnd();
                qo.AddWhere(CondAttr.ToNodeID, this.ToNodeID);
            }
            int num = qo.DoQuery();


            this.AddTRSum();
            this.Add("<TD class=TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " Save ";

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

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "Clear";
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);

            this.Add(btn);

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

            this.AddTableEnd();

            if (num == 0)
            {
                return;
            }


            #region 条件
            this.AddTable("border=0 widht='500px'");
            this.AddCaptionLeft("说明:同时满足如下条件转向成立,只能删除不能编辑.");
            this.AddTR();
            this.AddTDTitle("IDX");
            this.AddTDTitle("节点");
            this.AddTDTitle("字段的英文名");
            this.AddTDTitle("字段的中文名");
            this.AddTDTitle("操作符");
            this.AddTDTitle("值");
            this.AddTDTitle("标签");
            this.AddTDTitle("操作");
            this.AddTREnd();

            int i = 0;
            foreach (Cond mync in conds)
            {
                if (mync.HisDataFrom != ConnDataFrom.Form)
                {
                    continue;
                }

                i++;

                this.AddTR();
                this.AddTDIdx(i);
                //  this.AddTD(mync.HisDataFrom.ToString());
                this.AddTD(mync.FK_NodeT);
                this.AddTD(mync.AttrKey);
                this.AddTD(mync.AttrName);

                this.AddTDCenter(mync.FK_Operator);
                this.AddTD(mync.OperatorValueStr);
                this.AddTD(mync.OperatorValueT);
                //if (num > 1)
                //    this.AddTD(mync.HisConnJudgeWayT);
                this.AddTD("<a href='Cond.aspx?MyPK=" + mync.MyPK + "&CondType=" + (int)this.HisCondType + "&FK_Flow=" + this.FK_Flow + "&FK_Attr=" + mync.FK_Attr + "&FK_MainNode=" + mync.NodeID + "&OperatorValue=" + mync.OperatorValueStr + "&FK_Node=" + mync.FK_Node + "&DoType=Del&ToNodeID=" + mync.ToNodeID + "' >删除</a>");
                this.AddTREnd();
            }
            this.AddTableEnd();
            #endregion
        }
Ejemplo n.º 14
0
        public void BindEdit(MapData md, MapDtl dtl)
        {
            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("从表属性");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("ID");
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("备注");
            this.Pub1.AddTREnd();

            int idx = 1;

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("表英文名称");
            TB tb = new TB();

            tb.ID   = "TB_No";
            tb.Text = dtl.No;
            if (this.DoType == "Edit")
            {
                tb.Enabled = false;
            }
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            //this.Pub1.AddTD("英文名称全局唯一");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("表中文名称");
            tb      = new TB();
            tb.ID   = "TB_Name";
            tb.Text = dtl.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("XX 从表");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("物理表名");
            tb      = new TB();
            tb.ID   = "TB_PTable";
            tb.Text = dtl.PTable;

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD();
            //this.Pub1.AddTD("存储数据的物理表名称");
            //  this.Pub1.AddTD("存储数据的物理表名称");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("操作权限");
            DDL ddl = new DDL();

            ddl.BindSysEnum(MapDtlAttr.DtlOpenType, (int)dtl.DtlOpenType);
            ddl.ID = "DDL_DtlOpenType";
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            // this.Pub1.AddTD("用于从表的权限控制");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            CheckBox cb = new CheckBox();

            cb.ID      = "CB_IsView";
            cb.Text    = "是否可见";
            cb.Checked = dtl.IsView;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsUpdate";
            cb.Text    = "是否可以修改行"; // "是否可以修改行";
            cb.Checked = dtl.IsUpdate;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsInsert";
            cb.Text    = "是否可以新增行"; // "是否可以新增行";
            cb.Checked = dtl.IsInsert;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsDelete";
            cb.Text    = "是否可以删除行"; // "是否可以删除行";
            cb.Checked = dtl.IsDelete;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsShowIdx";
            cb.Text    = "是否显示序号列"; //"是否显示序号列";
            cb.Checked = dtl.IsShowIdx;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsShowSum";
            cb.Text    = "是否合计行";// "是否合计行";
            cb.Checked = dtl.IsShowSum;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsShowTitle";
            cb.Text    = "是否显示标头";// "是否显示标头";
            cb.Checked = dtl.IsShowTitle;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsExp";
            cb.Text    = "是否可以导出?";// "是否可以导出";
            cb.Checked = dtl.IsShowTitle;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsImp";
            cb.Text    = "是否可以导入?";// "是否可以导出";
            cb.Checked = dtl.IsShowTitle;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsCopyNDData";
            cb.Text    = "是允许从上一个节点Copy数据";
            cb.Checked = dtl.IsCopyNDData;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_IsHLDtl";
            cb.Text    = "是否是合流汇总从表(当前节点是合流节点有效)";
            cb.Checked = dtl.IsHLDtl;
            this.Pub1.AddTD("colspan=2", cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsEnableAthM";
            cb.Text    = "是否启用多附件";
            cb.Checked = dtl.IsEnableAthM;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableM2M;
            cb.Text    = "是否启用一对多";
            cb.Checked = dtl.IsEnableM2M;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + MapDtlAttr.IsEnableM2MM;
            cb.Text    = "是否启用一对多多";
            cb.Checked = dtl.IsEnableM2MM;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            cb         = new CheckBox();
            cb.ID      = "CB_IsEnablePass";
            cb.Text    = "是否起用审核字段?";// "是否合计行";
            cb.Checked = dtl.IsEnablePass;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD();
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();


            //cb = new CheckBox();
            //cb.ID = "CB_IsEnableAth";
            //cb.Text = "是否启用单附件";
            //cb.Checked = dtl.IsEnablePass;
            //this.Pub1.AddTD(cb);
            //this.Pub1.AddTREnd();


            this.Pub1.AddTR1();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("初始化行数");
            tb    = new TB();
            tb.ID = "TB_RowsOfList";
            tb.Attributes["class"] = "TBNum";
            tb.TextExtInt          = dtl.RowsOfList;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("显示格式");
            ddl    = new DDL();
            ddl.ID = "DDL_DtlShowModel";
            ddl.BindSysEnum(MapDtlAttr.DtlShowModel, (int)dtl.HisDtlShowModel);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("越出处理");
            ddl    = new DDL();
            ddl.ID = "DDL_WhenOverSize";
            ddl.BindSysEnum(MapDtlAttr.WhenOverSize, (int)dtl.HisWhenOverSize);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            GroupFields gfs = new GroupFields(md.No);

            if (gfs.Count > 1)
            {
                this.Pub1.AddTR1();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("显示在分组");
                ddl    = new DDL();
                ddl.ID = "DDL_GroupField";
                ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, AddAllLocation.None);
                ddl.SetSelectItem(dtl.GroupID);
                this.Pub1.AddTD("colspan=2", ddl);
                this.Pub1.AddTREnd();
            }
            if (gfs.Count > 1)
            {
                this.Pub1.AddTR();
            }
            else
            {
                this.Pub1.AddTR1();
            }

            this.Pub1.AddTRSum();
            this.Pub1.AddTD("");
            this.Pub1.AddTDBegin("colspan=3 align=center");

            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保存 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_SaveAndClose";
            btn.CssClass = "Btn";
            btn.Text     = " 保存并关闭 ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            if (this.FK_MapDtl != null)
            {
                //btn = new Button();
                //btn.ID = "Btn_D";
                //btn.Text = this.ToE("DesignSheet", "设计表单"); // "设计表单";
                //btn.Click += new EventHandler(btn_Go_Click);
                //this.Pub1.Add(btn);

                btn          = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";
                btn.Text     = "删除"; // "删除";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.Add(btn);


                btn          = new Button();
                btn.ID       = "Btn_New";
                btn.CssClass = "Btn";
                btn.Text     = "新建"; // "删除";
                btn.Click   += new EventHandler(btn_New_Click);
                this.Pub1.Add(btn);

                btn          = new Button();
                btn.ID       = "Btn_MapExt";
                btn.CssClass = "Btn";
                btn.Text     = "扩展设置"; // "删除";

                btn.Click += new EventHandler(btn_MapExt_Click);
                this.Pub1.Add(btn);

                if (dtl.IsEnableAthM)
                {
                    btn          = new Button();
                    btn.CssClass = "Btn";
                    btn.ID       = "Btn_IsEnableAthM";
                    btn.Text     = "附件属性"; // "删除";
                    btn.Click   += new EventHandler(btn_MapAth_Click);
                    this.Pub1.Add(btn);
                }

                // btn = new Button();
                // btn.ID = "Btn_DtlTR";
                // btn.Text = "多表头";
                // btn.Attributes["onclick"] = "javascript:WinOpen('')";
                //// btn.Click += new EventHandler(btn_DtlTR_Click);
                // this.Pub1.Add(btn);
            }
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Ejemplo n.º 15
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            Cond cond = new Cond();

            cond.MyPK = this.MyPK;
            if (cond.RetrieveFromDBSources() == 0)
            {
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
                if (this.FK_MainNode != 0)
                {
                    cond.NodeID = this.FK_MainNode;
                }
                if (this.FK_Node != 0)
                {
                    cond.FK_Node = this.FK_Node;
                }
                if (this.FK_Flow != null)
                {
                    cond.FK_Flow = this.FK_Flow;
                }
            }
            //this.AddTable("border=0 widht='500px'");
            this.AddTable("class='Table' cellpadding='2' cellspacing='2' style='width:100%;'");
            this.AddTR();
            this.AddTD("class='GroupTitle' style='width:80px'", "项目");
            this.AddTD("class='GroupTitle' style='width:200px'", "采集");
            this.AddTD("class='GroupTitle'", "描述");
            this.AddTREnd();

            this.AddTR();
            this.AddTD("节点");
            Nodes nds  = new Nodes(cond.FK_Flow);
            Nodes ndsN = new Nodes();

            foreach (BP.WF.Node mynd in nds)
            {
                ndsN.AddEntity(mynd);
            }
            DDL ddl = new DDL();

            ddl.ID = "DDL_Node";
            ddl.BindEntities(ndsN, "NodeID", "Name");
            ddl.SetSelectItem(cond.FK_Node);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.AddTD(ddl);
            this.AddTD("节点");
            this.AddTREnd();

            // 属性/字段
            MapAttrs attrs = new MapAttrs();

            attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + ddl.SelectedItemStringVal);

            MapAttrs attrNs = new MapAttrs();

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

                switch (attr.KeyOfEn)
                {
                case "Title":
                //case "RDT":
                //case "CDT":
                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_Attr";
            if (attrNs.Count == 0)
            {
                BP.WF.Node nd = new BP.WF.Node(cond.FK_Node);
                nd.RepareMap();
                this.AddTR();
                this.AddTD("");
                this.AddTD("colspan=2", "节点没有找到合适的条件");
                this.AddTREnd();
                this.AddTableEnd();
                return;
            }
            else
            {
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
                ddl.SetSelectItem(cond.FK_Attr);
            }

            this.AddTR();
            this.AddTD("属性/字段");
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.AddTR();
            this.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                ddl.Items.Add(new ListItem("<>", "<>"));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;
                }
                break;

            default:
                break;
            }

            if (cond != null)
            {
                try
                {
                    ddl.SetSelectItem(cond.OperatorValueInt);
                }
                catch
                {
                }
            }
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.AddTR();
                this.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.UIBindKey);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.AddTR();
                this.AddTD("值");

                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.AddTR();
                    this.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.AddTD(ddl);
                    this.AddTD();
                    this.AddTREnd();
                }
                else
                {
                    this.AddTR();
                    this.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.AddTD(tb);
                    this.AddTD();
                    this.AddTREnd();
                }
                break;
            }


            Conds       conds = new Conds();
            QueryObject qo    = new QueryObject(conds);

            qo.AddWhere(CondAttr.NodeID, this.FK_MainNode);
            qo.addAnd();
            qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.Form);
            qo.addAnd();
            qo.AddWhere(CondAttr.CondType, (int)this.HisCondType);

            if (this.ToNodeID != 0)
            {
                qo.addAnd();
                qo.AddWhere(CondAttr.ToNodeID, this.ToNodeID);
            }
            int num = qo.DoQuery();

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

            var btn = new LinkBtn(false, "Btn_SaveAnd", "保存为And条件");

            btn.SetDataOption("iconCls", "'icon-save'");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);
            this.AddSpace(1);

            btn = new LinkBtn(false, "Btn_SaveOr", "保存为Or条件");
            btn.SetDataOption("iconCls", "'icon-save'");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);
            this.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);

            this.AddBR();
            this.AddBR();

            if (num == 0)
            {
                return;
            }

            #region 条件
            this.AddTable("class='Table' cellpadding='2' cellspacing='2' style='width:100%;'");
            this.AddTR();
            this.AddTDTitleGroup("序");
            this.AddTDTitleGroup("节点");
            this.AddTDTitleGroup("字段的英文名");
            this.AddTDTitleGroup("字段的中文名");
            this.AddTDTitleGroup("操作符");
            this.AddTDTitleGroup("值");
            this.AddTDTitleGroup("标签");
            this.AddTDTitleGroup("运算关系");
            this.AddTDTitleGroup("操作");
            this.AddTREnd();

            int i = 0;
            foreach (Cond mync in conds)
            {
                if (mync.HisDataFrom != ConnDataFrom.Form)
                {
                    continue;
                }

                i++;

                this.AddTR();
                this.AddTDIdx(i);
                //  this.AddTD(mync.HisDataFrom.ToString());
                this.AddTD(mync.FK_NodeT);
                this.AddTD(mync.AttrKey);
                this.AddTD(mync.AttrName);
                this.AddTDCenter(mync.FK_Operator);
                this.AddTD(mync.OperatorValueStr);
                this.AddTD(mync.OperatorValueT);

                if (mync.CondOrAnd == CondOrAnd.ByAnd)
                {
                    this.AddTD("AND");
                }
                else
                {
                    this.AddTD("OR");
                }

                //if (num > 1)
                //    this.AddTD(mync.HisConnJudgeWayT);
                this.AddTD("<a href='Cond.aspx?MyPK=" + mync.MyPK + "&CondType=" + (int)this.HisCondType + "&FK_Flow=" + this.FK_Flow + "&FK_Attr=" + mync.FK_Attr + "&FK_MainNode=" + mync.NodeID + "&OperatorValue=" + mync.OperatorValueStr + "&FK_Node=" + mync.FK_Node + "&DoType=Del&ToNodeID=" + mync.ToNodeID + "' class='easyui-linkbutton' data-options=\"iconCls:'icon-remove'\" onclick=\"return confirm('确定删除此条件吗?')\">删除</a>");
                this.AddTREnd();
            }
            this.AddTableEnd();
            this.AddBR();

            AddEasyUiPanelInfo("说明", "在上面的条件集合中ccflow仅仅支持要么是And,要么是OR的两种情形,高级的开发就需要事件来支持条件转向,或者采用其他的方式。");

            #endregion
        }
Ejemplo n.º 16
0
        public void DoNew(BillTemplate bill)
        {
            this.Ucsys1.Clear();
            BP.WF.Node nd = new BP.WF.Node(this.NodeID);
            this.Ucsys1.AddTable();
            this.Ucsys1.AddCaptionLeft("<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "' >" + "返回" + "</a> - <a href=Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=New ><img  border=0 src='../Img/Btn/New.gif' />新建</a>");
            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("项目");
            this.Ucsys1.AddTDTitle("输入");
            this.Ucsys1.AddTDTitle("备注");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("单据类型"); // 单据/单据名称
            DDL ddl = new DDL();

            ddl.ID = "DDL_BillType";

            BP.WF.Data.BillTypes ens = new BillTypes();
            ens.RetrieveAllFromDBSource();

            if (ens.Count == 0)
            {
                BP.WF.Data.BillType enB = new BillType();
                enB.Name    = "新建类型" + "1";
                enB.FK_Flow = this.FK_Flow;
                enB.No      = "01";
                enB.Insert();
                ens.AddEntity(enB);
            }

            ddl.BindEntities(ens);
            ddl.SetSelectItem(bill.FK_BillType);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("<a href='Bill.aspx?FK_Flow=" + this.FK_Flow + "&NodeID=" + this.NodeID + "&DoType=EditType'><img src='../Img/Btn/Edit.gif' border=0/>类别维护</a>");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("编号");
            TB tb = new TB();

            tb.ID      = "TB_No";
            tb.Text    = bill.No;
            tb.Enabled = false;
            if (tb.Text == "")
            {
                tb.Text = "系统自动生成";
            }

            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTD("");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("名称"); // 单据/单据名称
            tb         = new TB();
            tb.ID      = "TB_Name";
            tb.Text    = bill.Name;
            tb.Columns = 40;
            this.Ucsys1.AddTD("colspan=2", tb);
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("生成的文件类型"); // 单据/单据名称
            ddl    = new DDL();
            ddl.ID = "DDL_BillFileType";
            ddl.BindSysEnum("BillFileType");
            ddl.SetSelectItem((int)bill.HisBillFileType);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("目前不支持excel,html格式.");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTD("单据模板");
            HtmlInputFile file = new HtmlInputFile();

            file.ID = "f";
            file.Attributes["width"] = "100%";
            this.Ucsys1.AddTD("colspan=2", file);
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTRSum();
            this.Ucsys1.Add("<TD class=TD colspan=3 align=center>");
            Button btn = new Button();

            btn.CssClass = "Btn";
            btn.ID       = "Btn_Save";
            btn.Text     = "保存";
            this.Ucsys1.Add(btn);
            btn.Click += new EventHandler(btn_Click);
            this.Ucsys1.Add(btn);
            if (bill.No.Length > 1)
            {
                btn          = new Button();
                btn.ID       = "Btn_Del";
                btn.CssClass = "Btn";
                btn.Text     = "删除"; // "删除单据";
                this.Ucsys1.Add(btn);
                btn.Attributes["onclick"] += " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Del_Click);
            }
            string url      = "";
            string fileType = "";

            if (bill.HisBillFileType == BillFileType.RuiLang)
            {
                fileType = "grf";
            }
            else
            {
                fileType = "rtf";
            }

            if (this.RefNo != null)
            {
                url = "<a href='../../DataUser/CyclostyleFile/" + bill.Url + "." + fileType + "'><img src='../Img/Btn/save.gif' border=0/> 模板下载</a>";
            }

            this.Ucsys1.Add(url + "</TD>");
            this.Ucsys1.AddTREnd();

            this.Ucsys1.AddTable();
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GloVar gvar = new GloVar();

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

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

            GenerateCheckedInfo();

            switch (Step)
            {
            case 1:

                #region 设置组织结构模式

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

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

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

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

                break;

            case 2:

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

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

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

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

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

                break;

            case 3:

                #region  择组织结构来源

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

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

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

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

                break;

            case 4:

                #region 配置查询语句

                string msg = string.Empty;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                break;
            }
        }