コード例 #1
0
ファイル: SYS_LogDataAccess.cs プロジェクト: tayduivn/GNDN
        public SYS_Log SelectSYS_Logstr(string connect, int ID)
        {
            SYS_Log sys_log = new SYS_Log();
            DbDataReader reader = null;
            DbConnection connection = _DbHelper.CreateConnection(connect);
            connection.Open();
            try
            {
                List<DbParameter> para = new List<DbParameter>();
                para.Add(_DbHelper.CreateParameter(FIELD_ID, ID, false));

                reader = _DbHelper.ExecuteReader(connection, Common.DatabaseSchema + "[SYS_Log_SelectById]", para.ToArray());
                if (reader.HasRows && reader.Read())
                    SYS_LogDataAccess.SetSYS_LogInfo(reader, ref sys_log);

            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("SYS_LogDataAccess.SelectById: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                    reader.Close();
                connection.Close();
            }
            return sys_log;
        }
コード例 #2
0
        private static void SetBindingListSYS_LogInfo(ref DbDataReader reader, ref BindingList <SYS_Log> sys_logs)
        {
            SYS_Log sys_log = null;

            while (reader.Read())
            {
                sys_log = new SYS_Log();
                SYS_LogDataAccess.SetSYS_LogInfo(reader, ref sys_log);
                sys_logs.Add(sys_log);
            }
        }