コード例 #1
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();
        }
コード例 #2
0
ファイル: GenerBillNo.cs プロジェクト: gzcw/MyWebApplication
        /// <summary>
        /// 测试案例说明:
        /// 1, 不同的格式,生成不同的编号。
        /// </summary>
        public override void Do()
        {
            this.fk_flow = "023";
            fl           = new Flow("023");
            string sUser = "******";

            BP.WF.Dev2Interface.Port_Login(sUser);

            //删除数据.
            fl.DoDelData();

            //创建.
            workID = BP.WF.Dev2Interface.Node_CreateBlankWork(fl.No);

            //定义单据格式.
            string billFormat = "CN{yyyy}-{MM}-{dd}IDX-{LSH4}";

            fl.BillNoFormat = billFormat;
            fl.Update();

            //执行发送.
            SendReturnObjs objs = BP.WF.Dev2Interface.Node_SendWork(fl.No, workID);

            // 应该是。
            billFormat = billFormat.Replace("{yyyy}", DateTime.Now.ToString("yyyy"));
            billFormat = billFormat.Replace("{MM}", DateTime.Now.ToString("MM"));
            billFormat = billFormat.Replace("{dd}", DateTime.Now.ToString("dd"));
            billFormat = billFormat.Replace("{LSH4}", "0001");

            GenerWorkFlow gwf = new GenerWorkFlow(workID);

            if (gwf.BillNo != billFormat)
            {
                throw new Exception("@应当是:" + billFormat + "现在是:" + gwf.BillNo);
            }

            // 生成子流程。
            Flow flSub = new Flow("024");

            flSub.DoCheck();
            flSub.CheckRpt();

            // 产生子流程编号。
            for (int i = 1; i < 5; i++)
            {
                flSub.BillNoFormat = "{ParentBillNo}-{LSH4}";
                Int64 subWorkID = BP.WF.Dev2Interface.Node_CreateBlankWork(flSub.No);
                objs = BP.WF.Dev2Interface.Node_SendWork(flSub.No, subWorkID);

                //设置流程信息。
                BP.WF.Dev2Interface.SetParentInfo(flSub.No, subWorkID, workID);
                if (i == 2)
                {
                    continue;
                }

                string subFlowBillNo = DBAccess.RunSQLReturnStringIsNull("SELECT BillNo FROM " + flSub.PTable + " WHERE OID=" + subWorkID, "");
                if (subFlowBillNo != billFormat + "-000" + i)
                {
                    throw new Exception("@应当是:" + billFormat + "-000" + i + " , 现在是:" + subFlowBillNo);
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// 部门编号为GUID模式下的发送
        /// </summary>
        public override void Do()
        {
            //重新装载演示环境.
            ReLoadDept();

            try
            {
                #region 把数据换成guid模式.
                BP.Port.Depts depts = new Port.Depts();
                depts.RetrieveAll();

                string guid1 = "";
                foreach (BP.Port.Dept item in depts)
                {
                    string deptNo = item.No;
                    string guid   = DBAccess.GenerGUID();
                    if (item.No == "1")
                    {
                        guid1 = guid;
                    }

                    sql = "UPDATE Port_Dept SET No='" + guid + "' WHERE No='" + deptNo + "'";
                    DBAccess.RunSQL(sql);

                    sql = "UPDATE Port_Emp SET FK_Dept='" + guid + "' WHERE FK_Dept='" + deptNo + "'";
                    DBAccess.RunSQL(sql);
                }

                sql = "UPDATE Port_Dept SET ParentNo='" + guid1 + "' WHERE ParentNo='1'";
                DBAccess.RunSQL(sql);
                #endregion

                string err = "";
                Flow   fl  = new Flow("023");
                fl.CheckRpt();
                fl.DoDelData();

                BP.Sys.SystemConfig.DoClearCash();

                err = "@第Send023 错误.";
                Send023 se = new Send023();
                se.Do();

                fl = new Flow("024");
                fl.CheckRpt();
                err = "@第Send024 错误.";
                Send024 s2e = new Send024();
                s2e.Do();


                fl = new Flow("005");
                fl.CheckRpt();
                err = "@第Send005 错误.";
                Send005 s5 = new Send005();
                s5.Do();

                //重新装载演示环境.
                ReLoadDept();
            }
            catch (Exception ex)
            {
                //重新装载演示环境.
                ReLoadDept();

                throw ex;
            }
        }
コード例 #4
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);
        }