Пример #1
0
        public bool Full(string enumKey)
        {
            Entities ens = (Entities)Cash.GetObjFormApplication("EnumOf" + enumKey + Web.WebUser.SysLang, null);

            if (ens != null)
            {
                this.AddEntities(ens);
                return(true);
            }

            QueryObject qo = new QueryObject(this);

            qo.AddWhere(SysEnumAttr.EnumKey, enumKey);
            qo.addAnd();
            qo.AddWhere(SysEnumAttr.Lang, Web.WebUser.SysLang);
            qo.addOrderBy(SysEnumAttr.IntKey);
            if (qo.DoQuery() == 0)
            {
                /* 看看xml配置里面是否有?*/
                return(false);
            }

            Cash.AddObj("EnumOf" + enumKey + Web.WebUser.SysLang, Depositary.Application, this);
            return(true);
        }
Пример #2
0
        void btn_Del_Click(object sender, EventArgs e)
        {
            try
            {
                // 检查这个类型是否被使用?
                MapAttrs    attrs = new MapAttrs();
                QueryObject qo    = new QueryObject(attrs);
                qo.AddWhere(MapAttrAttr.MyDataType, (int)FieldTypeS.Enum);
                qo.addAnd();
                qo.AddWhere(MapAttrAttr.KeyOfEn, this.RefNo);
                int i = qo.DoQuery();
                if (i == 0)
                {
                    BP.Sys.SysEnums ses = new SysEnums();
                    ses.Delete(BP.Sys.SysEnumAttr.EnumKey, this.RefNo);

                    BP.Sys.SysEnumMain m = new SysEnumMain();
                    m.No = this.RefNo;
                    m.Delete();
                    this.ToMsgPage("删除成功");
                    return;
                }

                string msg = "错误:下列数据已经引用了枚举您不能删除它。";   // "错误:下列数据已经引用了枚举您不能删除它。";
                foreach (MapAttr attr in attrs)
                {
                    msg += "\t\n" + attr.Field + "" + attr.Name + " Table = " + attr.FK_MapData;
                }
                return;
            }
            catch (Exception ex)
            {
                this.ToErrorPage(ex.Message);
            }
        }
Пример #3
0
 /// <summary>
 /// 执行
 /// </summary>
 /// <returns>返回执行结果</returns>
 public override object Do()
 {
     try
     {
         string    sql = "select NO from Sys_MapData where No not in(select No from Sys_MapDtl) and No not like '%Rpt'";
         DataTable dt  = DBAccess.RunSQLReturnTable(sql);
         if (dt != null)
         {
             foreach (DataRow row in dt.Rows)
             {
                 MapAttrs    attrs = new MapAttrs();
                 QueryObject qo    = new QueryObject(attrs);
                 qo.AddWhere(MapAttrAttr.FK_MapData, row["NO"].ToString());
                 qo.addAnd();
                 qo.AddWhere(MapAttrAttr.UIVisible, true);
                 qo.addOrderBy(MapAttrAttr.Y, MapAttrAttr.X);
                 qo.DoQuery();
                 int rowIdx = 0;
                 foreach (MapAttr mapAttr in attrs)
                 {
                     mapAttr.Idx = rowIdx;
                     mapAttr.DirectUpdate();
                     rowIdx++;
                 }
             }
         }
         return("执行成功...");
     }
     catch (Exception ex)
     {
     }
     return("执行失败...");
 }
