/// <summary>
        /// 返回满足查询条件的项目基本信息实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>项目基本信息实体列表</returns>
        public IList <Sys_ProjInfo> GetSys_ProjInfos(QueryParameter param)
        {
            string sql = @"SELECT KeyId, ProjName, ProjFullName, ProjStage, ProjCode, ProjDetails, OnlineDate, Director, DBIPAdd, DBName, DBUser, DBPwd, Status, Remark, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn FROM dbo.Sys_ProjInfo";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_ProjInfo> list = new List <Sys_ProjInfo>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_ProjInfo sys_ProjInfo = new Sys_ProjInfo();

                    sys_ProjInfo.KeyId        = (int)dr["KeyId"];
                    sys_ProjInfo.ProjName     = (string)dr["ProjName"];
                    sys_ProjInfo.ProjFullName = (string)dr["ProjFullName"];
                    sys_ProjInfo.ProjStage    = dr["ProjStage"] == DBNull.Value ? null : (string)dr["ProjStage"];
                    sys_ProjInfo.ProjCode     = (string)dr["ProjCode"];
                    sys_ProjInfo.ProjDetails  = dr["ProjDetails"] == DBNull.Value ? null : (string)dr["ProjDetails"];
                    sys_ProjInfo.OnlineDate   = dr["OnlineDate"] == DBNull.Value ? null : (DateTime?)dr["OnlineDate"];
                    sys_ProjInfo.Director     = dr["Director"] == DBNull.Value ? null : (string)dr["Director"];
                    sys_ProjInfo.DBIPAdd      = dr["DBIPAdd"] == DBNull.Value ? null : (string)dr["DBIPAdd"];
                    sys_ProjInfo.DBName       = dr["DBName"] == DBNull.Value ? null : (string)dr["DBName"];
                    sys_ProjInfo.DBUser       = dr["DBUser"] == DBNull.Value ? null : (string)dr["DBUser"];
                    sys_ProjInfo.DBPwd        = dr["DBPwd"] == DBNull.Value ? null : (string)dr["DBPwd"];
                    sys_ProjInfo.Status       = (bool)dr["Status"];
                    sys_ProjInfo.Remark       = dr["Remark"] == DBNull.Value ? null : (string)dr["Remark"];
                    sys_ProjInfo.CreatedBy    = (int)dr["CreatedBy"];
                    sys_ProjInfo.CreatedOn    = (DateTime)dr["CreatedOn"];
                    sys_ProjInfo.ModifiedBy   = dr["ModifiedBy"] == DBNull.Value ? null : (int?)dr["ModifiedBy"];
                    sys_ProjInfo.ModifiedOn   = dr["ModifiedOn"] == DBNull.Value ? null : (DateTime?)dr["ModifiedOn"];

                    list.Add(sys_ProjInfo);
                }
            }

            return(list);
        }
