Esempio n. 1
0
        /// <summary>
        /// 根据角色ID取得角色信息
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        public RoleInfo GetRoleById(string RoleId)
        {
            RoleInfo info = new RoleInfo();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(_SelectSql + " where roleid='" + RoleId + "'"))
            {
                if (reader.Read())
                {
                    info = BuilderEntity(reader);
                }
            }
            return(info);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="RoleId"></param>
        /// <param name="MoudleId"></param>
        /// <returns></returns>
        public int GetPowerValue(string RoleId, string MoudleId)
        {
            RoleMoudleInfo info = new RoleMoudleInfo();
            string         sql  = "Select sum(powervalue) powervalue From rolemoudleinfo where roleid in(" + RoleId + ") and moudleid='" + MoudleId + "'";

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                if (reader.Read())
                {
                    info.PowerValue = (reader.IsDBNull(reader.GetOrdinal("powervalue"))) ? int.Parse("0") : int.Parse(reader["powervalue"].ToString());
                }
            }
            return(int.Parse(info.PowerValue.ToString()));
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        public DictTypeInfo GetDictTypeInfo(string Code)
        {
            DictTypeInfo info = null;
            string       sql  = _SelectSql2 + string.Format(" Where code = '{0}'", Code);

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                if (reader.Read())
                {
                    info = BuilderDictType(reader);
                }
            }
            return(info);
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="MoudleId"></param>
        /// <returns></returns>
        public string GetCurrentLocation(string MoudleId)
        {
            string strSQL   = "select CONCAT((Select moudlename From moudleinfo Where moudleid =t.parentid ),'>>',t.moudlename) Location from moudleinfo t Where t.moudleid='" + MoudleId + "'";
            string Location = "";

            using (DbDataReader reader = DataBaseManage.ExecuteReader(strSQL))
            {
                while (reader.Read())
                {
                    Location = (reader.IsDBNull(reader.GetOrdinal("Location"))) ? "" : reader["Location"].ToString();
                }
            }
            return(Location);
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        public DictInfo GetDictInfo(string Code, string Type)
        {
            DictInfo info = null;
            string   sql  = _SelectSql + string.Format(" where code='{0}' and Type='{1}'", Code, Type);

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                if (reader.Read())
                {
                    info = BuilderEntity(reader);
                }
            }
            return(info);
        }
Esempio n. 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="MoudleId"></param>
        /// <returns></returns>
        public MoudleInfo GetMoudleInfo(string MoudleId)
        {
            MoudleInfo info = null;
            string     sql  = _SelectSql + " where moudleid='" + MoudleId + "'";

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                if (reader.Read())
                {
                    info = BuilderEntity(reader);
                }
            }
            return(info);
        }
Esempio n. 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="MoudleId"></param>
        /// <returns></returns>
        public DeptInfo GetDeptInfo(string DeptId)
        {
            DeptInfo info = null;
            string   sql  = _SelectSql + " where deptid='" + DeptId + "'";

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                if (reader.Read())
                {
                    info = BuilderEntity(reader);
                }
            }
            return(info);
        }
Esempio n. 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        public PostInfo GetPostInfo(string Code)
        {
            PostInfo info = null;
            string   Sql  = _SelectSql + string.Format(" where code = '{0}'", Code.Trim());

            using (DbDataReader reader = DataBaseManage.ExecuteReader(Sql))
            {
                if (reader.Read())
                {
                    info = BuilderEntity(reader);
                }
            }
            return(info);
        }
Esempio n. 9
0
        /// <summary>
        /// 得到列表
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public List <syslogInfo> GetsyslogList(string Where)
        {
            List <syslogInfo> list = new List <syslogInfo>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(DalSql + Where))
            {
                while (reader.Read())
                {
                    syslogInfo ent = new syslogInfo();
                    SetEnt(ent, reader);
                    list.Add(ent);
                }
            }
            return(list);
        }
Esempio n. 10
0
        /// <summary>
        /// 得到列表
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public List <BuGastankRepair> GetBuGastankRepairList(string Where)
        {
            List <BuGastankRepair> list = new List <BuGastankRepair>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(DalSql + Where))
            {
                while (reader.Read())
                {
                    BuGastankRepair ent = new BuGastankRepair();
                    SetEnt(ent, reader);
                    list.Add(ent);
                }
            }
            return(list);
        }
Esempio n. 11
0
        /// <summary>
        /// 得到列表
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public List <BuScheduleApply> GetBuScheduleApplyList(string Where)
        {
            List <BuScheduleApply> list = new List <BuScheduleApply>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(DalSql + Where))
            {
                while (reader.Read())
                {
                    BuScheduleApply ent = new BuScheduleApply();
                    SetEnt(ent, reader);
                    list.Add(ent);
                }
            }
            return(list);
        }
Esempio n. 12
0
        /// <summary>
        /// 得到列表
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public List <BuWFRelationship> GetBuWFRelationshipList(string Where)
        {
            List <BuWFRelationship> list = new List <BuWFRelationship>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(DalSql + Where))
            {
                while (reader.Read())
                {
                    BuWFRelationship ent = new BuWFRelationship();
                    SetEnt(ent, reader);
                    list.Add(ent);
                }
            }
            return(list);
        }
