Exemple #1
0
        ///<summary>
        /// Hesap Data PrimaryKey
        ///</summary>
        public static Hesap GetHesap(System.String pid)
        {
            Hesap rvHesap = new Hesap();

            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 hesap where id=?id limit 1", conneciton))
                {
                    cmd.Parameters.Add("id", pid, MSqlDbType.VarChar);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvHesap = 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;
                }
                rvHesap.ProfilObject = ProfilMethods.GetProfil(rvHesap.ID);
            }
            return(rvHesap);
        }
Exemple #2
0
        ///<summary>
        /// Hesap Data Delete
        ///</summary>
        public static int Delete(Hesap p)
        {
            int rowsAffected = 0;

            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, "delete from hesap where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Exemple #3
0
        ///<summary>
        /// Hesap Data Update
        ///</summary>
        public static string Update(Hesap p)
        {
            int rowsAffected = 0;

            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 count(*) as totalcount from hesap where id<>?id and mail=?mail", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                    if (rowsAffected > 0)
                    {
                        switch (conneciton.State)
                        {
                        case System.Data.ConnectionState.Open:
                            conneciton.Close();
                            break;
                        }
                        conneciton.Dispose();
                        return("EMAIL");
                    }
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update hesap set ip=?ip,adi=?adi,soyadi=?soyadi,mail=?mail,sifre=?sifre,roller=?roller,onaykodu=?onaykodu,dogumtarihi=?dogumtarihi,kayittarihi=?kayittarihi,cinsiyet=?cinsiyet,tipi=?tipi,yorum=?yorum,abonelik=?abonelik,aktivasyon=?aktivasyon,aktif=?aktif where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("soyadi", p.Soyadi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sifre", p.Sifre, MSqlDbType.VarChar);
                    cmd.Parameters.Add("roller", p.Roller, MSqlDbType.VarChar);
                    cmd.Parameters.Add("onaykodu", p.OnayKodu, MSqlDbType.VarChar);
                    cmd.Parameters.Add("dogumtarihi", p.DogumTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("cinsiyet", p.Cinsiyet, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("tipi", p.Tipi, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("yorum", p.Yorum, MSqlDbType.Boolean);
                    cmd.Parameters.Add("abonelik", p.Abonelik, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktivasyon", p.Aktivasyon, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return((rowsAffected <= 0) ? string.Empty : p.ID);
        }
Exemple #4
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.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 = 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;
                }
                rvHesap.ProfilObject = ProfilMethods.GetProfil(rvHesap.ID);
            }
            return(rvHesap);
        }
Exemple #5
0
 public void Remove(Hesap obj)
 {
     this.List.Remove(obj);
 }
Exemple #6
0
 public int IndexOf(Hesap obj)
 {
     return(this.List.IndexOf(obj));
 }
Exemple #7
0
 public bool Contains(Hesap obj)
 {
     return(this.List.Contains(obj));
 }
Exemple #8
0
 public void Insert(int index, Hesap obj)
 {
     this.List.Insert(index, obj);
 }
Exemple #9
0
 public int Add(Hesap obj)
 {
     return(this.List.Add(obj));
 }