Example #2
0
        /// <summary>
        /// 返回满足查询条件的业务单位类型,该表不做显示维护实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>业务单位类型,该表不做显示维护实体列表</returns>
        public IList <Sys_BusiUnitType> GetSys_BusiUnitTypes(QueryParameter param)
        {
            string sql = @"SELECT KeyId, BusiUnitTypeCode, BusiUnitTypeName, BusiUnitTypeShortName, ParentID, Status, DisplayOrder, Remark, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn FROM dbo.Sys_BusiUnitType";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_BusiUnitType> list = new List <Sys_BusiUnitType>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_BusiUnitType sys_BusiUnitType = new Sys_BusiUnitType();

                    sys_BusiUnitType.KeyId                 = (int)dr["KeyId"];
                    sys_BusiUnitType.BusiUnitTypeCode      = dr["BusiUnitTypeCode"] == DBNull.Value ? null : (string)dr["BusiUnitTypeCode"];
                    sys_BusiUnitType.BusiUnitTypeName      = (string)dr["BusiUnitTypeName"];
                    sys_BusiUnitType.BusiUnitTypeShortName = dr["BusiUnitTypeShortName"] == DBNull.Value ? null : (string)dr["BusiUnitTypeShortName"];
                    sys_BusiUnitType.ParentID              = dr["ParentID"] == DBNull.Value ? null : (int?)dr["ParentID"];
                    sys_BusiUnitType.Status                = (bool)dr["Status"];
                    sys_BusiUnitType.DisplayOrder          = (int)dr["DisplayOrder"];
                    sys_BusiUnitType.Remark                = dr["Remark"] == DBNull.Value ? null : (string)dr["Remark"];
                    sys_BusiUnitType.CreatedBy             = (int)dr["CreatedBy"];
                    sys_BusiUnitType.CreatedOn             = (DateTime)dr["CreatedOn"];
                    sys_BusiUnitType.ModifiedBy            = dr["ModifiedBy"] == DBNull.Value ? null : (int?)dr["ModifiedBy"];
                    sys_BusiUnitType.ModifiedOn            = dr["ModifiedOn"] == DBNull.Value ? null : (DateTime?)dr["ModifiedOn"];

                    list.Add(sys_BusiUnitType);
                }
            }

            return(list);
        }
        /// <summary>
        /// 返回满足查询条件的角色功能对应表实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>角色功能对应表实体列表</returns>
        public IList <Sys_RoleModules> GetSys_RoleModuless(QueryParameter param)
        {
            string sql = @"SELECT KeyId, ProjID, RoleId, ModulesID, PrivilegeMask, Status, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn FROM dbo.Sys_RoleModules";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_RoleModules> list = new List <Sys_RoleModules>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_RoleModules sys_RoleModules = new Sys_RoleModules();

                    sys_RoleModules.KeyId         = (int)dr["KeyId"];
                    sys_RoleModules.ProjID        = (int)dr["ProjID"];
                    sys_RoleModules.RoleId        = (int)dr["RoleId"];
                    sys_RoleModules.ModulesID     = (int)dr["ModulesID"];
                    sys_RoleModules.PrivilegeMask = (int)dr["PrivilegeMask"];
                    sys_RoleModules.Status        = (bool)dr["Status"];
                    sys_RoleModules.CreatedBy     = (int)dr["CreatedBy"];
                    sys_RoleModules.CreatedOn     = (DateTime)dr["CreatedOn"];
                    sys_RoleModules.ModifiedBy    = dr["ModifiedBy"] == DBNull.Value ? null : (int?)dr["ModifiedBy"];
                    sys_RoleModules.ModifiedOn    = dr["ModifiedOn"] == DBNull.Value ? null : (DateTime?)dr["ModifiedOn"];

                    list.Add(sys_RoleModules);
                }
            }

            return(list);
        }
        /// <summary>
        /// 返回满足查询条件的一个人可能属于多个单位实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>一个人可能属于多个单位实体列表</returns>
        public IList <Sys_PersonBusiUnit> GetSys_PersonBusiUnits(QueryParameter param)
        {
            string sql = @"SELECT KeyId, PersonID, BusiUnitID, IsMaster, BeginDate, EndDate, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn FROM dbo.Sys_PersonBusiUnit";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_PersonBusiUnit> list = new List <Sys_PersonBusiUnit>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_PersonBusiUnit sys_PersonBusiUnit = new Sys_PersonBusiUnit();

                    sys_PersonBusiUnit.KeyId      = (int)dr["KeyId"];
                    sys_PersonBusiUnit.PersonID   = (int)dr["PersonID"];
                    sys_PersonBusiUnit.BusiUnitID = (int)dr["BusiUnitID"];
                    sys_PersonBusiUnit.IsMaster   = (Int16)dr["IsMaster"];
                    sys_PersonBusiUnit.BeginDate  = (DateTime)dr["BeginDate"];
                    sys_PersonBusiUnit.EndDate    = dr["EndDate"] == DBNull.Value ? null : (DateTime?)dr["EndDate"];
                    sys_PersonBusiUnit.CreatedBy  = (int)dr["CreatedBy"];
                    sys_PersonBusiUnit.CreatedOn  = (DateTime)dr["CreatedOn"];
                    sys_PersonBusiUnit.ModifiedBy = dr["ModifiedBy"] == DBNull.Value ? null : (int?)dr["ModifiedBy"];
                    sys_PersonBusiUnit.ModifiedOn = dr["ModifiedOn"] == DBNull.Value ? null : (DateTime?)dr["ModifiedOn"];

                    list.Add(sys_PersonBusiUnit);
                }
            }

            return(list);
        }
Example #5
0
        /// <summary>
        /// 返回满足查询条件的Log_Login实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>Log_Login实体列表</returns>
        public IList <Log_Login> GetLog_Logins(QueryParameter param)
        {
            string sql = @"SELECT KeyId, PersonId, LoginIP, LoginHostName, LoginMac, LoginTime, LogoutTime FROM dbo.Log_Login";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Log_Login> list = new List <Log_Login>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Log_Login log_Login = new Log_Login();

                    log_Login.KeyId         = (int)dr["KeyId"];
                    log_Login.PersonId      = (int)dr["PersonId"];
                    log_Login.LoginIP       = (string)dr["LoginIP"];
                    log_Login.LoginHostName = (string)dr["LoginHostName"];
                    log_Login.LoginMac      = (string)dr["LoginMac"];
                    log_Login.LoginTime     = (DateTime)dr["LoginTime"];
                    log_Login.LogoutTime    = dr["LogoutTime"] == DBNull.Value ? null : (DateTime?)dr["LogoutTime"];

                    list.Add(log_Login);
                }
            }

            return(list);
        }
Example #6
0
        /// <summary>
        /// 返回满足查询条件的Sys_PersonDeskTopConfig实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>Sys_PersonDeskTopConfig实体列表</returns>
        public IList <Sys_PersonDeskTopConfig> GetSys_PersonDeskTopConfigs(QueryParameter param)
        {
            string sql = @"SELECT KeyId, PersonId, ConfigName, ConfigValue, CreateDate, ModifiedDate FROM dbo.Sys_PersonDeskTopConfig";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_PersonDeskTopConfig> list = new List <Sys_PersonDeskTopConfig>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_PersonDeskTopConfig sys_PersonDeskTopConfig = new Sys_PersonDeskTopConfig();

                    sys_PersonDeskTopConfig.KeyId        = (int)dr["KeyId"];
                    sys_PersonDeskTopConfig.PersonId     = (int)dr["PersonId"];
                    sys_PersonDeskTopConfig.ConfigName   = (string)dr["ConfigName"];
                    sys_PersonDeskTopConfig.ConfigValue  = (string)dr["ConfigValue"];
                    sys_PersonDeskTopConfig.CreateDate   = dr["CreateDate"] == DBNull.Value ? null : (DateTime?)dr["CreateDate"];
                    sys_PersonDeskTopConfig.ModifiedDate = dr["ModifiedDate"] == DBNull.Value ? null : (DateTime?)dr["ModifiedDate"];

                    list.Add(sys_PersonDeskTopConfig);
                }
            }

            return(list);
        }
        /// <summary>
        /// 返回满足查询条件的Log_Operate实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>Log_Operate实体列表</returns>
        public IList <Log_Operate> GetLog_Operates(QueryParameter param)
        {
            string sql = @"SELECT KeyId, PersonId, OperateTime, OperateModule, OperateType, OperateFunction FROM dbo.Log_Operate";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Log_Operate> list = new List <Log_Operate>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Log_Operate log_Operate = new Log_Operate();

                    log_Operate.KeyId           = (int)dr["KeyId"];
                    log_Operate.PersonId        = (int)dr["PersonId"];
                    log_Operate.OperateTime     = (DateTime)dr["OperateTime"];
                    log_Operate.OperateModule   = (int)dr["OperateModule"];
                    log_Operate.OperateType     = (string)dr["OperateType"];
                    log_Operate.OperateFunction = dr["OperateFunction"] == DBNull.Value ? null : (string)dr["OperateFunction"];

                    list.Add(log_Operate);
                }
            }

            return(list);
        }