Пример #4
0
        /// <summary>
        /// 撤销发送
        /// </summary>
        public void UnSend()
        {
            /*撤销发送*/
            this.Pub2.AddEasyUiPanelInfoBegin("撤销发送");


            //查询是否有权限撤销发送
            GenerWorkerLists workerlists = new GenerWorkerLists();

            QueryObject info = new QueryObject(workerlists);

            info.AddWhere(GenerWorkerListAttr.FK_Emp, WebUser.No);
            info.addAnd();
            info.AddWhere(GenerWorkerListAttr.IsPass, "1");
            info.addAnd();
            info.AddWhere(GenerWorkerListAttr.IsEnable, "1");
            info.addAnd();
            info.AddWhere(GenerWorkerListAttr.WorkID, this.WorkID);
            int count = info.DoQuery();

            if (count > 0)
            {
                this.Pub2.Add("<a href =\"javascript:UnSend('" + this.FK_Flow + "','" + this.WorkID + "','" + FID + "')\" >撤销发送</a>");
            }
            else
            {
                this.Pub2.Add("您没有此权限.");
            }

            this.Pub2.AddEasyUiPanelInfoEnd();
            Pub2.AddBR();
        }
Пример #5
0
        void btn_Del_Click(object sender, EventArgs e)
        {
            try
            {
                // 检查这个类型是否被使用?
                MapAttrs    attrs = new MapAttrs();
                QueryObject qo    = new QueryObject(attrs);
                qo.AddWhere(MapAttrAttr.MyDataType, (int)FieldTypeS.FK);
                qo.addAnd();
                qo.AddWhere(MapAttrAttr.KeyOfEn, this.RefNo);
                int i = qo.DoQuery();
                if (i == 0)
                {
                    BP.Sys.SFTable m = new SFTable();
                    m.No = this.RefNo;
                    m.Delete();
                    this.ToMsgPage("外键删除成功");
                    return;
                }

                string msg = "错误:下列数据已经引用了外键您不能删除它。";
                foreach (MapAttr attr in attrs)
                {
                    msg += "\t\n" + attr.Field + "" + attr.Name + " 表" + attr.FK_MapData;
                }

                throw new Exception(msg);
            }
            catch (Exception ex)
            {
                this.ToErrorPage(ex.Message);
            }
        }
Пример #6
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public string Search_Search()
        {
            string TSpan   = this.GetRequestVal("TSpan");
            string FK_Flow = this.GetRequestVal("FK_Flow");

            GenerWorkFlows gwfs = new GenerWorkFlows();
            QueryObject    qo   = new QueryObject(gwfs);

            qo.AddWhere(GenerWorkFlowAttr.Emps, " LIKE ", "%" + BP.Web.WebUser.No + "%");
            if (!DataType.IsNullOrEmpty(TSpan))
            {
                qo.addAnd();
                qo.AddWhere(GenerWorkFlowAttr.TSpan, this.GetRequestVal("TSpan"));
            }
            if (!DataType.IsNullOrEmpty(FK_Flow))
            {
                qo.addAnd();
                qo.AddWhere(GenerWorkFlowAttr.FK_Flow, this.GetRequestVal("FK_Flow"));
            }
            qo.Top = 50;

            if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL)
            {
                qo.DoQuery();
                DataTable dt = gwfs.ToDataTableField("Ens");
                return(BP.Tools.Json.ToJson(dt));
            }
            else
            {
                DataTable dt = qo.DoQueryToTable();
                return(BP.Tools.Json.ToJson(dt));
            }
        }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="emp"></param>
        public WFSealDatas(string workID, string node)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(WFSealDataAttr.OID, workID);
            qo.AddWhere(WFSealDataAttr.FK_Node, node);
            qo.DoQuery();
        }
Пример #8
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();
        }
Пример #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();
        }
Пример #10
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();
        }
        /// <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();
        }
Пример #12
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();
        }
Пример #13
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;
        }
Пример #14
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());
        }
Пример #15
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());
        }
Пример #16
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();
        }
Пример #17
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());
        }
Пример #18
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();
        }
Пример #19
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);
        }
Пример #20
0
        /// <summary>
        /// 查询全部。
        /// </summary>
        /// <returns></returns>
        public override int RetrieveAll()
        {
            if (BP.Web.WebUser.No == "admin")
            {
                return(base.RetrieveAll());
            }

            QueryObject qo = new QueryObject(this);

            qo.AddWhere(DeptAttr.No, " = ", BP.Web.WebUser.FK_Dept);
            qo.addOr();
            qo.AddWhere(DeptAttr.ParentNo, " = ", BP.Web.WebUser.FK_Dept);
            return(qo.DoQuery());
        }
Пример #21
0
        /// <summary>
        /// 工作者
        /// </summary>
        /// <param name="workId">工作者ID</param>
        /// <param name="flowNo">流程编号</param>
        public GenerWorkerLists(Int64 workId, string flowNo)
        {
            if (workId == 0)
            {
                return;
            }

            Flow        fl = new Flow(flowNo);
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GenerWorkerListAttr.WorkID, workId);
            qo.addAnd();
            qo.AddWhere(GenerWorkerListAttr.FK_Flow, flowNo);
            qo.DoQuery();
        }
Пример #22
0
        /// <summary>
        /// 可退回的节点
        /// </summary>
        /// <param name="NodeNo">NodeNo </param>
        public NodeReturns(string NodeNo)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(NodeReturnAttr.ReturnTo, NodeNo);
            qo.DoQuery();
        }
Пример #23
0
        /// <summary>
        /// 可退回的节点
        /// </summary>
        /// <param name="NodeID">节点ID</param>
        public NodeReturns(int NodeID)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(NodeReturnAttr.FK_Node, NodeID);
            qo.DoQuery();
        }
Пример #24
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="EnsName"></param>
        public RptTemplates(string EnsName)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(RptTemplateAttr.EnsName, EnsName);
            qo.DoQuery();
        }
        /// <summary>
        /// 流程部门数据查询权限
        /// </summary>
        /// <param name="FK_Emp">FK_Emp</param>
        public DeptFlowSearchs(string FK_Emp)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(DeptFlowSearchAttr.FK_Emp, FK_Emp);
            qo.DoQuery();
        }
Пример #26
0
        /// <summary>
        /// 工作人员与项目组集合
        /// </summary>
        public EmpPrjExts(string GroupNo)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(EmpPrjExtAttr.FK_Prj, GroupNo);
            qo.DoQuery();
        }
Пример #27
0
        /// <summary>
        /// 工作人员与部门集合
        /// </summary>
        /// <param name="FK_Emp">FK_Emp</param>
        public EmpDepts(string FK_Emp)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(EmpDeptAttr.FK_Emp, FK_Emp);
            qo.DoQuery();
        }
Пример #28
0
        /// <summary>
        /// 按节点查询
        /// </summary>
        /// <param name="fk_node">节点ID</param>
        public BillTemplates(int fk_node)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(BillTemplateAttr.NodeID, fk_node);
            qo.DoQuery();
        }
Пример #29
0
        /// <summary>
        /// 节点部门
        /// </summary>
        /// <param name="StationNo">StationNo </param>
        public NodeDepts(string StationNo)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(NodeDeptAttr.FK_Dept, StationNo);
            qo.DoQuery();
        }
Пример #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 求已经填写的默认值.
            Entities ens = BP.En.ClassFactory.GetEns(this.EnsName);
            Entity   en  = ens.GetNewEntity;

            BP.En.QueryObject qo = new QueryObject(ens);
            if (en.EnMap.Attrs.Contains("Rec") == true)
            {
                qo.AddWhere("Rec", BP.Web.WebUser.No);
            }
            qo.Top = 12;
            DataTable dt = qo.DoQueryToTable();


            //求设置的默认值。
            string    sql  = "SELECT a.CurValue, 1 as IsDef FROM Sys_DefVal a  WHERE (A.FK_Emp='" + WebUser.No + "' OR A.FK_Emp='admin') AND FK_MapData='" + this.EnsName + "' AND NodeAttrKey='" + this.Field + "' ";
            DataTable mydt = BP.DA.DBAccess.RunSQLReturnTable(sql);

            foreach (DataRow dr in dt.Rows)
            {
                DataRow row = mydt.NewRow();
                row[0] = dr[this.Field];
                row[1] = 0;
                mydt.Rows.Add(row);
            }
        }