Example #1
0
        ///<summary>
        /// Hesap Data Select
        ///</summary>
        public static HesapCollection GetSelect()
        {
            HesapCollection rvHesap = new HesapCollection();

            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 id,concat(adi,' ',soyadi) adi from hesap where aktivasyon=1 and aktif=1 and tipi in(1,2,3,5)", conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvHesap.Add(new Hesap {
                                ID = MConvert.NullToGuidString(IDR["id"]), Adi = MConvert.NullToString(IDR["adi"])
                            });
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvHesap);
        }
Example #2
0
        public static HesapCollection GetSelect(string query, bool isProfilObjects)
        {
            HesapCollection rvHesap = new HesapCollection();

            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, query, conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvHesap.Add(new Hesap(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToString(IDR["ip"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["soyadi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["sifre"]), MConvert.NullToString(IDR["roller"]), MConvert.NullToString(IDR["onaykodu"]), MConvert.NullToDateTime(IDR["dogumtarihi"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToByte(IDR["cinsiyet"]), MConvert.NullToByte(IDR["tipi"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["abonelik"]), MConvert.NullToBool(IDR["aktivasyon"]), MConvert.NullToBool(IDR["aktif"]), isProfilObjects));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvHesap);
        }
Example #3
0
        /// <summary>
        /// Hesap Liste Getir
        /// </summary>
        public static HesapCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters)
        {
            HesapCollection rvHesap = new HesapCollection();

            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())
                        {
                            rvHesap.Add(new Hesap(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToString(IDR["ip"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["soyadi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["sifre"]), MConvert.NullToString(IDR["roller"]), MConvert.NullToString(IDR["onaykodu"]), MConvert.NullToDateTime(IDR["dogumtarihi"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToByte(IDR["cinsiyet"]), MConvert.NullToByte(IDR["tipi"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["abonelik"]), MConvert.NullToBool(IDR["aktivasyon"]), MConvert.NullToBool(IDR["aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvHesap);
        }