Ejemplo n.º 1
0
        public SurveyCheckRec()
        {
            CheckDate = DateTime.Today;
            CheckType = new SurveyCheckType(0, "");
            Name      = new Person(0);

            SurveyCode       = new Survey();
            ReferenceSurveys = new BindingList <SurveyCheckRefSurvey>();

            Comments = "";
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the user profile for the specified username.
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        public static List <SurveyCheckType> GetSurveyCheckTypes()
        {
            List <SurveyCheckType> records = new List <SurveyCheckType>();

            string query = "SELECT * FROM qrySurveyCheckTypes ORDER BY ID";

            using (SqlDataAdapter sql = new SqlDataAdapter())
                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ISISConnectionString"].ConnectionString))
                {
                    conn.Open();

                    sql.SelectCommand = new SqlCommand(query, conn);


                    try
                    {
                        using (SqlDataReader rdr = sql.SelectCommand.ExecuteReader())
                        {
                            while (rdr.Read())
                            {
                                SurveyCheckType r = new SurveyCheckType();

                                r.ID        = (int)rdr["ID"];
                                r.CheckName = rdr.SafeGetString("CheckType");

                                records.Add(r);
                            }
                        }
                    }
                    catch (Exception)
                    {
                        int i = 0;
                    }
                }

            return(records);
        }