Exemple #1
0
        ///<summary>
        /// Firma Data Update
        ///</summary>
        public static int Update(Firma 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, "update firma set hesapid=?hesapid,kategoriid=?kategoriid,resimurl=?resimurl,adi=?adi,yetkili=?yetkili,adres=?adres,mail=?mail,web=?web,telefon1=?telefon1,telefon2=?telefon2,gsm=?gsm,sehir=?sehir,kayittarihi=?kayittarihi,guncellemetarihi=?guncellemetarihi,gosterimsayi=?gosterimsayi,yoneticionay=?yoneticionay,aktif=?aktif where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.BigInt);
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kategoriid", p.KategoriID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("yetkili", p.Yetkili, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adres", p.Adres, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("web", p.Web, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon1", p.Telefon1, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon2", p.Telefon2, MSqlDbType.VarChar);
                    cmd.Parameters.Add("gsm", p.GSM, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sehir", p.Sehir, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("gosterimsayi", p.GosterimSayi, MSqlDbType.Boolean);
                    cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, 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);
        }
Exemple #2
0
        ///<summary>
        /// Firma Data Insert
        ///</summary>
        public static Int64 Insert(Firma p)
        {
            Int64 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, "insert into firma (hesapid,kategoriid,resimurl,adi,yetkili,adres,mail,web,telefon1,telefon2,gsm,sehir,kayittarihi,guncellemetarihi,gosterimsayi,yoneticionay,aktif) values(?hesapid,?kategoriid,?resimurl,?adi,?yetkili,?adres,?mail,?web,?telefon1,?telefon2,?gsm,?sehir,?kayittarihi,?guncellemetarihi,?gosterimsayi,?yoneticionay,?aktif); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kategoriid", p.KategoriID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("yetkili", p.Yetkili, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adres", p.Adres, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("web", p.Web, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon1", p.Telefon1, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon2", p.Telefon2, MSqlDbType.VarChar);
                    cmd.Parameters.Add("gsm", p.GSM, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sehir", p.Sehir, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("gosterimsayi", p.GosterimSayi, MSqlDbType.Boolean);
                    cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Exemple #3
0
        /// <summary>
        /// Firma Getir
        /// </summary>
        public static Firma GetFirma(CommandType cmdType, string sqlQuery, MParameterCollection parameters)
        {
            Firma rvFirma = new Firma();

            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())
                        {
                            rvFirma = new Firma(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["yetkili"]), MConvert.NullToString(IDR["adres"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["web"]), MConvert.NullToString(IDR["telefon1"]), MConvert.NullToString(IDR["telefon2"]), MConvert.NullToString(IDR["gsm"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvFirma);
        }
Exemple #4
0
 public void Remove(Firma obj)
 {
     this.List.Remove(obj);
 }
Exemple #5
0
 public int IndexOf(Firma obj)
 {
     return(this.List.IndexOf(obj));
 }
Exemple #6
0
 public bool Contains(Firma obj)
 {
     return(this.List.Contains(obj));
 }
Exemple #7
0
 public void Insert(int index, Firma obj)
 {
     this.List.Insert(index, obj);
 }
Exemple #8
0
 public int Add(Firma obj)
 {
     return(this.List.Add(obj));
 }