Example #8
0
        /// <summary>
        /// 返回满足查询条件的数据表对象(DataTable)
        /// </summary>
        /// <param name="commandText"></param>
        /// <param name="param"></param>
        /// <param name="transaction"></param>
        /// <returns></returns>
        protected DataTable GetDataTable(string commandText, QueryParameter param, DbTransaction transaction)
        {
            try
            {
                if (string.IsNullOrEmpty(commandText))
                {
                    throw new ArgumentNullException("commandText 不允许为空!");
                }

                if (param != null)
                {
                    commandText = QueryParameter.CompleteSqlString(commandText, param);
                }

                Database  db      = DatabaseFactory.CreateDatabase(DBLink.BusiDBLink.ToString());
                DbCommand command = db.GetSqlStringCommand(commandText);
                command.CommandTimeout = 300000;

                if (param != null)
                {
                    //设置参数
                    foreach (IExpression exp in param.WhereExpressions)
                    {
                        if (exp is SimpleExpression)
                        {
                            SimpleExpression simple = exp as SimpleExpression;
                            db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                        }
                    }
                }

                DataSet dataSet = transaction == null?db.ExecuteDataSet(command) : db.ExecuteDataSet(commandText, transaction);

                if (dataSet == null || dataSet.Tables.Count == 0)
                {
                    throw new ApplicationException("执行查询出现异常, 无法返回指定的数据表!");
                }

                return(dataSet.Tables[0]);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 返回满足查询条件的Log_SqlError实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>Log_SqlError实体列表</returns>
        public IList <Log_SqlError> GetLog_SqlErrors(QueryParameter param)
        {
            string sql = @"SELECT KeyId, SPName, Description, LogTime FROM dbo.Log_SqlError";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Log_SqlError> list = new List <Log_SqlError>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Log_SqlError log_SqlError = new Log_SqlError();

                    log_SqlError.KeyId       = (int)dr["KeyId"];
                    log_SqlError.SPName      = (string)dr["SPName"];
                    log_SqlError.Description = (string)dr["Description"];
                    log_SqlError.LogTime     = (DateTime)dr["LogTime"];

                    list.Add(log_SqlError);
                }
            }

            return(list);
        }
Example #10
0
        /// <summary>
        /// 返回满足查询条件的Sys_PersonDeskTopIconSet实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>Sys_PersonDeskTopIconSet实体列表</returns>
        public IList <Sys_PersonDeskTopIconSet> GetSys_PersonDeskTopIconSets(QueryParameter param)
        {
            string sql = @"SELECT KeyId, ModuleId, PersonId, IconFileName FROM dbo.Sys_PersonDeskTopIconSet";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_PersonDeskTopIconSet> list = new List <Sys_PersonDeskTopIconSet>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_PersonDeskTopIconSet sys_PersonDeskTopIconSet = new Sys_PersonDeskTopIconSet();

                    sys_PersonDeskTopIconSet.KeyId        = (int)dr["KeyId"];
                    sys_PersonDeskTopIconSet.ModuleId     = (int)dr["ModuleId"];
                    sys_PersonDeskTopIconSet.PersonId     = (int)dr["PersonId"];
                    sys_PersonDeskTopIconSet.IconFileName = (string)dr["IconFileName"];

                    list.Add(sys_PersonDeskTopIconSet);
                }
            }

            return(list);
        }
