示例#1
0
        public List <SYS_CCU> SelectAllSYS_CCU()
        {
            List <SYS_CCU> sys_ccu = new List <SYS_CCU>();
            DbDataReader   reader  = null;
            DbConnection   conn    = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[SYS_CCU_SelectAll]", (DbParameter[])null);
                if (reader.HasRows)
                {
                    SYS_CCUDataAccess.SetListSYS_CCUInfo(ref reader, ref sys_ccu);
                }
                return(sys_ccu);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" SYS_CCUDataAccess.SelectAll: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
示例#2
0
        public List <SYS_CCU> SelectAllSYS_CCU_ByDateTime(DateTime TuDateTime, DateTime DenDateTime)
        {
            List <SYS_CCU> sys_ccu = new List <SYS_CCU>();
            DbDataReader   reader  = null;
            DbConnection   conn    = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                List <DbParameter> para = new List <DbParameter>();

                para.Add(_DbHelper.CreateParameter("TuDateTime", TuDateTime, false));
                para.Add(_DbHelper.CreateParameter("DenDateTime", DenDateTime, false));

                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[SelectAllSYS_CCU_ByDateTime]", para.ToArray());
                if (reader.HasRows)
                {
                    SYS_CCUDataAccess.SetListSYS_CCUInfo(ref reader, ref sys_ccu);
                }
                return(sys_ccu);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" SYS_CCUDataAccess.SelectAll: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }