Ejemplo n.º 1
0
        /// <summary>
        /// Author: Dalton Cleveland
        /// Created : 3/5/2019
        /// RetrieveAllMaintenanceStatusTypes will select all of the MaintenanceStatusTypes from our Database
        /// </summary>
        public List <MaintenanceStatusType> RetrieveAllMaintenanceStatusTypes()
        {
            List <MaintenanceStatusType> maintenanceStatusTypes = new List <MaintenanceStatusType>();

            var conn = DBConnection.GetDbConnection();

            // command text
            string cmdText2 = @"sp_retrieve_maintenance_status_types";

            // command objects
            var cmd2 = new SqlCommand(cmdText2, conn);

            // set the command type
            cmd2.CommandType = CommandType.StoredProcedure;

            try
            {
                conn.Open();
                SqlDataReader reader2 = cmd2.ExecuteReader();
                if (reader2.HasRows)
                {
                    while (reader2.Read())
                    {
                        MaintenanceStatusType maintenanceStatusType = new MaintenanceStatusType();
                        maintenanceStatusType.MaintenanceStatusID = reader2.GetString(0);
                        maintenanceStatusType.Description         = reader2.GetString(1);
                        maintenanceStatusTypes.Add(maintenanceStatusType);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                conn.Close();
            }
            return(maintenanceStatusTypes);
        }
Ejemplo n.º 2
0
 public void DeleteMaintenanceStatusType(MaintenanceStatusType deletedMaintenanceStatusType)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 public void CreateMaintenanceStatusType(MaintenanceStatusType newMaintenanceStatusType)
 {
     throw new NotImplementedException();
 }