Example #11
0
        /// <summary>
        /// 返回满足查询条件的业务单位信息实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>业务单位信息实体列表</returns>
        public IList <Sys_BusiUnit> GetSys_BusiUnits(QueryParameter param)
        {
            string sql = @"SELECT KeyId, BusiUnitTypeID, RegionCode, BusiUnitCode, BusiUnitName, ShortName, HelperCode, OrderId, Address, ParentId, WebSiteUrl, FtpSiteUrl, Telephone1, Telephone2, Fax, E_Mail, X, Y, IsSaleCount, Status, Remark, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn FROM dbo.Sys_BusiUnit";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_BusiUnit> list = new List <Sys_BusiUnit>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_BusiUnit sys_BusiUnit = new Sys_BusiUnit();

                    sys_BusiUnit.KeyId          = (int)dr["KeyId"];
                    sys_BusiUnit.BusiUnitTypeID = (int)dr["BusiUnitTypeID"];
                    sys_BusiUnit.RegionCode     = dr["RegionCode"] == DBNull.Value ? null : (string)dr["RegionCode"];
                    sys_BusiUnit.BusiUnitCode   = dr["BusiUnitCode"] == DBNull.Value ? null : (string)dr["BusiUnitCode"];
                    sys_BusiUnit.BusiUnitName   = (string)dr["BusiUnitName"];
                    sys_BusiUnit.ShortName      = dr["ShortName"] == DBNull.Value ? null : (string)dr["ShortName"];
                    sys_BusiUnit.HelperCode     = dr["HelperCode"] == DBNull.Value ? null : (string)dr["HelperCode"];
                    sys_BusiUnit.OrderId        = dr["OrderId"] == DBNull.Value ? null : (int?)dr["OrderId"];
                    sys_BusiUnit.Address        = dr["Address"] == DBNull.Value ? null : (string)dr["Address"];
                    sys_BusiUnit.ParentId       = dr["ParentId"] == DBNull.Value ? null : (int?)dr["ParentId"];
                    sys_BusiUnit.WebSiteUrl     = dr["WebSiteUrl"] == DBNull.Value ? null : (string)dr["WebSiteUrl"];
                    sys_BusiUnit.FtpSiteUrl     = dr["FtpSiteUrl"] == DBNull.Value ? null : (string)dr["FtpSiteUrl"];
                    sys_BusiUnit.Telephone1     = dr["Telephone1"] == DBNull.Value ? null : (string)dr["Telephone1"];
                    sys_BusiUnit.Telephone2     = dr["Telephone2"] == DBNull.Value ? null : (string)dr["Telephone2"];
                    sys_BusiUnit.Fax            = dr["Fax"] == DBNull.Value ? null : (string)dr["Fax"];
                    sys_BusiUnit.E_Mail         = dr["E_Mail"] == DBNull.Value ? null : (string)dr["E_Mail"];
                    sys_BusiUnit.X           = dr["X"] == DBNull.Value ? null : (decimal?)dr["X"];
                    sys_BusiUnit.Y           = dr["Y"] == DBNull.Value ? null : (decimal?)dr["Y"];
                    sys_BusiUnit.IsSaleCount = (int)dr["IsSaleCount"];
                    sys_BusiUnit.Status      = (bool)dr["Status"];
                    sys_BusiUnit.Remark      = dr["Remark"] == DBNull.Value ? null : (string)dr["Remark"];
                    sys_BusiUnit.CreatedBy   = (int)dr["CreatedBy"];
                    sys_BusiUnit.CreatedOn   = (DateTime)dr["CreatedOn"];
                    sys_BusiUnit.ModifiedBy  = dr["ModifiedBy"] == DBNull.Value ? null : (int?)dr["ModifiedBy"];
                    sys_BusiUnit.ModifiedOn  = dr["ModifiedOn"] == DBNull.Value ? null : (DateTime?)dr["ModifiedOn"];

                    list.Add(sys_BusiUnit);
                }
            }

            return(list);
        }
Example #12
0
        /// <summary>
        /// 返回满足查询条件的项目模块实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>项目模块实体列表</returns>
        public IList <Sys_Modules> GetSys_Moduless(QueryParameter param)
        {
            string sql = @"SELECT KeyId, ProjID, ModuleCode, ModuleName, ShortName, ParentId, UrlString, ModuleEntry, ModuleIconS, ModuleIconB, IsShowInDeskTop, OpenType, Status, Hint, DisplayOrder, DisplayPrivilegeMask, HelpUrlString, Remark, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn FROM dbo.Sys_Modules";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_Modules> list = new List <Sys_Modules>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_Modules sys_Modules = new Sys_Modules();

                    sys_Modules.KeyId                = (int)dr["KeyId"];
                    sys_Modules.ProjID               = (int)dr["ProjID"];
                    sys_Modules.ModuleCode           = (string)dr["ModuleCode"];
                    sys_Modules.ModuleName           = (string)dr["ModuleName"];
                    sys_Modules.ShortName            = dr["ShortName"] == DBNull.Value ? null : (string)dr["ShortName"];
                    sys_Modules.ParentId             = dr["ParentId"] == DBNull.Value ? null : (int?)dr["ParentId"];
                    sys_Modules.UrlString            = dr["UrlString"] == DBNull.Value ? null : (string)dr["UrlString"];
                    sys_Modules.ModuleEntry          = dr["ModuleEntry"] == DBNull.Value ? null : (string)dr["ModuleEntry"];
                    sys_Modules.ModuleIconS          = dr["ModuleIconS"] == DBNull.Value ? null : (string)dr["ModuleIconS"];
                    sys_Modules.ModuleIconB          = dr["ModuleIconB"] == DBNull.Value ? null : (string)dr["ModuleIconB"];
                    sys_Modules.IsShowInDeskTop      = (bool)dr["IsShowInDeskTop"];
                    sys_Modules.OpenType             = dr["OpenType"] == DBNull.Value ? null : (int?)dr["OpenType"];
                    sys_Modules.Status               = (bool)dr["Status"];
                    sys_Modules.Hint                 = dr["Hint"] == DBNull.Value ? null : (string)dr["Hint"];
                    sys_Modules.DisplayOrder         = dr["DisplayOrder"] == DBNull.Value ? null : (int?)dr["DisplayOrder"];
                    sys_Modules.DisplayPrivilegeMask = dr["DisplayPrivilegeMask"] == DBNull.Value ? null : (int?)dr["DisplayPrivilegeMask"];
                    sys_Modules.HelpUrlString        = dr["HelpUrlString"] == DBNull.Value ? null : (string)dr["HelpUrlString"];
                    sys_Modules.Remark               = dr["Remark"] == DBNull.Value ? null : (string)dr["Remark"];
                    sys_Modules.CreatedBy            = (int)dr["CreatedBy"];
                    sys_Modules.CreatedOn            = (DateTime)dr["CreatedOn"];
                    sys_Modules.ModifiedBy           = dr["ModifiedBy"] == DBNull.Value ? null : (int?)dr["ModifiedBy"];
                    sys_Modules.ModifiedOn           = dr["ModifiedOn"] == DBNull.Value ? null : (DateTime?)dr["ModifiedOn"];

                    list.Add(sys_Modules);
                }
            }

            return(list);
        }
