Exemplo n.º 1
0
        public IList<Core.Business.Web_Manager> GetAllList()
        {
            IList<Core.Business.Web_Manager> web_Managerlist = new List<Core.Business.Web_Manager>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllWeb_Manager);

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.Web_Manager web_Manager = new Core.Business.Web_Manager();

                    if (!reader.IsDBNull(0)) web_Manager.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) web_Manager.Manager_AddDate = reader.GetDateTime(1);
                    if (!reader.IsDBNull(2)) web_Manager.Manager_Code = reader.GetString(2);
                    if (!reader.IsDBNull(3)) web_Manager.Manage_Pass = reader.GetString(3);
                    if (!reader.IsDBNull(4)) web_Manager.Manage_RealName = reader.GetString(4);

                    web_Manager.MarkOld();
                    web_Managerlist.Add(web_Manager);
                }
                reader.Close();
            }
            return web_Managerlist;
        }
Exemplo n.º 2
0
        public Core.Business.Web_Manager Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Manage_ID", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectWeb_Manager);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.Web_Manager web_Manager = new Core.Business.Web_Manager();

                if (!reader.IsDBNull(0)) web_Manager.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) web_Manager.Manager_AddDate = reader.GetDateTime(1);
                if (!reader.IsDBNull(2)) web_Manager.Manager_Code = reader.GetString(2);
                if (!reader.IsDBNull(3)) web_Manager.Manage_Pass = reader.GetString(3);
                if (!reader.IsDBNull(4)) web_Manager.Manage_RealName = reader.GetString(4);

                return web_Manager;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }