コード例 #1
0
        public void AddSFTable()
        {
            this.Title = "增加新字段向导";

            this.Pub1.AddTable();
            this.Pub1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'>增加新字段向导</a> - 增加外键字段 - <a href='SFTable.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' > 新建表</a>");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("编号(点击增加到表单)");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("类别");
            this.Pub1.AddTDTitle("描述/编辑");
            this.Pub1.AddTDTitle("编辑数据");
            this.Pub1.AddTREnd();

            BP.Sys.SFTables ens = new SFTables();
            QueryObject     qo  = new QueryObject(ens);

            this.Pub2.BindPageIdx(qo.GetCount(), pageSize, this.PageIdx,
                                  "Do.aspx?DoType=AddSFTable&MyPK=" + this.MyPK + "&Idx=&GroupField");
            qo.DoQuery("No", pageSize, this.PageIdx);

            bool is1 = false;
            int  Idx = 0;

            foreach (BP.Sys.SFTable sem in ens)
            {
                Idx++;
                //is1 = this.Pub1.AddTR(is1);
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(Idx);
                this.Pub1.AddTD("<a  href=\"javascript:AddSFTable('" + this.MyPK + "','" + this.Idx + "','" + sem.No + "')\" >" + sem.No + "</a>");
                this.Pub1.AddTD(sem.Name);

                if (sem.IsClass)
                {
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('../Comm/Search.aspx?EnsName=" + sem.No + "','sg')\"  ><img src='../Img/Btn/Edit.gif' border=0/>" + sem.TableDesc + "</a>");
                }
                else
                {
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('SFTable.aspx?DoType=Edit&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&RefNo=" + sem.No + "','sg')\"  ><img src='../Img/Btn/Edit.gif' border=0/>" + sem.TableDesc + "</a>");
                }

                if (sem.No.Contains("."))
                {
                    this.Pub1.AddTD("&nbsp;");
                }
                else
                {
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('SFTableEditData.aspx?RefNo=" + sem.No + "');\" >编辑</a>");
                }
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
コード例 #2
0
        void btn_Click(object sender, EventArgs e)
        {
            GEEntitys rpts = (GEEntitys)BP.DA.ClassFactory.GetEns(this.EnsName);
            GEEntity  rpt  = (GEEntity)rpts.GetNewEntity;
            Flow      fl   = new Flow(this.FK_Flow);

            Button btn = (Button)sender;

            if (btn.ID == "Btn_Excel")
            {
                QueryObject qo = new QueryObject(rpts);
                qo.AddWhere(WorkAttr.Rec, WebUser.No);
                qo.addAnd();
                if (BP.SystemConfig.AppCenterDBType == DBType.Access)
                {
                    qo.AddWhere("Mid(RDT,1,10) >='" + this.DT_F + "' AND Mid(RDT,1,10) <='" + this.DT_T + "' ");
                }
                else
                {
                    qo.AddWhere("" + BP.SystemConfig.AppCenterDBSubstringStr + "(RDT,1,10) >='" + this.DT_F + "' AND " + BP.SystemConfig.AppCenterDBSubstringStr + "(RDT,1,10) <='" + this.DT_T + "' ");
                }


                this.Pub2.BindPageIdx(qo.GetCount(), this.PageSize, this.PageIdx, "?FK_Flow=" + this.FK_Flow + "&EnsName=" + this.EnsName);

                qo.DoQuery();

                try
                {
                    //this.ExportDGToExcel(ens.ToDataTableDescField(), this.HisEn.EnDesc);
                    this.ExportDGToExcel(rpts.ToDataTableDesc(), fl.Name);
                }
                catch (Exception ex)
                {
                    try
                    {
                        this.ExportDGToExcel(rpts.ToDataTableDescField(), fl.Name);
                    }
                    catch
                    {
                        this.ToErrorPage("数据没有正确导出可能的原因之一是:系统管理员没正确的安装Excel组件,请通知他,参考安装说明书解决。@系统异常信息:" + ex.Message);
                    }
                }
                return;
            }

            this.Session["DF"] = this.Pub1.GetTextBoxByID("TB_F").Text;
            this.Session["DT"] = this.Pub1.GetTextBoxByID("TB_T").Text;
            this.Response.Redirect("FlowSearchMyWork.aspx?FK_Flow=" + this.FK_Flow + "&EnsName=" + this.EnsName, true);
        }