Esempio n. 13
0
        /// <summary>
        /// 得到列表
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public List <BuWorkFlow> GetBuWorkFlowList(string Where)
        {
            List <BuWorkFlow> list = new List <BuWorkFlow>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(DalSql + Where))
            {
                while (reader.Read())
                {
                    BuWorkFlow ent = new BuWorkFlow();
                    SetEnt(ent, reader);
                    list.Add(ent);
                }
            }
            return(list);
        }
Esempio n. 14
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <DeptInfo> GetDeptAll()
        {
            List <DeptInfo> list = new List <DeptInfo>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(_SelectSql))
            {
                if (reader != null)
                {
                    while (reader.Read())
                    {
                        list.Add(BuilderEntity(reader));
                    }
                }
            }
            return(list);
        }
Esempio n. 15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strUsl"></param>
        /// <returns></returns>
        public string Exists(string strUsl)
        {
            string Sql = string.Format("select moudleid from moudleinfo  Where url = '{0}'", strUsl);

            using (DbDataReader reader = DataBaseManage.ExecuteReader(Sql))
            {
                if (reader.Read())
                {
                    return((reader.IsDBNull(reader.GetOrdinal("moudleid"))) ? "" : reader["moudleid"].ToString());
                }
                else
                {
                    return("");
                }
            }
        }
Esempio n. 16
0
        /// <summary>
        /// 取得所有角色
        /// </summary>
        /// <returns></returns>
        public List <RoleInfo> GetRoleAll()
        {
            List <RoleInfo> ListInfo = new List <RoleInfo>();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(_SelectSql))
            {
                if (reader != null)
                {
                    while (reader.Read())
                    {
                        ListInfo.Add(BuilderEntity(reader));
                    }
                }
            }
            return(ListInfo);
        }
Esempio n. 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="PowerId"></param>
        /// <returns></returns>
        public PowerInfo GetPowerInfo(string PowerId)
        {
            string    Sql  = "Select powerid, powername, powervalue, moudleid From powerinfo where powerid='" + PowerId + "'";
            PowerInfo info = new PowerInfo();

            using (DbDataReader reader = DataBaseManage.ExecuteReader(Sql))
            {
                if (reader.Read())
                {
                    info.MoudleId   = (reader.IsDBNull(reader.GetOrdinal("moudleid"))) ? "" : reader["moudleid"].ToString();
                    info.PowerId    = (reader.IsDBNull(reader.GetOrdinal("powerid"))) ? "" : reader["powerid"].ToString();
                    info.PowerName  = (reader.IsDBNull(reader.GetOrdinal("powername"))) ? "" : reader["powername"].ToString();
                    info.PowerValue = (reader.IsDBNull(reader.GetOrdinal("powervalue"))) ? int.Parse("0") : int.Parse(reader["powervalue"].ToString());
                }
            }
            return(info);
        }
Esempio n. 18
0
        /// <summary>
        /// 根据用户代码取得单个用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public UserInfo GetUserInfoByUserCode(string UserCode)
        {
            UserInfo info = null;
            string   sql  = _SelectSql + " where usercode='" + UserCode + "'";

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                if (reader != null)
                {
                    while (reader.Read())
                    {
                        info = BuilderEntity(reader);
                    }
                }
            }
            return(info);
        }
Esempio n. 19
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <MoudleInfo> GetMoudleAll()
        {
            List <MoudleInfo> list = new List <MoudleInfo>();
            string            sql  = _SelectSql + " order by Sort";

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                if (reader != null)
                {
                    while (reader.Read())
                    {
                        list.Add(BuilderEntity(reader));
                    }
                }
            }
            return(list);
        }
Esempio n. 20
0
        /// <summary>
        /// 根据部门类型取得部门列表
        /// </summary>
        /// <param name="Type">部门类型</param>
        /// <returns></returns>
        public List <DeptInfo> GetDeptByType(string Type)
        {
            List <DeptInfo> list = new List <DeptInfo>();
            string          Sql  = _SelectSql + string.Format(" where DEPTTYPE='{0}'", Type);

            using (DbDataReader reader = DataBaseManage.ExecuteReader(Sql))
            {
                if (reader != null)
                {
                    while (reader.Read())
                    {
                        list.Add(BuilderEntity(reader));
                    }
                }
            }
            return(list);
        }
Esempio n. 21
0
        /// <summary>
        /// 取得所有用户
        /// </summary>
        /// <returns></returns>
        public List <UserInfo> GetUserAll()
        {
            List <UserInfo> list = new List <UserInfo>();
            string          sql  = _SelectSql + " where ISENABLE ='Y' ";

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                if (reader != null)
                {
                    while (reader.Read())
                    {
                        list.Add(BuilderEntity(reader));
                    }
                }
            }
            return(list);
        }
