Ejemplo n.º 1
0
        ///<summary>
        /// Profil Data Select
        ///</summary>
        public static ProfilCollection GetSelect()
        {
            ProfilCollection rvProfil = new ProfilCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from profil", conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvProfil.Add(new Profil(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToString(IDR["url"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["web"]), MConvert.NullToString(IDR["telefon"]), MConvert.NullToString(IDR["gsm"]), MConvert.NullToString(IDR["meslek"]), MConvert.NullToString(IDR["egitim"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToString(IDR["hakkimda"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvProfil);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Profil Liste Getir
        /// </summary>
        public static ProfilCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters)
        {
            ProfilCollection rvProfil = new ProfilCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(cmdType, sqlQuery, conneciton))
                {
                    if (parameters != null)
                    {
                        foreach (MParameter item in parameters)
                        {
                            cmd.Parameters.Add(item);
                        }
                    }
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvProfil.Add(new Profil(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToString(IDR["url"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["web"]), MConvert.NullToString(IDR["telefon"]), MConvert.NullToString(IDR["gsm"]), MConvert.NullToString(IDR["meslek"]), MConvert.NullToString(IDR["egitim"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToString(IDR["hakkimda"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvProfil);
        }