コード例 #3
0
        public void AddSFWS()
        {
            this.Title = "增加新WebService接口向导";

            this.Pub1.AddTable();
            this.Pub1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'><img src='/WF/Img/Btn/Back.gif' />&nbsp;返回</a> - WebService接口列表 - <a href='SFWS.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' >新建WebService接口</a>");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("编号(点击增加到表单)");
            this.Pub1.AddTDTitle("名称(点击名称编辑属性)");
            this.Pub1.AddTDTitle("编码表类型");
            this.Pub1.AddTDTitle("查看数据");
            this.Pub1.AddTREnd();

            BP.Sys.SFTables ens = new SFTables();
            QueryObject     qo  = new QueryObject(ens);

            qo.AddWhere(BP.Sys.SFTableAttr.SrcType, (int)SrcType.WebServices);
            this.Pub2.BindPageIdx(qo.GetCount(), pageSize, this.PageIdx,
                                  "Do.aspx?DoType=AddSFWS&MyPK=" + this.MyPK + "&Idx=&GroupField");
            qo.DoQuery("No", pageSize, this.PageIdx);
            if (ens.Count == 0)
            {
                //string html = "<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'><img src='/WF/Img/Btn/Back.gif' />&nbsp;返回</a> - 增加外键字段 - <a href='SFTable.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' >新建表</a>";
                this.Pub1.AddTR();
                this.Pub1.AddTDBigDoc("colspan=5", "注册到ccform的WebService接口为空,点击上面的新建表,进入创建向导。");
                this.Pub1.AddTREnd();
                this.Pub1.AddTableEnd();
                return;
            }

            bool is1 = false;
            int  idx = 0;

            foreach (BP.Sys.SFTable sem in ens)
            {
                idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD(sem.No);
                this.Pub1.AddTD("<a href=\"javascript:WinOpen('SFWS.aspx?DoType=Edit&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&RefNo=" + sem.No + "','sg')\"  ><img src='../Img/Btn/Edit.gif' border=0/>" + sem.Name + "</a>");

                this.Pub1.AddTD(sem.CodeStructT); //编码表类型.
                this.Pub1.AddTD("<a href=\"javascript:WinOpen('SFTableEditData.aspx?RefNo=" + sem.No + "');\" >查看</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
コード例 #4
0
        public void AddFEnum()
        {
            this.Title = "增加新字段向导";
            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'>增加新字段向导</a> - <a href='SysEnum.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' ><img src='../Img/Btn/New.gif' />新建枚举</a>");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("编号(点击增加到表单)");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTDTitle();
            this.Pub1.AddTREnd();

            BP.Sys.SysEnumMains sems = new SysEnumMains();
            QueryObject         qo   = new QueryObject(sems);

            this.Pub2.BindPageIdx(qo.GetCount(), pageSize, this.PageIdx, "Do.aspx?DoType=AddSysEnum&MyPK=" + this.MyPK + "&Idx=&GroupField");
            qo.DoQuery("No", pageSize, this.PageIdx);

            bool is1 = false;
            int  Idx = 0;

            foreach (BP.Sys.SysEnumMain sem in sems)
            {
                BP.Web.Controls.DDL ddl = null;
                try
                {
                    ddl = new BP.Web.Controls.DDL();
                    ddl.BindSysEnum(sem.No);
                }
                catch
                {
                    sem.Delete();
                }
                Idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(Idx);
                this.Pub1.AddTD("<a  href=\"javascript:AddEnum('" + this.MyPK + "','" + this.Idx + "','" + sem.No + "')\" >" + sem.No + "</a>");
                this.Pub1.AddTD(sem.Name);
                this.Pub1.AddTD("[<a href='SysEnum.aspx?DoType=Edit&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&RefNo=" + sem.No + "' >编辑</a>]");
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
コード例 #5
0
        /// <summary>
        /// 获取ens数据
        /// </summary>
        /// <returns></returns>
        private string GetEnsGridData()
        {
            Entity   en  = GetEntityByEnName(EnsName);
            Entities ens = en.GetNewEntities;

            //string GetDelOid=getUTF8ToString("GetDelOid");
            //if (!string.IsNullOrEmpty(GetDelOid))
            //{
            //    en.Delete(en.PKField, GetDelOid);
            //}


            //总行数
            int RowCount = 0;

            try
            {
                //当前页
                string pageNumber  = getUTF8ToString("pageNumber");
                int    iPageNumber = string.IsNullOrEmpty(pageNumber) ? 1 : Convert.ToInt32(pageNumber);
                //每页多少行
                string pageSize  = getUTF8ToString("pageSize");
                int    iPageSize = string.IsNullOrEmpty(pageSize) ? 9999 : Convert.ToInt32(pageSize);

                QueryObject obj = new QueryObject(ens);
                obj      = this.ToolBar1.GetnQueryObject(ens, en);
                RowCount = obj.GetCount();
                //查询
                obj.DoQuery(en.PK, iPageSize, iPageNumber);

                return(Entitis2Json.ConvertEntitis2GridJsonAndData(ens, RowCount));
            }
            catch
            {
                try
                {
                    en.CheckPhysicsTable();
                }
                catch (Exception wx)
                {
                    BP.DA.Log.DefaultLogWriteLineError(wx.Message);
                }
            }
            return("{[]}");
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //变量定义: 第几页.
            int currPageIdx = this.PageIdx;
            int pageSize    = 12; //页面记录条数.

            //实体查询.
            BP.WF.Nodes       ens = new BP.WF.Nodes();
            BP.En.QueryObject qo  = new QueryObject(ens);
            qo.AddWhere(BP.WF.Template.NodeAttr.NodePosType, "1"); // 设置查询条件.

            //把代码放到表格尾部, 形成 第1,2,3,4,5 页 .......
            this.Pub2.Clear();
            this.Pub2.BindPageIdx(qo.GetCount(),
                                  pageSize, currPageIdx, "DemoTurnPage.aspx?1=2&3=xx");

            //每页有15条数据,取第2页的数据.
            qo.DoQuery("NodeID", pageSize, currPageIdx);

            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序");
            this.Pub1.AddTDTitle("节点编号");
            this.Pub1.AddTDTitle("节点名称");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTREnd();

            int idx = 0;

            foreach (BP.WF.Node en in ens)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD(en.NodeID);
                this.Pub1.AddTD(en.Name);
                this.Pub1.AddTD("<a href='http://ccflow.org/case.aspx?ID=" + en.NodeID + "' >打开</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
コード例 #7
0
        void btn_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            if (btn.ID == "Btn_Excel")
            {
                Node        nd  = new Node(this.FK_Node);
                Works       wks = nd.HisWorks;
                QueryObject qo  = new QueryObject(wks);
                qo.AddWhere(WorkAttr.Rec, WebUser.No);
                qo.addAnd();
                qo.AddWhere(BP.Sys.SystemConfig.AppCenterDBSubstringStr + "(RDT,1,10) >='" + this.DT_F + "' AND " + BP.Sys.SystemConfig.AppCenterDBSubstringStr + "(RDT,1,10) <='" + this.DT_T + "' ");

                this.Pub2.BindPageIdx(qo.GetCount(), this.PageSize, this.PageIdx, "FlowSearch.aspx?FK_Node=" + this.FK_Node);
                qo.DoQuery();

                try
                {
                    //this.ExportDGToExcel(ens.ToDataTableDescField(), this.HisEn.EnDesc);
                    this.ExportDGToExcel(wks.ToDataTableDesc(), nd.Name);
                }
                catch (Exception ex)
                {
                    try
                    {
                        this.ExportDGToExcel(wks.ToDataTableDescField(), nd.Name);
                    }
                    catch (Exception ex1)
                    {
                        this.ToErrorPage("数据没有正确导出可能的原因之一是:系统管理员没正确的安装Excel组件,请通知他,参考安装说明书解决。@系统异常信息:" + ex.Message + ex1.Message);
                    }
                }
                return;
            }

            this.Session["DF"] = this.Pub1.GetTextBoxByID("TB_F").Text;
            this.Session["DT"] = this.Pub1.GetTextBoxByID("TB_T").Text;
            this.Response.Redirect("FlowSearch.aspx?FK_Node=" + this.FK_Node, true);
        }
コード例 #8
0
        /// <summary>
        /// 获取列表数据
        /// </summary>
        /// <returns></returns>
        private string GetEnsGridData()
        {
            int totalRows = 0;
            //配置的列名
            FrmReportFields rePortFields = new FrmReportFields();
            QueryObject     objFields    = new QueryObject(rePortFields);

            objFields.AddWhere(FrmReportFieldAttr.FK_MapData, this.FK_MapData);
            objFields.addOrderBy(FrmReportFieldAttr.Idx);
            objFields.DoQuery();
            if (rePortFields.Count == 0)
            {
                return("");
            }
            //实体列名
            Attrs mdAttrs = HisEns.GetNewEntity.EnMap.Attrs;
            //返回字符串
            StringBuilder append = new StringBuilder();

            append.Append("{");
            //整理列名
            append.Append("columns:[");
            foreach (FrmReportField field in rePortFields)
            {
                foreach (Attr mdAttr in mdAttrs)
                {
                    if (field.KeyOfEn == mdAttr.Key)
                    {
                        if (field.UIVisible == false)
                        {
                            append.Append("{");
                            append.Append(string.Format("field:'{0}',title:'{1}',width:{2},hidden: true", field.KeyOfEn + "Text", field.Name, field.UIWidth));
                            append.Append("},");
                            continue;
                        }
                        if (mdAttr.IsRefAttr || mdAttr.IsFK || mdAttr.IsEnum)
                        {
                            append.Append("{");
                            append.Append(string.Format("field:'{0}',title:'{1}',width:{2},sortable:true", field.KeyOfEn + "Text", field.Name, field.UIWidth));
                            append.Append("},");
                            continue;
                        }
                        append.Append("{");
                        append.Append(string.Format("field:'{0}',title:'{1}',width:{2},sortable:true", mdAttr.Key, field.Name, field.UIWidth));
                        append.Append("},");
                    }
                }
            }
            if (append.Length > 10)
            {
                append = append.Remove(append.Length - 1, 1);
            }
            append.Append("]");

            //整理数据
            bool bHaveData = false;

            append.Append(",data:{rows:[");

            //获取数据
            MapData md = new MapData();

            md.No = this.FK_MapData;
            if (md.RetrieveFromDBSources() > 0)
            {
                //当前页
                string pageNumber  = getUTF8ToString("pageNumber");
                int    iPageNumber = string.IsNullOrEmpty(pageNumber) ? 1 : Convert.ToInt32(pageNumber);
                //每页多少行
                string pageSize  = getUTF8ToString("pageSize");
                int    iPageSize = string.IsNullOrEmpty(pageSize) ? 9999 : Convert.ToInt32(pageSize);

                QueryObject obj = new QueryObject(HisEns);
                obj       = this.ToolBar1.GetnQueryObject(HisEns, HisEns.GetNewEntity);
                totalRows = obj.GetCount();
                //查询
                obj.DoQuery(HisEns.GetNewEntity.PK, iPageSize, iPageNumber);
                foreach (Entity en in HisEns)
                {
                    bHaveData = true;
                    append.Append("{");
                    foreach (Attr attr in mdAttrs)
                    {
                        if (attr.IsRefAttr || attr.IsFK || attr.IsEnum)
                        {
                            append.Append(attr.Key + "Text:'" + en.GetValRefTextByKey(attr.Key) + "',");
                            continue;
                        }
                        append.Append(attr.Key + ":'" + en.GetValStrByKey(attr.Key) + "',");
                    }
                    append = append.Remove(append.Length - 1, 1);
                    append.Append("},");
                }
            }

            if (append.Length > 11 && bHaveData)
            {
                append = append.Remove(append.Length - 1, 1);
            }

            append.Append("],total:" + totalRows + "}");
            append.Append("}");

            return(ReplaceIllgalChart(append.ToString()));
        }
コード例 #9
0
        public void BindSFTable()
        {
            SFTable sf      = new SFTable(this.RefNo);
            var     canEdit = sf.FK_SFDBSrc == "local"; //todo:此处判断不准确,需更加精确的判断??

            this.Title = (canEdit ? "编辑:" : "查看:") + sf.Name;
            this.Pub1.AddTable("class='table' cellpadding='1' cellspacing='1' border='1' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("style='width:80px;text-align:center'", "编号");
            this.Pub1.AddTDGroupTitle("名称");

            if (canEdit)
            {
                this.Pub1.AddTDGroupTitle("style='width:80px'", "操作");
            }

            this.Pub1.AddTREnd();

            GENoNames   ens = new GENoNames(sf.No, sf.Name);
            QueryObject qo  = new QueryObject(ens);

            try
            {
                this.Pub2.BindPageIdxEasyUi(qo.GetCount(), "SFTableEditData.aspx?RefNo=" + this.RefNo, this.PageIdx);
            }
            catch
            {
                sf.CheckPhysicsTable();
                this.Pub2.BindPageIdxEasyUi(qo.GetCount(), "SFTableEditData.aspx?RefNo=" + this.RefNo, this.PageIdx);
            }

            qo.DoQuery("No", 10, this.PageIdx, false);

            foreach (GENoName en in ens)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(en.No);
                TextBox tb = new TextBox();
                tb.ID   = "TB_" + en.No;
                tb.Text = en.Name;
                tb.Style.Add("width", "99%");
                tb.ReadOnly = !canEdit;

                this.Pub1.AddTD(tb);

                if (canEdit)
                {
                    this.Pub1.AddTD("<a href=\"javascript:Del('" + this.RefNo + "','" + this.PageIdx + "','" + en.No + "')\" class='easyui-linkbutton' data-options=\"iconCls:'icon-delete'\" >删除</a>");
                }

                this.Pub1.AddTREnd();
            }

            if (canEdit)
            {
                GENoName newen = new GENoName(sf.No, sf.Name);
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx("新记录");
                TextBox tb1 = new TextBox();
                tb1.ID   = "TB_Name";
                tb1.Text = newen.Name;
                tb1.Style.Add("width", "99%");

                this.Pub1.AddTD(tb1);

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

                this.Pub1.AddTD(btn);
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();

            //this.Pub3.AddTable();
            //this.Pub3.AddTRSum();
            //this.Pub3.AddTD("编号");
            //this.Pub3.AddTD("名称");
            //this.Pub3.AddTD("");
            //this.Pub3.AddTREnd();

            //GENoName newen = new GENoName(sf.No, sf.Name);
            //this.Pub3.AddTRSum();
            //this.Pub3.AddTD(newen.GenerNewNo);
            //TextBox tbn = new TextBox();
            //tbn.ID = "TB_Name";

            //this.Pub3.AddTD(tbn);
            //Button btn = new Button();
            //btn.Text = "增加";
            //btn.Click += new EventHandler(btn_Click);
            //this.Pub3.AddTD(btn);
            //this.Pub3.AddTREnd();
            //this.Pub3.AddTableEnd();
        }
コード例 #10
0
ファイル: Bill.aspx.cs プロジェクト: zhaoyingju/ccflow
        public Entities SetDGData(int pageIdx)
        {
            Entities    ens = this.HisEns;
            Entity      en  = ens.GetNewEntity;
            QueryObject qo  = new QueryObject(ens);

            if (this.DoType == "My")
            {
                qo.AddWhere(BillAttr.FK_Emp, WebUser.No);
                qo.addAnd();
                qo.AddWhere(BillAttr.FK_Flow, this.FK_Flow);
            }
            else
            {
                qo = this.ToolBar1.GetnQueryObject(ens, en);
                qo.addAnd();
                qo.AddWhere(BillAttr.FK_Flow, this.FK_Flow);
            }

            this.Pub2.Clear();
            int maxPageNum = this.Pub2.BindPageIdx(qo.GetCount(), SystemConfig.PageSize, pageIdx, "Search.aspx?FK_Flow=" + this.FK_Flow + "&DoType=" + this.DoType);

            if (maxPageNum > 1)
            {
                this.Pub2.Add("翻页键:← → PageUp PageDown");
            }
            qo.DoQuery(en.PK, SystemConfig.PageSize, pageIdx);
            if (this.DoType == "Dept" && en.EnMap.IsShowSearchKey)
            {
                string keyVal = this.ToolBar1.GetTBByID("TB_Key").Text.Trim();
                if (keyVal.Length >= 1)
                {
                    Attrs attrs = en.EnMap.Attrs;
                    foreach (Entity myen in ens)
                    {
                        foreach (Attr attr in attrs)
                        {
                            if (attr.IsFKorEnum)
                            {
                                continue;
                            }
                            if (attr.IsPK)
                            {
                                continue;
                            }
                            switch (attr.MyDataType)
                            {
                            case DataType.AppRate:
                            case DataType.AppMoney:
                            case DataType.AppInt:
                            case DataType.AppFloat:
                            case DataType.AppDouble:
                            case DataType.AppBoolean:
                                continue;

                            default:
                                break;
                            }
                            myen.SetValByKey(attr.Key, myen.GetValStrByKey(attr.Key).Replace(keyVal, "<font color=red>" + keyVal + "</font>"));
                        }
                    }
                }
            }
            this.BindEns(ens, null);

            #region 生成js
            int ToPageIdx = this.PageIdx + 1;
            int PPageIdx  = this.PageIdx - 1;
            this.UCSys1.Add("<SCRIPT language=javascript>");
            this.UCSys1.Add("\t\n document.onkeydown = chang_page;");
            this.UCSys1.Add("\t\n function chang_page() { ");
            if (this.PageIdx == 1)
            {
                this.UCSys1.Add("\t\n if (event.keyCode == 37 || event.keyCode == 33) alert('已经是第一页');");
            }
            else
            {
                this.UCSys1.Add("\t\n if (event.keyCode == 37  || event.keyCode == 38 || event.keyCode == 33) ");
                this.UCSys1.Add("\t\n     location='Search.aspx?DoType=" + this.DoType + "&FK_Flow=" + this.FK_Flow + "&PageIdx=" + PPageIdx + "';");
            }

            if (this.PageIdx == maxPageNum)
            {
                this.UCSys1.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) alert('已经是最后一页');");
            }
            else
            {
                this.UCSys1.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) ");
                this.UCSys1.Add("\t\n     location='Search.aspx?DoType=" + this.DoType + "&FK_Flow=" + this.FK_Flow + "&PageIdx=" + ToPageIdx + "';");
            }

            this.UCSys1.Add("\t\n } ");
            this.UCSys1.Add("</SCRIPT>");
            #endregion 生成js

            return(ens);
        }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Flow fl = new Flow(this.FK_Flow);

            this.Page.Title = fl.Name;
            GEEntitys   rpts = (GEEntitys)BP.DA.ClassFactory.GetEns(this.EnsName);
            GEEntity    rpt  = (GEEntity)rpts.GetNewEntity;
            QueryObject qo   = new QueryObject(rpts);

            try
            {
                qo.AddWhere(GERptAttr.FlowEmps, " LIKE ", "'%@" + WebUser.No + "%'");
                qo.addAnd();
                qo.AddWhere("" + BP.SystemConfig.AppCenterDBSubstringStr + "(RDT,1,10) >='" + this.DT_F + "' AND " + BP.SystemConfig.AppCenterDBSubstringStr + "(RDT,1,10) <='" + this.DT_T + "' ");

                this.Pub2.BindPageIdx(qo.GetCount(), this.PageSize, this.PageIdx, "FlowSearchMyWork.aspx?EnsName=" + this.EnsName + "&FK_Flow=" + this.FK_Flow);
                qo.DoQuery("OID", this.PageSize, this.PageIdx);
            }
            catch (Exception ex)
            {
                if (this.Request.QueryString["error"] == null)
                {
                    fl.CheckRpt();
                    this.Response.Redirect(this.Request.RawUrl + "&error=1", true);
                    return;
                }
                throw ex;
            }
            //  this.Response.Write(qo.SQL);
            // 生成页面数据。
            Attrs attrs   = BP.WF.Glo.AttrsOfRpt; // rpt.EnMap.Attrs;
            int   colspan = 2;

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

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

            this.Pub1.AddCaptionLeft("流程查询:" + fl.Name);

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD colspan=" + colspan + " class=ToolBar><b>发生日期&nbsp;从:</b>");

            TextBox tb = new TextBox();

            tb.ID      = "TB_F";
            tb.Columns = 10;
            tb.Text    = this.DT_F;
            tb.Attributes["onfocus"] = "WdatePicker();";
            this.Pub1.Add(tb);

            this.Pub1.AddB("&nbsp;到:");
            tb         = new TextBox();
            tb.ID      = "TB_T";
            tb.Text    = this.DT_T;
            tb.Columns = 10;
            this.Pub1.Add(tb);

            this.Pub1.AddB("&nbsp;");

            Button btn = new Button();

            btn.Text                 = "查询";
            btn.CssClass             = "Btn";
            btn.ID                   = "Btn_Search";
            btn.Click               += new EventHandler(btn_Click);
            tb.Attributes["onfocus"] = "WdatePicker();";
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.Text     = "导出Excel";
            btn.CssClass = "Btn";
            btn.ID       = "Btn_Excel";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);
            this.Pub1.Add("&nbsp;</TD>");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序");
            foreach (Attr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                this.Pub1.AddTDTitle("nowarp=true", attr.Desc);
            }
            this.Pub1.AddTDTitle("nowarp=true", "操作");
            this.Pub1.AddTREnd();

            int  idx = 0;
            bool is1 = false;

            foreach (GEEntity en in rpts)
            {
                idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTD(idx);
                foreach (Attr attr in attrs)
                {
                    if (attr.UIVisible == false)
                    {
                        continue;
                    }

                    if (attr.Key == "Title")
                    {
                        this.Pub1.AddTD("<a href=\"./../WF/WFRpt.aspx?WorkID=" + en.GetValIntByKey("OID") + "&FID=" + en.GetValByKey("FID") + "&FK_Flow=" + this.FK_Flow + "\" target=bk >" + en.GetValStrByKey(attr.Key) + "</a>");
                        continue;
                    }

                    if (attr.Key == "WFState")
                    {
                        switch (en.GetValIntByKey(attr.Key))
                        {
                        case 0:
                            this.Pub1.AddTD("进行中");
                            break;

                        case 1:
                            this.Pub1.AddTD("完成");
                            break;
                        }
                        continue;
                    }
                    switch (attr.MyDataType)
                    {
                    case DataType.AppBoolean:
                        this.Pub1.AddTD(en.GetValBoolStrByKey(attr.Key));
                        break;

                    case DataType.AppFloat:
                    case DataType.AppDouble:
                        this.Pub1.AddTD(en.GetValFloatByKey(attr.Key));
                        break;

                    case DataType.AppInt:
                        if (attr.UIContralType == UIContralType.DDL)
                        {
                            this.Pub1.AddTD(en.GetValRefTextByKey(attr.Key));
                        }
                        else
                        {
                            this.Pub1.AddTD(en.GetValIntByKey(attr.Key));
                        }
                        break;

                    case DataType.AppMoney:
                        this.Pub1.AddTDMoney(en.GetValDecimalByKey(attr.Key));
                        break;

                    default:
                        this.Pub1.AddTD(en.GetValStringByKey(attr.Key));
                        break;
                    }
                }
                this.Pub1.AddTD("<a href=\"./../WF/WFRpt.aspx?WorkID=" + en.GetValIntByKey("OID") + "&FID=" + en.GetValByKey("FID") + "&FK_Flow=" + this.FK_Flow + "\" target=bk >报告</a>-<a href=\"./../WF/Chart.aspx?WorkID=" + en.GetValIntByKey("OID") + "&FID=" + en.GetValByKey("FID") + "&FK_Flow=" + this.FK_Flow + "\" target=bk >轨迹</a>");
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTRSum();
            this.Pub1.AddTD("");
            foreach (Attr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                this.Pub1.AddTD();
                continue;
            }
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
コード例 #12
0
        public string Search_Init()
        {
            DataSet ds = new DataSet();

            #region 查询显示的列
            MapAttrs mapattrs = new MapAttrs();
            mapattrs.Retrieve(MapAttrAttr.FK_MapData, this.FrmID, MapAttrAttr.Idx);

            DataRow   row = null;
            DataTable dt  = new DataTable("Attrs");
            dt.Columns.Add("KeyOfEn", typeof(string));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Width", typeof(int));
            dt.Columns.Add("UIContralType", typeof(int));
            dt.Columns.Add("LGType", typeof(int));

            //设置标题、单据号位于开始位置


            foreach (MapAttr attr in mapattrs)
            {
                string searchVisable = attr.atPara.GetValStrByKey("SearchVisable");
                if (searchVisable == "0")
                {
                    continue;
                }
                if (attr.UIVisible == false)
                {
                    continue;
                }
                row                  = dt.NewRow();
                row["KeyOfEn"]       = attr.KeyOfEn;
                row["Name"]          = attr.Name;
                row["Width"]         = attr.UIWidthInt;
                row["UIContralType"] = attr.UIContralType;
                row["LGType"]        = attr.LGType;
                dt.Rows.Add(row);
            }
            ds.Tables.Add(dt);
            #endregion 查询显示的列

            #region 查询语句

            MapData md = new MapData(this.FrmID);


            //取出来查询条件.
            BP.Sys.UserRegedit ur = new UserRegedit();
            ur.MyPK = WebUser.No + "_" + this.FrmID + "_SearchAttrs";
            ur.RetrieveFromDBSources();

            GEEntitys rpts = new GEEntitys(this.FrmID);

            Attrs attrs = rpts.GetNewEntity.EnMap.Attrs;

            QueryObject qo = new QueryObject(rpts);

            #region 关键字字段.
            string keyWord = ur.SearchKey;

            if (md.GetParaBoolen("IsSearchKey") && DataType.IsNullOrEmpty(keyWord) == false && keyWord.Length >= 1)
            {
                Attr attrPK = new Attr();
                foreach (Attr attr in attrs)
                {
                    if (attr.IsPK)
                    {
                        attrPK = attr;
                        break;
                    }
                }
                int    i       = 0;
                string enumKey = ","; //求出枚举值外键.
                foreach (Attr attr in attrs)
                {
                    switch (attr.MyFieldType)
                    {
                    case FieldType.Enum:
                        enumKey = "," + attr.Key + "Text,";
                        break;

                    case FieldType.FK:

                        continue;

                    default:
                        break;
                    }

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

                    //排除枚举值关联refText.
                    if (attr.MyFieldType == FieldType.RefText)
                    {
                        if (enumKey.Contains("," + attr.Key + ",") == true)
                        {
                            continue;
                        }
                    }

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

                    i++;
                    if (i == 1)
                    {
                        /* 第一次进来。 */
                        qo.addLeftBracket();
                        if (SystemConfig.AppCenterDBVarStr == "@" || SystemConfig.AppCenterDBVarStr == "?")
                        {
                            qo.AddWhere(attr.Key, " LIKE ", SystemConfig.AppCenterDBType == DBType.MySQL ? (" CONCAT('%'," + SystemConfig.AppCenterDBVarStr + "SKey,'%')") : (" '%'+" + SystemConfig.AppCenterDBVarStr + "SKey+'%'"));
                        }
                        else
                        {
                            qo.AddWhere(attr.Key, " LIKE ", " '%'||" + SystemConfig.AppCenterDBVarStr + "SKey||'%'");
                        }
                        continue;
                    }
                    qo.addOr();

                    if (SystemConfig.AppCenterDBVarStr == "@" || SystemConfig.AppCenterDBVarStr == "?")
                    {
                        qo.AddWhere(attr.Key, " LIKE ", SystemConfig.AppCenterDBType == DBType.MySQL ? ("CONCAT('%'," + SystemConfig.AppCenterDBVarStr + "SKey,'%')") : ("'%'+" + SystemConfig.AppCenterDBVarStr + "SKey+'%'"));
                    }
                    else
                    {
                        qo.AddWhere(attr.Key, " LIKE ", "'%'||" + SystemConfig.AppCenterDBVarStr + "SKey||'%'");
                    }
                }
                qo.MyParas.Add("SKey", keyWord);
                qo.addRightBracket();
            }
            else
            {
                qo.AddHD();
            }
            #endregion 关键字段查询

            #region 时间段的查询
            if (md.GetParaInt("DTSearchWay") != (int)DTSearchWay.None && DataType.IsNullOrEmpty(ur.DTFrom) == false)
            {
                string dtFrom = ur.DTFrom; // this.GetTBByID("TB_S_From").Text.Trim().Replace("/", "-");
                string dtTo   = ur.DTTo;   // this.GetTBByID("TB_S_To").Text.Trim().Replace("/", "-");

                //按日期查询
                if (md.GetParaInt("DTSearchWay") == (int)DTSearchWay.ByDate)
                {
                    qo.addAnd();
                    qo.addLeftBracket();
                    dtTo  += " 23:59:59";
                    qo.SQL = md.GetParaString("DTSearchKey") + " >= '" + dtFrom + "'";
                    qo.addAnd();
                    qo.SQL = md.GetParaString("DTSearchKey") + " <= '" + dtTo + "'";
                    qo.addRightBracket();
                }

                if (md.GetParaInt("DTSearchWay") == (int)DTSearchWay.ByDateTime)
                {
                    //取前一天的24:00
                    if (dtFrom.Trim().Length == 10) //2017-09-30
                    {
                        dtFrom += " 00:00:00";
                    }
                    if (dtFrom.Trim().Length == 16) //2017-09-30 00:00
                    {
                        dtFrom += ":00";
                    }

                    dtFrom = DateTime.Parse(dtFrom).AddDays(-1).ToString("yyyy-MM-dd") + " 24:00";

                    if (dtTo.Trim().Length < 11 || dtTo.Trim().IndexOf(' ') == -1)
                    {
                        dtTo += " 24:00";
                    }

                    qo.addAnd();
                    qo.addLeftBracket();
                    qo.SQL = md.GetParaString("DTSearchKey") + " >= '" + dtFrom + "'";
                    qo.addAnd();
                    qo.SQL = md.GetParaString("DTSearchKey") + " <= '" + dtTo + "'";
                    qo.addRightBracket();
                }
            }
            #endregion 时间段的查询

            #region 外键或者枚举的查询

            //获得关键字.
            AtPara ap = new AtPara(ur.Vals);
            foreach (string str in ap.HisHT.Keys)
            {
                var val = ap.GetValStrByKey(str);
                if (val.Equals("all"))
                {
                    continue;
                }
                qo.addAnd();
                qo.addLeftBracket();
                qo.AddWhere(str, ap.GetValStrByKey(str));
                qo.addRightBracket();
            }
            #endregion 外键或者枚举的查询

            #endregion 查询语句

            //获得行数.
            ur.SetPara("RecCount", qo.GetCount());
            ur.Save();

            qo.DoQuery("OID", this.PageSize, this.PageIdx);

            DataTable mydt = rpts.ToDataTableField();
            mydt.TableName = "DT";

            ds.Tables.Add(mydt); //把数据加入里面.

            return(BP.Tools.Json.ToJson(ds));
        }
コード例 #13
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);
        }
コード例 #14
0
ファイル: Dtl.ascx.cs プロジェクト: zhaoyingju/ccflow
        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();
        }
コード例 #15
0
        private void BindSearch()
        {
            Flow fl   = new Flow(this.FK_Flow);
            var  gwfs = new GenerWorkFlows();
            var  qo   = new QueryObject(gwfs);

            qo.AddWhere(GenerWorkFlowAttr.FK_Flow, FK_Flow);

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

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

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

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

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

            qo.addOrderBy(GenerWorkFlowAttr.RDT);

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

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

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

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

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

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

            int idx = 0;

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

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

            this.Pub1.AddTableEnd();
        }
コード例 #16
0
        public Entities SetDGData(int pageIdx)
        {
            Entities    ens = this.HisEns;
            Entity      en  = ens.GetNewEntity;
            QueryObject qo  = new QueryObject(ens);

            qo = this.ToolBar1.GetnQueryObject(ens, en);
            int maxPageNum = 0;

            try
            {
                this.UCSys2.Clear();
                maxPageNum = this.UCSys2.BindPageIdx(qo.GetCount(), SystemConfig.PageSize, pageIdx, "Search.aspx?EnsName=" + this.EnsName);
                if (maxPageNum > 1)
                {
                    this.UCSys2.Add("翻页键:← → PageUp PageDown");
                }
            }
            catch
            {
                try
                {
                    en.CheckPhysicsTable();
                }
                catch (Exception wx)
                {
                    BP.DA.Log.DefaultLogWriteLineError(wx.Message);
                }
                maxPageNum = this.UCSys2.BindPageIdx(qo.GetCount(), SystemConfig.PageSize, pageIdx, "Search.aspx?EnsName=" + this.EnsName);
            }

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

            if (en.EnMap.IsShowSearchKey)
            {
                string keyVal = this.ToolBar1.GetTBByID("TB_Key").Text.Trim();
                if (keyVal.Length >= 1)
                {
                    Attrs attrs = en.EnMap.Attrs;
                    foreach (Entity myen in ens)
                    {
                        foreach (Attr attr in attrs)
                        {
                            if (attr.IsFKorEnum)
                            {
                                continue;
                            }

                            if (attr.IsPK)
                            {
                                continue;
                            }

                            switch (attr.MyDataType)
                            {
                            case DataType.AppRate:
                            case DataType.AppMoney:
                            case DataType.AppInt:
                            case DataType.AppFloat:
                            case DataType.AppDouble:
                            case DataType.AppBoolean:
                                continue;

                            default:
                                break;
                            }
                            myen.SetValByKey(attr.Key, myen.GetValStrByKey(attr.Key).Replace(keyVal, "<font color=red>" + keyVal + "</font>"));
                        }
                    }
                }
            }
            // string groupkey = this.DDL_GroupKey.SelectedItemStringVal;
            // string groupkey2 = "None";
            this.UCSys1.DataPanelDtl(ens, null);

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

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

            if (this.PageIdx == maxPageNum)
            {
                this.UCSys1.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) alert('已经是最后一页');");
            }
            else
            {
                this.UCSys1.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) ");
                this.UCSys1.Add("\t\n     location='Search.aspx?EnsName=" + this.EnsName + "&PageIdx=" + ToPageIdx + "';");
            }

            this.UCSys1.Add("\t\n } ");
            this.UCSys1.Add("</SCRIPT>");
            return(ens);
        }
