Esempio n. 1
0
        public IEnumerable <CategoryLog> GetAllCategoryLogs()
        {
            List <CategoryLog> categoryLogs = new List <CategoryLog>();

            using (OracleConnection connection = new OracleConnection(_connectionString))
            {
                using (OracleCommand command = connection.CreateCommand())
                {
                    connection.Open();

                    command.BindByName  = true;
                    command.CommandText = "Select * From CATEGORY_LOG";

                    OracleDataReader reader = command.ExecuteReader();

                    while (reader.Read())
                    {
                        CategoryLog categoryLog = new CategoryLog
                        {
                            LogId   = Convert.ToInt32(reader["LOG_ID"]),
                            LogType = reader["LOG_TYPE"].ToString(),
                            NewName = reader["NEW_NAME"].ToString(),
                            OldName = reader["OLD_NAME"].ToString(),
                            LogDate = reader["LOG_DATE"].ToString(),
                        };

                        categoryLogs.Add(categoryLog);
                    }
                }
            }
            return(categoryLogs);
        }
Esempio n. 2
0
 public static CategoryLog WithLog(this CategoryLog categoryLog, Log log)
 {
     categoryLog.Log = log;
     return(categoryLog);
 }
Esempio n. 3
0
 public static CategoryLog WithLogID(this CategoryLog categoryLog, Int32 logID)
 {
     categoryLog.LogID = logID;
     return(categoryLog);
 }
Esempio n. 4
0
 public static CategoryLog WithCategory(this CategoryLog categoryLog, Category category)
 {
     categoryLog.Category = category;
     return(categoryLog);
 }
Esempio n. 5
0
 public static CategoryLog WithCategoryID(this CategoryLog categoryLog, Int32 categoryID)
 {
     categoryLog.CategoryID = categoryID;
     return(categoryLog);
 }