Esempio n. 1
0
        ///<summary>
        /// Hesap Data PrimaryKey
        ///</summary>
        public static Hesap GetHesap(System.Guid pID)
        {
            Hesap rvHesap = new Hesap();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM Hesap WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", pID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvHesap = new Hesap(MConvert.NullToGuid(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;
                }
            }
            rvHesap.ProfilObject = ProfilMethods.GetProfil(rvHesap.ID);
            return(rvHesap);
        }
Esempio n. 2
0
        /// <summary>
        /// Hesap Getir
        /// </summary>
        public static Hesap GetHesap(CommandType cmdType, string sqlQuery, MParameterCollection parameters)
        {
            Hesap rvHesap = new Hesap();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                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 = new Hesap(MConvert.NullToGuid(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;
                }
            }
            rvHesap.ProfilObject = ProfilMethods.GetProfil(rvHesap.ID);
            return(rvHesap);
        }