コード例 #17
0
        public Entities SetDGData(int pageIdx)
        {
            #region 执行数据分页查询,并绑定分页控件.

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

            //if (qo.MyParas.COntinckey("WFSta") == false)
            //{
            //    qo.addAnd();
            //    try
            //    {
            //        qo.AddWhere("WFSta", "!=", "0");
            //    }
            //    catch
            //    {
            //        BP.WF.Flow fl = new Flow(this.FK_Flow);
            //        fl.CheckRpt();
            //        qo.AddWhere("WFSta", "!=", "0");
            //    }
            //}

            this.Pub2.Clear();
            this.Pub2.BindPageIdxEasyUi(qo.GetCount(),
                                        this.PageID + ".aspx?RptNo=" + this.RptNo + "&EnsName=" + this.RptNo +
                                        "&FK_Flow=" + this.FK_Flow,
                                        pageIdx,
                                        SystemConfig.PageSize);


            qo.DoQuery(en.PK, SystemConfig.PageSize, pageIdx);
            #endregion 执行数据分页查询,并绑定分页控件.

            #region 检查是否显示按关键字查询,如果是就把关键标注为红色.

            if (en.EnMap.IsShowSearchKey)
            {
                string keyVal = this.ToolBar1.GetTBByID("TB_Key").Text.Trim();

                if (keyVal.Length >= 1)
                {
                    Attrs attrs = en.EnMap.Attrs;

                    foreach (Entity myen in ens)
                    {
                        foreach (Attr attr in attrs)
                        {
                            if (attr.IsFKorEnum)
                            {
                                continue;
                            }

                            if (attr.IsPK)
                            {
                                continue;
                            }

                            switch (attr.MyDataType)
                            {
                            case DataType.AppRate:
                            case DataType.AppMoney:
                            case DataType.AppInt:
                            case DataType.AppFloat:
                            case DataType.AppDouble:
                            case DataType.AppBoolean:
                                continue;

                            default:
                                break;
                            }

                            myen.SetValByKey(attr.Key, myen.GetValStrByKey(attr.Key).Replace(keyVal, "<font color=red>" + keyVal + "</font>"));
                        }
                    }
                }
            }
            #endregion 检查是否显示按关键字查询,如果是就把关键标注为红色.

            // 处理entity的GuestNo 列的问题。
            //  if (en.EnMap.Attrs.Contains(NDXRptBaseAttr.ex
            //foreach (Entity en in ens)
            //{
            //}
            //绑定数据.
            this.BindEns(ens, null);

            #region 生成翻页的js,暂不用
            //int ToPageIdx = this.PageIdx + 1;
            //int PPageIdx = this.PageIdx - 1;
            //this.UCSys1.Add("<SCRIPT language=javascript>");
            //this.UCSys1.Add("\t\n document.onkeydown = chang_page;");
            //this.UCSys1.Add("\t\n function chang_page() { ");
            //if (this.PageIdx == 1)
            //{
            //    this.UCSys1.Add("\t\n if (event.keyCode == 37 || event.keyCode == 33) alert('已经是第一页');");
            //}
            //else
            //{
            //    this.UCSys1.Add("\t\n if (event.keyCode == 37  || event.keyCode == 38 || event.keyCode == 33) ");
            //    this.UCSys1.Add("\t\n     location='" + this.PageID + ".aspx?RptNo=" + this.RptNo + "&FK_Flow=" + this.currMapRpt.FK_Flow + "&PageIdx=" + PPageIdx + "';");
            //}

            //if (this.PageIdx == maxPageNum)
            //{
            //    this.UCSys1.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) alert('已经是最后一页');");
            //}
            //else
            //{
            //    this.UCSys1.Add("\t\n if (event.keyCode == 39 || event.keyCode == 40 || event.keyCode == 34) ");
            //    this.UCSys1.Add("\t\n     location='" + this.PageID + ".aspx?RptNo=" + this.RptNo + "&FK_Flow=" + this.currMapRpt.FK_Flow + "&PageIdx=" + ToPageIdx + "';");
            //}

            //this.UCSys1.Add("\t\n } ");
            //this.UCSys1.Add("</SCRIPT>");
            #endregion 生成翻页的js

            return(ens);
        }
