Beispiel #1
0
        ///<summary>
        /// Astroloji Data Select
        ///</summary>
        public static AstrolojiCollection GetSelect()
        {
            AstrolojiCollection rvAstroloji = new AstrolojiCollection();

            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 astroloji", conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvAstroloji.Add(new Astroloji(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToByte(IDR["burcid"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvAstroloji);
        }
Beispiel #2
0
        /// <summary>
        /// Astroloji Liste Getir
        /// </summary>
        public static AstrolojiCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters)
        {
            AstrolojiCollection rvAstroloji = new AstrolojiCollection();

            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())
                        {
                            rvAstroloji.Add(new Astroloji(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToByte(IDR["burcid"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvAstroloji);
        }