Exemple #1
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 #2
0
        ///<summary>
        /// Profil Data Update
        ///</summary>
        public static string Update(Profil 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 profil where id<>?id and url=?url", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID);
                    cmd.Parameters.Add("url", p.Url);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                    if (rowsAffected > 0)
                    {
                        switch (conneciton.State)
                        {
                        case System.Data.ConnectionState.Open:
                            conneciton.Close();
                            break;
                        }
                        conneciton.Dispose();
                        return("URL");
                    }
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update profil set url=?url,resimurl=?resimurl,adi=?adi,mail=?mail,web=?web,telefon=?telefon,gsm=?gsm,meslek=?meslek,egitim=?egitim,sehir=?sehir,hakkimda=?hakkimda where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("url", p.Url, MSqlDbType.VarChar);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("web", p.Web, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon", p.Telefon, MSqlDbType.VarChar);
                    cmd.Parameters.Add("gsm", p.GSM, MSqlDbType.VarChar);
                    cmd.Parameters.Add("meslek", p.Meslek, MSqlDbType.VarChar);
                    cmd.Parameters.Add("egitim", p.Egitim, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sehir", p.Sehir, MSqlDbType.VarChar);
                    cmd.Parameters.Add("hakkimda", p.Hakkimda, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return((rowsAffected <= 0) ? string.Empty : p.ID);
        }
Exemple #3
0
        public static string Update(Kategori 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 kategori where id<>?id and modulid=?modulid and adi=?adi", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                    if (rowsAffected > 0)
                    {
                        switch (conneciton.State)
                        {
                        case System.Data.ConnectionState.Open:
                            conneciton.Close();
                            break;
                        }
                        conneciton.Dispose();
                        return("ADI");
                    }
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update kategori set id=?id,parentid=?parentid,modulid=?modulid,adi=?adi,dil=?dil,sira=?sira,menu=?menu,aktif=?aktif,renk=?renk,aciklama=?aciklama,etiket=?etiket where modulid=?modulid and id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("parentid", p.ParentID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("dil", p.Dil, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sira", p.Sira, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("menu", p.Menu, MSqlDbType.Byte);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    cmd.Parameters.Add("renk", p.Renk, MSqlDbType.VarChar);
                    cmd.Parameters.Add("aciklama", p.Aciklama, MSqlDbType.VarChar);
                    cmd.Parameters.Add("etiket", p.Etiket, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return((rowsAffected <= 0) ? string.Empty : p.ID);
        }