コード例 #18
0
        public void BindSFTable()
        {
            SFTable sf = new SFTable(this.RefNo);

            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("编辑:" + sf.Name);
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTREnd();

            GENoNames   ens = new GENoNames(sf.No, sf.Name);
            QueryObject qo  = new QueryObject(ens);

            try
            {
                this.Pub2.BindPageIdx(qo.GetCount(), 10, this.PageIdx, "SFTableEditData.aspx?RefNo=" + this.RefNo);
            }
            catch
            {
                sf.CheckPhysicsTable();
                this.Pub2.BindPageIdx(qo.GetCount(), 10, this.PageIdx, "SFTableEditData.aspx?RefNo=" + this.RefNo);
            }

            qo.DoQuery("No", 10, this.PageIdx, false);

            foreach (GENoName en in ens)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDDesc(en.No);
                TextBox tb = new TextBox();
                tb.ID   = "TB_" + en.No;
                tb.Text = en.Name;
                tb.Attributes["width"] = "500px";
                tb.Columns             = 80;

                this.Pub1.AddTD(tb);
                this.Pub1.AddTD("<a href=\"javascript:Del('" + this.RefNo + "','" + this.PageIdx + "','" + en.No + "')\" >删除</a>");
                this.Pub1.AddTREnd();
            }

            GENoName newen = new GENoName(sf.No, sf.Name);

            this.Pub1.AddTR();
            this.Pub1.AddTDDesc("新记录");
            TextBox tb1 = new TextBox();

            tb1.ID      = "TB_Name";
            tb1.Text    = newen.Name;
            tb1.Columns = 80;

            this.Pub1.AddTD(tb1);
            Button btn = new Button();

            btn.CssClass = "Btn";

            btn.Text   = "Save";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.AddTD(btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();

            //this.Pub3.AddTable();
            //this.Pub3.AddTRSum();
            //this.Pub3.AddTD("编号");
            //this.Pub3.AddTD("名称");
            //this.Pub3.AddTD("");
            //this.Pub3.AddTREnd();

            //GENoName newen = new GENoName(sf.No, sf.Name);
            //this.Pub3.AddTRSum();
            //this.Pub3.AddTD(newen.GenerNewNo);
            //TextBox tbn = new TextBox();
            //tbn.ID = "TB_Name";

            //this.Pub3.AddTD(tbn);
            //Button btn = new Button();
            //btn.Text = "增加";
            //btn.Click += new EventHandler(btn_Click);
            //this.Pub3.AddTD(btn);
            //this.Pub3.AddTREnd();
            //this.Pub3.AddTableEnd();
        }