Esempio n. 22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        public List <RoleMoudleInfo> GetRoleMoudle(string RoleId)
        {
            List <RoleMoudleInfo> ListInfo = new List <RoleMoudleInfo>();
            RoleMoudleInfo        info     = null;
            string sql = "Select roleid, moudleid,powervalue From rolemoudleinfo where roleid='" + RoleId.ToString() + "'";

            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql))
            {
                while (reader.Read())
                {
                    info            = new RoleMoudleInfo();
                    info.MoudleId   = (reader.IsDBNull(reader.GetOrdinal("moudleid"))) ? int.Parse("0") : int.Parse(reader["moudleid"].ToString());
                    info.RoleId     = (reader.IsDBNull(reader.GetOrdinal("roleid"))) ? int.Parse("0") : int.Parse(reader["roleid"].ToString());
                    info.PowerValue = (reader.IsDBNull(reader.GetOrdinal("powervalue"))) ? int.Parse("0") : int.Parse(reader["powervalue"].ToString());
                    ListInfo.Add(info);
                }
            }
            return(ListInfo);
        }
Esempio n. 23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Condition"></param>
        /// <returns></returns>
        public List <DictInfo> GetDictInfoByCondition(DictInfo Condition)
        {
            List <DictInfo> list = new List <DictInfo>();
            StringBuilder   Sql  = new StringBuilder();

            Sql.Append(_SelectSql);
            Sql.Append("    where 1=1 ");
            if (Condition != null)
            {
                if (Condition.Code.Trim() != "")
                {
                    Sql.Append("    and code='" + Condition.Code.Trim() + "'");
                }
                if (Condition.Name.Trim() != "")
                {
                    Sql.Append("    and Name like '%" + Condition.Name.Trim() + "%'");
                }
                if (Condition.TypeCode != "")
                {
                    Sql.Append("    and Type = '" + Condition.TypeCode + "'");
                }
                if (Condition.IsEnable != "")
                {
                    Sql.Append("    and isenable = '" + Condition.IsEnable + "'");
                }
                else
                {
                    Sql.Append("    and isenable='Y' ");
                }
            }
            Sql.Append(" Order By Type,Sort ");
            using (DbDataReader reader = DataBaseManage.ExecuteReader(Sql.ToString()))
            {
                if (reader != null)
                {
                    while (reader.Read())
                    {
                        list.Add(BuilderEntity(reader));
                    }
                }
            }
            return(list);
        }
Esempio n. 24
0
        /// <summary>
        /// 根据RelationshipId得到 BuWFRelationship 实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public BuWFRelationship GetBuWFRelationship(int RelationshipId)
        {
            BuWFRelationship ent = null;
            string           sql = DalSql;

            sql = sql + " And  RelationshipId";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("RelationshipId", RelationshipId)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new BuWFRelationship();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }
Esempio n. 25
0
        /// <summary>
        /// 根据WorkflowGUID得到 BuWorkFlow 实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public BuWorkFlow GetBuWorkFlow(string WorkflowGUID)
        {
            BuWorkFlow ent = null;
            string     sql = DalSql;

            sql = sql + " And  WorkflowGUID";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("WorkflowGUID", WorkflowGUID)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new BuWorkFlow();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }
Esempio n. 26
0
        /// <summary>
        /// 根据ProcessId得到 BuWFProcess 实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public BuWFProcess GetBuWFProcess(int ProcessId)
        {
            BuWFProcess ent = null;
            string      sql = DalSql;

            sql = sql + " And  ProcessId";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("ProcessId", ProcessId)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new BuWFProcess();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }
Esempio n. 27
0
        /// <summary>
        /// 根据TypeId得到 BuTypeInfo 实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public BuTypeInfo GetBuTypeInfo(int TypeId)
        {
            BuTypeInfo ent = null;
            string     sql = DalSql;

            sql = sql + " And  TypeId";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("TypeId", TypeId)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new BuTypeInfo();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }
Esempio n. 28
0
        /// <summary>
        /// 根据ApplyId得到 BuScheduleApply 实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public BuScheduleApply GetBuScheduleApply(string ApplyId)
        {
            BuScheduleApply ent = null;
            string          sql = DalSql;

            sql = sql + " And  ApplyId";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("ApplyId", ApplyId)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new BuScheduleApply();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }
Esempio n. 29
0
        /// <summary>
        /// 根据Id得到
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public syslogInfo Getsyslog(long ID)
        {
            syslogInfo ent = null;
            string     sql = DalSql;

            sql = sql + " And  ID=@ID ";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("ID", ID)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new syslogInfo();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }
Esempio n. 30
0
        /// <summary>
        /// 根据GasRepairId得到 BuGastankRepair 实体
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public BuGastankRepair GetBuGastankRepair(int GasRepairId)
        {
            BuGastankRepair ent = null;
            string          sql = DalSql;

            sql = sql + " And  GasRepairId";
            MySqlParameter[] paras = new MySqlParameter[]
            {
                new MySqlParameter("GasRepairId", GasRepairId)
            };
            using (DbDataReader reader = DataBaseManage.ExecuteReader(sql, paras))
            {
                if (reader.Read())
                {
                    ent = new BuGastankRepair();
                    SetEnt(ent, reader);
                }
            }
            return(ent);
        }