Ejemplo n.º 1
0
        /// <summary>
        /// 查询出来全部的在生存期间内的流程
        /// </summary>
        /// <param name="FlowSort">流程类别</param>
        /// <param name="IsCountInLifeCycle">是不是计算在生存期间内 true 查询出来全部的 </param>
        public void Retrieve(string FlowSort)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(BP.WF.Template.FlowAttr.FK_FlowSort, FlowSort);
            qo.addOrderBy(BP.WF.Template.FlowAttr.No);
            qo.DoQuery();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="emp"></param>
        public GroupEnsTemplates(string emp)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GroupEnsTemplateAttr.Rec, emp);
            qo.addOr();
            qo.AddWhere(GroupEnsTemplateAttr.Rec, "admin");
            qo.DoQuery();
        }
Ejemplo n.º 3
0
        public SysDocFiles(string _tableName, string _key)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(SysDocFileAttr.EnName, _tableName);
            qo.addAnd();
            qo.AddWhere(SysDocFileAttr.RefKey, _key);
            qo.DoQuery();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 流程
        /// </summary>
        /// <param name="fl"></param>
        public void BindIt(BP.WF.Flow fl)
        {
            GenerWorkFlows gwfs = new GenerWorkFlows();
            QueryObject    qo   = new QueryObject(gwfs);

            qo.AddWhereInSQL(GenerWorkFlowAttr.WorkID, " SELECT WorkID FROM WF_GenerWorkFlow WHERE FK_Node IN ( SELECT FK_Node FROM WF_GenerWorkerlist WHERE FK_Emp='" + Web.WebUser.No + "' AND FK_Flow='" + fl.No + "' AND WORKID=WF_GenerWorkFlow.WORKID AND ISENABLE=1 ) ");
            qo.addOrderBy(GenerWorkFlowAttr.FK_Node, GenerWorkFlowAttr.WorkID);
            qo.DoQuery();


            if (gwfs.Count == 0)
            {
                this.UCFlow1.AddMsgOfInfo("流程" + fl.Name, "没有您[" + WebUser.No + WebUser.Name + "]的当前待办工作.");
            }

            if (gwfs.Count == 1)
            {
                this.Response.Redirect("MyFlow.aspx?FK_Flow=" + fl.No + "&WorkID=" + gwfs[0].GetValByKey(GenerWorkFlowAttr.WorkID).ToString(), true);
                return;
            }

            this.UCFlow1.AddTable();
            this.UCFlow1.AddCaptionLeft(fl.Name);
            this.UCFlow1.AddTR();
            this.UCFlow1.AddTDTitle("IDX");
            this.UCFlow1.AddTDTitle("标题");
            this.UCFlow1.AddTDTitle("停留节点");
            this.UCFlow1.AddTDTitle("发起日期");
            // this.UCFlow1.AddTDTitle("预先警日期");
            this.UCFlow1.AddTDTitle("应完成日期");
            this.UCFlow1.AddTDTitle("记录人");
            this.UCFlow1.AddTDTitle("工作序号");
            this.UCFlow1.AddTREnd();
            int i = 0;

            foreach (GenerWorkFlow gwf in gwfs)
            {
                i++;
                //this.AddTR("onmouseover='TROver(this)' onmouseout='TROut(this)' onclick=\"WinOpen('MyFlow.aspx?FK_Flow="+fl.No+"&WorkID="+dr[WorkAttr.OID ].ToString()+"' )\" " );
                this.UCFlow1.AddTR("title='在列表中根据标题选择您的代办工作' onmouseover='TROver(this)' onmouseout='TROut(this)' onclick=\"javascript:window.location.href='MyFlow.aspx?FK_Flow=" + fl.No + "&WorkID=" + gwf.WorkID + "'\" ");
                this.UCFlow1.AddTDIdx(i);
                this.UCFlow1.AddTD(gwf.Title);
                this.UCFlow1.AddTD(gwf.NodeName);
                this.UCFlow1.AddTD(gwf.RDT);
                this.UCFlow1.AddTD("");

                // this.UCFlow1.AddTD(gwf.w);
                // this.UCFlow1.AddTD(gwf.RDT);

                this.UCFlow1.AddTD(gwf.StarterName);
                //this.UCFlow1.AddTD(gwf.FK_Taxpayer);
                //this.UCFlow1.AddTD(gwf.TaxpayerName);
                this.UCFlow1.AddTD(gwf.WorkID);
                this.UCFlow1.AddTREnd();
            }
            this.UCFlow1.AddTableEnd();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 文件管理者
        /// </summary>
        /// <param name="EnName"></param>
        /// <param name="refval"></param>
        public SysFileManagers(string EnName, string refval)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(SysFileManagerAttr.EnName, EnName);
            qo.addAnd();
            qo.AddWhere(SysFileManagerAttr.RefVal, refval);
            qo.DoQuery();
        }