コード例 #19
0
        public void BindSearch()
        {
            Node        nd  = new Node(this.FK_Node);
            Works       wks = nd.HisWorks;
            QueryObject qo  = new QueryObject(wks);

            qo.AddWhere(WorkAttr.Rec, WebUser.No);
            qo.addAnd();
            if (BP.Sys.SystemConfig.AppCenterDBType == DBType.Access)
            {
                qo.AddWhere("Mid(RDT,1,10) >='" + this.DT_F + "' AND Mid(RDT,1,10) <='" + this.DT_T + "' ");
            }
            else
            {
                qo.AddWhere("" + BP.Sys.SystemConfig.AppCenterDBSubstringStr + "(RDT,1,10) >='" + this.DT_F + "' AND " + BP.Sys.SystemConfig.AppCenterDBSubstringStr + "(RDT,1,10) <='" + this.DT_T + "' ");
            }

            this.Pub2.BindPageIdx(qo.GetCount(), this.PageSize, this.PageIdx, "FlowSearch.aspx?FK_Node=" + this.FK_Node);
            qo.DoQuery("OID", this.PageSize, this.PageIdx);

            // 生成页面数据。
            Attrs attrs   = nd.HisWork.EnMap.Attrs;
            int   colspan = 2;

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


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

            this.Pub1.AddCaption("<img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/EmpWorks.gif' > <b><a href=FlowSearch.aspx >" + "流程查询" + "</a>-<a href='FlowSearch.aspx?FK_Flow=" + nd.FK_Flow + "'>" + nd.FlowName + "</a>-" + nd.Name + "</b>");

            this.Pub1.AddTR();
            this.Pub1.Add("<TD colspan=" + colspan + " class=TD>发生日期从:");
            TextBox tb = new TextBox();

            tb.ID      = "TB_F";
            tb.Columns = 10;
            tb.Text    = this.DT_F;
            this.Pub1.Add(tb);
            this.Pub1.Add("到:");
            tb         = new TextBox();
            tb.ID      = "TB_T";
            tb.Text    = this.DT_T;
            tb.Columns = 10;
            this.Pub1.Add(tb);

            Button btn = new Button();

            btn.Text     = " 查询 ";
            btn.CssClass = "Btn";
            btn.ID       = "Btn_Search";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.CssClass = "Btn";
            btn.Text     = "导出Excel";
            btn.ID       = "Btn_Excel";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.Add(btn);
            this.Pub1.Add("</TD>");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序");
            foreach (Attr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }
                this.Pub1.AddTDTitle(attr.Desc);
            }
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTREnd();

            int  idx = 0;
            bool is1 = false;

            foreach (Entity en in wks)
            {
                idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTD(idx);
                foreach (Attr attr in attrs)
                {
                    if (attr.UIVisible == false)
                    {
                        continue;
                    }
                    switch (attr.MyDataType)
                    {
                    case DataType.AppBoolean:
                        this.Pub1.AddTD(en.GetValBoolStrByKey(attr.Key));
                        break;

                    case DataType.AppFloat:
                    case DataType.AppDouble:
                        this.Pub1.AddTD(en.GetValFloatByKey(attr.Key));
                        break;

                    case DataType.AppInt:
                        if (attr.UIContralType == UIContralType.DDL)
                        {
                            this.Pub1.AddTD(en.GetValRefTextByKey(attr.Key));
                        }
                        else
                        {
                            this.Pub1.AddTD(en.GetValIntByKey(attr.Key));
                        }
                        break;

                    case DataType.AppMoney:
                        this.Pub1.AddTDMoney(en.GetValDecimalByKey(attr.Key));
                        break;

                    default:
                        this.Pub1.AddTD(en.GetValStrByKey(attr.Key));
                        break;
                    }
                }
                this.Pub1.AddTD("<a href=\"./../WF/WFRpt.aspx?WorkID=" + en.GetValIntByKey("OID") + "&FID=" + en.GetValByKey("FID") + "&FK_Flow=" + nd.FK_Flow + "\" target=bk >报告</a>-<a href=\"./../WF/WorkOpt/OneWork/ChartTrack.aspx?WorkID=" + en.GetValIntByKey("OID") + "&FID=" + en.GetValByKey("FID") + "&FK_Flow=" + nd.FK_Flow + "\" target=bk >轨迹</a>");
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTRSum();
            this.Pub1.AddTD("");
            foreach (Attr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }
                switch (attr.MyDataType)
                {
                case DataType.AppFloat:
                case DataType.AppInt:
                case DataType.AppDouble:
                    this.Pub1.AddTDB(wks.GetSumDecimalByKey(attr.Key).ToString());
                    break;

                case DataType.AppMoney:
                    this.Pub1.AddTDB(wks.GetSumDecimalByKey(attr.Key).ToString("0.00"));
                    break;

                default:
                    this.Pub1.AddTD();
                    break;
                }
            }
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
コード例 #20
0
    public void Bind()
    {
        #region 生成标题
        Entity en  = this.HisEn;
        Map    map = this.HisEn.EnMap;
        EnCfg  cfg = new EnCfg(en.ToString());

        UIConfig uicfg = new UIConfig(en);

        Attrs attrs = map.Attrs;
        if (attrs.Count >= 4)
        {
            this.ucsys1.Add("<table border=0 cellpadding='0'  style='border-collapse: collapse;width:100%' cellspacing='0'  >");
        }
        else
        {
            this.ucsys1.Add("<table border=0 cellpadding='0'  style='border-collapse: collapse;width:50%' cellspacing='0'  >");
        }

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

        if (map.IsHaveFJ)
        {
            this.ucsys1.AddTDGroupTitle("附件");
        }
        this.ucsys1.AddTDGroupTitle();
        this.ucsys1.AddTREnd();
        #endregion 生成标题

        this.Title = en.EnDesc;

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

        #region 用户界面属性设置- del
        //BP.Web.Comm.UIRowStyleGlo tableStyle = (UIRowStyleGlo)ens.GetEnsAppCfgByKeyInt("UIRowStyleGlo"); // 界面风格。
        //bool IsEnableDouclickGlo = ens.GetEnsAppCfgByKeyBoolen("IsEnableDouclickGlo"); // 是否启用双击
        //bool IsEnableRefFunc = ens.GetEnsAppCfgByKeyBoolen("IsEnableRefFunc"); // 是否显示相关功能。
        //bool IsEnableFocusField = ens.GetEnsAppCfgByKeyBoolen("IsEnableFocusField"); //是否启用焦点字段。
        //bool isShowOpenICON = ens.GetEnsAppCfgByKeyBoolen("IsEnableOpenICON"); //是否启用 OpenICON 。
        //string FocusField = null;
        //if (IsEnableFocusField)
        //    FocusField = ens.GetEnsAppCfgByKeyString("FocusField");

        //int WinCardH = ens.GetEnsAppCfgByKeyInt("WinCardH"); // 弹出窗口高度
        //int WinCardW = ens.GetEnsAppCfgByKeyInt("WinCardW"); // 弹出窗口宽度.
        #endregion 用户界面属性设置

        #region 生成翻页
        try
        {
            this.ucsys2.Clear();
            this.ucsys2.BindPageIdx(qo.GetCount(), BP.Sys.SystemConfig.PageSize, this.PageIdx, "Ens.aspx?EnsName=" + this.EnsName);
            qo.DoQuery(en.PK, BP.Sys.SystemConfig.PageSize, this.PageIdx, false);
        }
        catch (Exception ex)
        {
            //自动创建表.
            Log.DebugWriteInfo(ex.Message);

            ens.GetNewEntity.CheckPhysicsTable();
            return;
        }
        #endregion 生成翻页

        en.PKVal = "0";
        ens.AddEntity(en);
        DDL  ddl = new DDL();
        bool is1 = false;

        #region 生成数据
        int i = 0;
        foreach (Entity dtl in ens)
        {
            string urlExt = "\"javascript:ShowEn('./RefFunc/UIEn.aspx?EnsName=" + ens.ToString() + "&PK=" + dtl.PKVal + "', 'cd');\"";
            i++;
            if (Equals(dtl.PKVal, "0"))
            {
                this.ucsys1.AddTRSum();
                this.ucsys1.AddTDIdx("<b>*</b>");
            }
            else
            {
                is1     = this.ucsys1.AddTR(is1, "ondblclick=" + urlExt);
                cb      = new CheckBox();
                cb.ID   = "IDX_" + dtl.PKVal;
                cb.Text = i.ToString();
                this.ucsys1.AddTDIdx(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();
                    tb.LoadMapAttr(attr);
                    this.ucsys1.AddTD(tb);
                    tb.ID = "TB_" + attr.Key + "_" + dtl.PKVal;
                    switch (attr.MyDataType)
                    {
                    case DataType.AppMoney:
                    case DataType.AppRate:
                        tb.TextExtMoney = decimal.Parse(val);
                        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:
                    if (attr.UIIsReadonly)
                    {
                        ddl = new DDL();
                        ddl.LoadMapAttr(attr);
                        ddl.ID = "DDL_" + attr.Key + "_" + dtl.PKVal;
                        //  this.ucsys1.AddTD(ddl);
                        this.ucsys1.AddTD(ddl);
                        ddl.SetSelectItem(val);
                    }
                    else
                    {
                        this.ucsys1.AddTD(dtl.GetValRefTextByKey(attr.Key));
                    }
                    break;

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

                default:
                    break;
                }
            }
            if (map.IsHaveFJ)
            {
                string ext = dtl.GetValStrByKey("MyFileExt");
                if (ext == null || ext.Length > 1)
                {
                    this.ucsys1.AddTD("<a href='" + cfg.FJWebPath + "/" + dtl.PKVal + "." + ext + "' target=_blank ><img src='../Images/FileType/" + dtl.GetValStrByKey("MyFileExt") + ".gif' border=0/>" + dtl.GetValStrByKey("MyFileName") + "</a>");
                }
                else
                {
                    this.ucsys1.AddTD();
                }
            }
            if (uicfg.IsEnableOpenICON)
            {
                this.ucsys1.Add("<TD class='TD' style='cursor:hand;' nowrap=true><a href=" + urlExt + " ><img src='../Img/Btn/Open.gif' border=0/></a></TD>");
            }
            else
            {
                this.ucsys1.AddTD();
            }
            this.ucsys1.AddTREnd();
        }

        #region 生成合计,屏蔽
        //if (false)
        //{
        //    this.ucsys1.AddTRSum();
        //    this.ucsys1.AddTD("colspan=1", "合计");
        //    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("#FFFFFF");

        //            switch (attr.MyDataType)
        //            {
        //                case DataType.AppRate:
        //                case DataType.AppMoney:
        //                    tb.TextExtMoney = ens.GetSumDecimalByKey(attr.Key);
        //                    break;
        //                case DataType.AppInt:
        //                    tb.TextExtInt = ens.GetSumIntByKey(attr.Key);
        //                    break;
        //                case DataType.AppFloat:
        //                    tb.TextExtFloat = ens.GetSumFloatByKey(attr.Key);
        //                    break;
        //                default:
        //                    break;
        //            }
        //            this.ucsys1.AddTD(tb);
        //        }
        //        else
        //        {
        //            this.ucsys1.AddTD();
        //        }
        //    }

        //    if (map.IsHaveFJ)
        //        this.ucsys1.AddTD();

        //    this.ucsys1.AddTD();
        //    this.ucsys1.AddTREnd();
        //}
        #endregion 生成合计

        #endregion 生成数据

        this.ucsys1.AddTableEnd();
    }
コード例 #21
0
        public void AddSFTable()
        {
            BP.Sys.SFTables ens = new SFTables();
            QueryObject     qo  = new QueryObject(ens);

            qo.AddWhere(BP.Sys.SFTableAttr.SrcType, (int)SrcType.TableOrView);

            this.Pub2.BindPageIdx(qo.GetCount(), pageSize, this.PageIdx,
                                  "Do.aspx?DoType=AddSFTable&MyPK=" + this.MyPK + "&Idx=&GroupField");
            qo.DoQuery("No", pageSize, this.PageIdx);



            this.Title = "增加新字段向导";
            this.Pub1.AddTable();
            this.Pub1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'><img src='/WF/Img/Btn/Back.gif' />&nbsp;返回</a> - 外键列表 - <a href='SFTable.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' >新建表</a>");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("编号(点击增加到表单)");
            this.Pub1.AddTDTitle("名称(点击修改属性)");
            this.Pub1.AddTDTitle("描述");
            this.Pub1.AddTDTitle("编码表类型");
            this.Pub1.AddTDTitle("编辑数据");
            this.Pub1.AddTREnd();

            if (ens.Count == 0)
            {
                //string html = "<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'><img src='/WF/Img/Btn/Back.gif' />&nbsp;返回</a> - 增加外键字段 - <a href='SFTable.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' >新建表</a>";
                this.Pub1.AddTR();
                this.Pub1.AddTDBigDoc("colspan=5", "注册到ccform的表为空,点击上面的新建表,进入创建向导。");
                this.Pub1.AddTREnd();
                this.Pub1.AddTableEnd();
                return;
            }


            bool is1 = false;
            int  Idx = 0;

            foreach (BP.Sys.SFTable sem in ens)
            {
                Idx++;
                //is1 = this.Pub1.AddTR(is1);
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(Idx);
                this.Pub1.AddTD("<a  href=\"javascript:AddSFTable('" + this.MyPK + "','" + this.Idx + "','" + sem.No + "')\" >" + sem.No + "</a>");

                this.Pub1.AddTD("<a href=\"javascript:WinOpen('SFTable.aspx?DoType=Edit&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&RefNo=" + sem.No + "','sg')\"  ><img src='../Img/Btn/Edit.gif' border=0/>" + sem.Name + "</a>");

                this.Pub1.AddTD(sem.TableDesc); //描述.

                //编码表类型.
                this.Pub1.AddTD(sem.CodeStructT);

                if (sem.No.Contains("."))
                {
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=" + sem.No + "');\" >编辑数据</a>");
                }
                else
                {
                    this.Pub1.AddTD("<a href=\"javascript:WinOpen('SFTableEditData.aspx?RefNo=" + sem.No + "');\" >编辑数据</a>");
                }
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }