Example #1
0
        public List <Positions> GetPositions()
        {
            List <Positions> positionsList   = new List <Positions>();
            SqlConnection    connection      = P299DB.GetConnection();
            string           selectStatement =
                "SELECT JobID, PositionName, PositionType, PositionDescription, Notes, CompanyID " +
                "FROM Job_ID_Table " +
                "ORDER BY PositionName";
            SqlCommand selectCommand = new SqlCommand(selectStatement, connection);

            try
            {
                connection.Open();
                SqlDataReader reader = selectCommand.ExecuteReader();
                while (reader.Read())
                {
                    Positions position = new Positions();
                    position.JobName     = reader["PositionName"].ToString();
                    position.JobType     = reader["PositionType"].ToString();
                    position.Description = reader["PositionDescription"].ToString();
                    position.Notes       = reader["Notes"].ToString();
                    positionsList.Add(position);
                }
                reader.Close();
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(positionsList);
        }
Example #2
0
        public List <Industry> GetIndustry()
        {
            List <Industry> industryList    = new List <Industry>();
            SqlConnection   connection      = P299DB.GetConnection();
            string          selectStatement =
                "SELECT IndustryID, IndustryType, IndustryDescription, Notes " +
                "FROM Industry_Table " +
                "ORDER BY IndustryID";
            SqlCommand selectCommand = new SqlCommand(selectStatement, connection);

            try
            {
                connection.Open();
                SqlDataReader reader = selectCommand.ExecuteReader();
                while (reader.Read())
                {
                    Industry industry = new Industry();
                    industry.IndustType     = reader["IndustryType"].ToString();
                    industry.IndustDescript = reader["IndustryDescription"].ToString();
                    industry.Notes          = reader["Notes"].ToString();
                    industryList.Add(industry);
                }
                reader.Close();
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(industryList);
        }
        public List <Interview> GetPositionsDetails()
        {
            List <Interview> replysList      = new List <Interview>();
            SqlConnection    connection      = P299DB.GetConnection();
            string           selectStatement =
                "SELECT InterviewID, CompanyID, ContactID, JobID, InterviewDate, Outcome, Notes " +
                "FROM InterviewReply " +
                "ORDER BY CompanyID";
            SqlCommand selectCommand = new SqlCommand(selectStatement, connection);

            try
            {
                connection.Open();
                SqlDataReader reader = selectCommand.ExecuteReader();
                while (reader.Read())
                {
                    Interview reply = new Interview();
                    reply.InterviewDate = (DateTime)reader["InterviewDate"];
                    reply.Outcome       = reader["Outcome"].ToString();
                    reply.Notes         = reader["Notes"].ToString();
                    replysList.Add(reply);
                }
                reader.Close();
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(replysList);
        }
Example #4
0
        public List <Company> GetCompDetails()
        {
            List <Company> compList        = new List <Company>();
            SqlConnection  connection      = P299DB.GetConnection();
            string         selectStatement =
                "SELECT CompanyID, IndustryID, CompanyName, CompanyStreet, CompanyCity " +
                "CompanyZip, CompanyDescription, CompanyPhone, CompanyFax, WebAddress, Notes " +
                "FROM Company_Table " +
                "Order BY CompanyName";
            SqlCommand selectCommand = new SqlCommand(selectStatement, connection);

            try
            {
                connection.Open();
                SqlDataReader reader = selectCommand.ExecuteReader();
                while (reader.Read())
                {
                    Company company = new Company();
                    company.CorpName    = reader["CompanyName"].ToString();
                    company.CorpAddress = reader["CompanyStreet"].ToString();
                    company.CorpCity    = reader["CompanyCity"].ToString();
                    company.CorpZip     = reader["CompanyZip"].ToString();
                    company.CorpPhone   = reader["CompanyPhone"].ToString();
                    company.CorpFax     = reader["CompanyFax"].ToString();
                    company.WebAddress  = reader["WebAddress"].ToString();
                    company.Notes       = reader["Notes"].ToString();
                    compList.Add(company);
                }
                reader.Close();
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(compList);
        }
Example #5
0
        public List <Contacts> GetContactDetails()
        {
            List <Contacts> contactsList    = new List <Contacts>();
            SqlConnection   connection      = P299DB.GetConnection();
            string          selectStatement =
                "SELECT ContactID, CompanyID, LastName, FirstName, Contact'sTitle, " +
                "MethodOFContact, ContactPhone, Notes " +
                "FROM Contact_Person_Table " +
                "ORDER BY ContactID";
            SqlCommand selectCommand = new SqlCommand(selectStatement, connection);

            try
            {
                connection.Open();
                SqlDataReader reader = selectCommand.ExecuteReader();
                while (reader.Read())
                {
                    Contacts contact = new Contacts();
                    contact.LastName      = reader["LastName"].ToString();
                    contact.FirstName     = reader["FirstName"].ToString();
                    contact.ContactTitle  = reader["Contact'sTitle"].ToString();
                    contact.MethOfContact = reader["MethodOfContact"].ToString();
                    contact.PhoneNum      = reader["ContactPhone"].ToString();
                    contact.Notes         = reader["Notes"].ToString();
                    contactList.Add(contact);
                }
                reader.Close();
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(contactList);
        }