Ejemplo n.º 6
0
        public GenerWorkerLists(Int64 workId)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GenerWorkerListAttr.WorkID, workId);
            qo.addOrderBy(GenerWorkerListAttr.RDT);
            qo.DoQuery();
            return;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 取回任务集合
        /// </summary>
        public GetTasks(string fk_flow)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GetTaskAttr.FK_Flow, fk_flow);
            qo.addAnd();
            qo.AddWhereLen(GetTaskAttr.CheckNodes, " >= ", 3, SystemConfig.AppCenterDBType);
            qo.DoQuery();
        }
        /// <summary>
        /// 节点方向
        /// </summary>
        /// <param name="NodeID">节点ID</param>
        /// <param name="dirType">类型</param>
        public Directions(int NodeID, int dirType)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(DirectionAttr.Node, NodeID);
            qo.addAnd();
            qo.AddWhere(DirectionAttr.DirType, dirType);
            qo.DoQuery();
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="EnsName"></param>
        /// <param name="key"></param>
        public void Retrieve(string EnsName, string key)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(DefValAttr.AttrKey, key);
            qo.addAnd();
            qo.AddWhere(DefValAttr.EnsName, EnsName);
            qo.DoQuery();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 此节点的转向方向集合
        /// </summary>
        /// <param name="nodeID">此节点的ID</param>
        /// <param name="isLifecyle">是不是判断在节点的生存期内</param>
        /// <returns>转向方向集合(ToNodes)</returns>
        public Nodes GetHisToNodes(int nodeID, bool isLifecyle)
        {
            Nodes       nds = new Nodes();
            QueryObject qo  = new QueryObject(nds);

            qo.AddWhereInSQL(NodeAttr.NodeID, "SELECT ToNode FROM WF_Direction WHERE Node=" + nodeID);
            qo.DoQuery();
            return(nds);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 查询出来选择的人员
        /// </summary>
        /// <param name="fk_flow"></param>
        /// <param name="workid"></param>
        public SelectAccpers(Int64 workid)
        {
            BP.En.QueryObject qo = new QueryObject(this);
            qo.AddWhere(SelectAccperAttr.WorkID, workid);
            qo.addOrderByDesc(SelectAccperAttr.FK_Node, SelectAccperAttr.Idx);
            qo.DoQuery();

            //  this.Retrieve(SelectAccperAttr.WorkID, workid, SelectAccperAttr.Idx);
        }
Ejemplo n.º 12
0
    public void Save()
    {
        string      msg  = null;
        Entities    dtls = BP.DA.ClassFactory.GetEns(this.EnsName);
        Entity      en   = dtls.GetNewEntity;
        QueryObject qo   = new QueryObject(dtls);

        qo.DoQuery(en.PK, BP.SystemConfig.PageSize, this.PageIdx, false);
        Map map = dtls.GetNewEntity.EnMap;

        foreach (Entity dtl in dtls)
        {
            this.ucsys1.Copy(dtl, dtl.PKVal.ToString(), map);
            try
            {
                dtl.Update();
            }
            catch (Exception ex)
            {
                msg += "<hr>" + ex.Message;
            }
        }

        // BP.Sys.MapDtl
        en = this.ucsys1.Copy(en, "0", map);
        if (en.IsBlank == false)
        {
            if (en.IsNoEntity)
            {
                if (en.EnMap.IsAutoGenerNo)
                {
                    en.SetValByKey("No", en.GenerNewNoByKey("No"));
                }
            }

            try
            {
                en.Insert();
            }
            catch (Exception ex)
            {
                //msg += "<hr>" + ex.Message;
            }
        }

        if (msg != null)
        {
            this.Session["info1"] = msg;
            //this.ResponseWriteRedMsg(msg);
            this.Response.Redirect("Ens.aspx?EnsName=" + this.EnsName + "&PageIdx=" + this.PageIdx, true);
        }
        else
        {
            this.Response.Redirect("Ens.aspx?EnsName=" + this.EnsName + "&PageIdx=" + this.PageIdx, true);
        }
    }
Ejemplo n.º 13
0
        public MyDeptTodolist(Int64 workId)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(MyDeptTodolistAttr.WorkID, workId);
            if (qo.DoQuery() == 0)
            {
                throw new Exception("工作 MyDeptTodolist [" + workId + "]不存在。");
            }
        }
Ejemplo n.º 14
0
        public GenerWorkFlowView(Int64 workId)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GenerWorkFlowViewAttr.WorkID, workId);
            if (qo.DoQuery() == 0)
            {
                throw new Exception("工作 GenerWorkFlowView [" + workId + "]不存在。");
            }
        }
Ejemplo n.º 15
0
        public Monitor(Int64 workId)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(MonitorAttr.WorkID, workId);
            if (qo.DoQuery() == 0)
            {
                throw new Exception("工作 Monitor [" + workId + "]不存在。");
            }
        }
Ejemplo n.º 16
0
        public MyStartFlow(Int64 workId)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(MyStartFlowAttr.WorkID, workId);
            if (qo.DoQuery() == 0)
            {
                throw new Exception("工作 MyStartFlow [" + workId + "]不存在。");
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="workId"></param>
        /// <param name="nodeId"></param>
        public GenerWorkerLists(Int64 workId, int nodeId)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GenerWorkerListAttr.WorkID, workId);
            qo.addAnd();
            qo.AddWhere(GenerWorkerListAttr.FK_Node, nodeId);
            qo.DoQuery();
            return;
        }
Ejemplo n.º 18
0
        public int Retrieve(string fromDataTime, string toDataTime)
        {
            QueryObject qo = new QueryObject(this);

            qo.Top = 90000;
            qo.AddWhere(WorkAttr.RDT, " >=", fromDataTime);
            qo.addAnd();
            qo.AddWhere(WorkAttr.RDT, " <= ", toDataTime);
            return(qo.DoQuery());
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 产生分合流程控制流程
        /// </summary>
        /// <param name="FID"></param>
        public GenerFH(Int64 FID)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GenerFHAttr.FID, FID);
            if (qo.DoQuery() == 0)
            {
                throw new Exception("查询 GenerFH 工作[" + FID + "]不存在,可能是已经完成。");
            }
        }