Example #13
0
        /// <summary>
        /// 返回满足查询条件的人员基本信息实体列表
        /// </summary>
        /// <param name="param">查询条件</param>
        /// <returns>人员基本信息实体列表</returns>
        public IList <Sys_Person> GetSys_Persons(QueryParameter param)
        {
            string sql = @"SELECT KeyId, PersonCode, WorkNo, PersonName, DomainAcc, PassWord, SexId, Birthday, IDCard, Photo, Nation, NativePlace, PoliticalId, JoinDate, EducationId, GraduateFrom, Perfessional, Ability, IsFulltime, WorkType, WorkStartDate, JobLevel, JobSure, DutyId, DutySure, Contact, Officephone, Homephone, Mobilephone, HomeAddress, PostCode, EMail, Certificate, Status, DisplayOrder, Remark, HelperCode, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn FROM dbo.Sys_Person";

            if (param != null)
            {
                sql = QueryParameter.CompleteSqlString(sql, param);
            }

            Database  db      = DatabaseFactory.CreateDatabase(DBLink.SysDBLink.ToString());
            DbCommand command = db.GetSqlStringCommand(sql);

            if (param != null)
            {
                //设置参数
                foreach (IExpression exp in param.WhereExpressions)
                {
                    if (exp is SimpleExpression)
                    {
                        SimpleExpression simple = exp as SimpleExpression;
                        db.AddInParameter(command, simple.ExpName, simple.DbType, simple.Value);
                    }
                }
            }

            IList <Sys_Person> list = new List <Sys_Person>();

            using (IDataReader dr = db.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    Sys_Person sys_Person = new Sys_Person();

                    sys_Person.KeyId         = (int)dr["KeyId"];
                    sys_Person.PersonCode    = (string)dr["PersonCode"];
                    sys_Person.WorkNo        = dr["WorkNo"] == DBNull.Value ? null : (string)dr["WorkNo"];
                    sys_Person.PersonName    = (string)dr["PersonName"];
                    sys_Person.DomainAcc     = (string)dr["DomainAcc"];
                    sys_Person.PassWord      = (string)dr["PassWord"];
                    sys_Person.SexId         = (int)dr["SexId"];
                    sys_Person.Birthday      = dr["Birthday"] == DBNull.Value ? null : (DateTime?)dr["Birthday"];
                    sys_Person.IDCard        = dr["IDCard"] == DBNull.Value ? null : (string)dr["IDCard"];
                    sys_Person.Photo         = dr["Photo"] == DBNull.Value ? null : (byte[])dr["Photo"];
                    sys_Person.Nation        = dr["Nation"] == DBNull.Value ? null : (string)dr["Nation"];
                    sys_Person.NativePlace   = dr["NativePlace"] == DBNull.Value ? null : (string)dr["NativePlace"];
                    sys_Person.PoliticalId   = dr["PoliticalId"] == DBNull.Value ? null : (int?)dr["PoliticalId"];
                    sys_Person.JoinDate      = dr["JoinDate"] == DBNull.Value ? null : (DateTime?)dr["JoinDate"];
                    sys_Person.EducationId   = dr["EducationId"] == DBNull.Value ? null : (int?)dr["EducationId"];
                    sys_Person.GraduateFrom  = dr["GraduateFrom"] == DBNull.Value ? null : (string)dr["GraduateFrom"];
                    sys_Person.Perfessional  = dr["Perfessional"] == DBNull.Value ? null : (string)dr["Perfessional"];
                    sys_Person.Ability       = dr["Ability"] == DBNull.Value ? null : (string)dr["Ability"];
                    sys_Person.IsFulltime    = dr["IsFulltime"] == DBNull.Value ? null : (bool?)dr["IsFulltime"];
                    sys_Person.WorkType      = dr["WorkType"] == DBNull.Value ? null : (int?)dr["WorkType"];
                    sys_Person.WorkStartDate = dr["WorkStartDate"] == DBNull.Value ? null : (DateTime?)dr["WorkStartDate"];
                    sys_Person.JobLevel      = dr["JobLevel"] == DBNull.Value ? null : (int?)dr["JobLevel"];
                    sys_Person.JobSure       = dr["JobSure"] == DBNull.Value ? null : (DateTime?)dr["JobSure"];
                    sys_Person.DutyId        = dr["DutyId"] == DBNull.Value ? null : (int?)dr["DutyId"];
                    sys_Person.DutySure      = dr["DutySure"] == DBNull.Value ? null : (DateTime?)dr["DutySure"];
                    sys_Person.Contact       = dr["Contact"] == DBNull.Value ? null : (string)dr["Contact"];
                    sys_Person.Officephone   = dr["Officephone"] == DBNull.Value ? null : (string)dr["Officephone"];
                    sys_Person.Homephone     = dr["Homephone"] == DBNull.Value ? null : (string)dr["Homephone"];
                    sys_Person.Mobilephone   = dr["Mobilephone"] == DBNull.Value ? null : (string)dr["Mobilephone"];
                    sys_Person.HomeAddress   = dr["HomeAddress"] == DBNull.Value ? null : (string)dr["HomeAddress"];
                    sys_Person.PostCode      = dr["PostCode"] == DBNull.Value ? null : (string)dr["PostCode"];
                    sys_Person.EMail         = dr["EMail"] == DBNull.Value ? null : (string)dr["EMail"];
                    sys_Person.Certificate   = dr["Certificate"] == DBNull.Value ? null : (string)dr["Certificate"];
                    sys_Person.Status        = (bool)dr["Status"];
                    sys_Person.DisplayOrder  = dr["DisplayOrder"] == DBNull.Value ? null : (int?)dr["DisplayOrder"];
                    sys_Person.Remark        = dr["Remark"] == DBNull.Value ? null : (string)dr["Remark"];
                    sys_Person.HelperCode    = dr["HelperCode"] == DBNull.Value ? null : (string)dr["HelperCode"];
                    sys_Person.CreatedBy     = (int)dr["CreatedBy"];
                    sys_Person.CreatedOn     = (DateTime)dr["CreatedOn"];
                    sys_Person.ModifiedBy    = dr["ModifiedBy"] == DBNull.Value ? null : (int?)dr["ModifiedBy"];
                    sys_Person.ModifiedOn    = dr["ModifiedOn"] == DBNull.Value ? null : (DateTime?)dr["ModifiedOn"];

                    list.Add(sys_Person);
                }
            }

            return(list);
        }