Ejemplo n.º 20
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();
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 查询工作(不适合审核节点查询)
        /// </summary>
        /// <param name="empId">工作人员</param>
        /// <param name="nodeStat">节点状态</param>
        /// <param name="fromdate">记录日期从</param>
        /// <param name="todate">记录日期到</param>
        /// <returns></returns>
        public int Retrieve(string key, string empId, string fromdate, string todate)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(WorkAttr.Rec, empId);

            qo.addAnd();
            qo.AddWhere(WorkAttr.RDT, ">=", fromdate);
            qo.addAnd();
            qo.AddWhere(WorkAttr.RDT, "<=", todate);

            if (key.Trim().Length == 0)
            {
                return(qo.DoQuery());
            }
            else
            {
                if (key.IndexOf("%") == -1)
                {
                    key = "%" + key + "%";
                }
                Entity en = this.GetNewEntity;
                qo.addAnd();
                qo.addLeftBracket();
                qo.AddWhere(en.PK, " LIKE ", key);
                foreach (Attr attr in en.EnMap.Attrs)
                {
                    if (attr.MyFieldType == FieldType.RefText)
                    {
                        continue;
                    }
                    if (attr.UIContralType == UIContralType.DDL || attr.UIContralType == UIContralType.CheckBok)
                    {
                        continue;
                    }
                    qo.addOr();
                    qo.AddWhere(attr.Key, " LIKE ", key);
                }
                qo.addRightBracket();
                return(qo.DoQuery());
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 查询全部。
        /// </summary>
        /// <returns></returns>
        public override int RetrieveAll()
        {
            if (Web.WebUser.No == "admin")
            {
                return(base.RetrieveAll());
            }
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(DeptAttr.ParentNo, " = ", Web.WebUser.FK_Dept + "%");
            return(qo.DoQuery());
        }
Ejemplo n.º 23
0
        void ToolBar1_ButtonClick(object sender, EventArgs e)
        {
            Btn btn = sender as Btn;

            try
            {
                switch (btn.ID)
                {
                case NamesOfBtn.New:
                case NamesOfBtn.Save:
                case NamesOfBtn.SaveAndNew:
                    this.Save(false);
                    break;

                case NamesOfBtn.SaveAndClose:
                    this.Save(true);
                    break;

                case NamesOfBtn.Delete:
                    Entities    dtls = BP.DA.ClassFactory.GetEns(this.EnsName);
                    QueryObject qo   = new QueryObject(dtls);
                    qo.AddWhere(this.RefKey, this.RefVal);
                    qo.DoQuery("OID", BP.SystemConfig.PageSize, this.PageIdx, false);
                    foreach (Entity dtl in dtls)
                    {
                        CheckBox cb = this.ucsys1.GetCBByID("CB_" + dtl.PKVal);
                        if (cb == null)
                        {
                            continue;
                        }

                        if (cb.Checked)
                        {
                            dtl.Delete();
                        }
                    }
                    this.ucsys1.Clear();
                    this.Bind();
                    break;

                case NamesOfBtn.Excel:
                    this.ExpExcel();
                    break;

                default:
                    BP.PubClass.Alert("当前版本不支持此功能。");
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Alert(ex.Message);
            }
        }
Ejemplo n.º 24
0
        public int SearchMapAttrsYesVisable(string fk_map)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(MapAttrAttr.FK_MapData, fk_map);
            qo.addAnd();
            qo.AddWhere(MapAttrAttr.UIVisible, 1);
            qo.addOrderBy(MapAttrAttr.GroupID, MapAttrAttr.Idx);
            // qo.addOrderBy(MapAttrAttr.Idx);
            return(qo.DoQuery());
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 报表模板
        /// </summary>
        /// <param name="fk_emp">fk_emp</param>
        /// <param name="className">className</param>
        /// <param name="attrs">attrs</param>
        /// <returns>查询返回个数</returns>
        public int Search(string fk_emp, string className, string attrs)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GroupEnsTemplateAttr.Rec, fk_emp);
            qo.addAnd();
            qo.AddWhere(GroupEnsTemplateAttr.Attrs, className);
            qo.addAnd();
            qo.AddWhere(GroupEnsTemplateAttr.EnsName, className);
            return(qo.DoQuery());
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 节点表单
        /// </summary>
        /// <param name="NodeID">节点ID</param>
        public FrmNodes(string fk_flow, int nodeID)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(FrmNodeAttr.FK_Flow, fk_flow);
            qo.addAnd();
            qo.AddWhere(FrmNodeAttr.FK_Node, nodeID);

            qo.addOrderBy(FrmNodeAttr.Idx);
            qo.DoQuery();
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 按节点查询
        /// </summary>
        /// <param name="nd"></param>
        public BillTemplates(Node nd)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(BillTemplateAttr.NodeID, nd.NodeID);
            if (nd.IsStartNode)
            {
                qo.addOr();
                qo.AddWhere("No", "SLHZ");
            }
            qo.DoQuery();
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 转向此节点的集合的Nodes
        /// </summary>
        /// <param name="nodeID">此节点的ID</param>
        /// <returns>转向此节点的集合的Nodes (FromNodes)</returns>
        public Nodes GetHisFromNodes(int nodeID)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(DirectionAttr.ToNode, nodeID);
            qo.DoQuery();
            Nodes ens = new Nodes();

            foreach (Direction en in this)
            {
                ens.AddEntity(new Node(en.Node));
            }
            return(ens);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 得到他的部门权限
        /// </summary>
        /// <param name="empid">empid </param>
        /// <returns>Depts</returns>
        public Depts GetHisDepts(string empid)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(EmpDeptAttr.FK_Emp, empid);
            qo.DoQuery();
            Depts ens = new Depts();

            foreach (EmpDept en in this)
            {
                ens.AddEntity(new Dept(en.FK_Dept));
            }
            return(ens);
        }
Ejemplo n.º 30
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);
        }