示例#1
0
        public static EntitySatis SatisGetirById(int?id)
        {
            EntitySatis entitySatis = new EntitySatis();
            SqlCommand  command     = MyExtensions.CreateCommandAndOpenConnection(ResourceSatis.spSatislarById, Baglanti.connection);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.AddWithValue("@p1", id);

            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                entitySatis.SatisId    = Convert.ToInt32(dr[ResourceSatis.SATISID]);
                entitySatis.Urun       = dr[ResourceSatis.URUNAD].ToString();
                entitySatis.Personel   = dr[ResourceSatis.PERSONEL].ToString();
                entitySatis.Musteri    = dr[ResourceSatis.MUSTERI].ToString();
                entitySatis.Tutar      = Convert.ToDecimal(dr[ResourceSatis.TUTAR]);
                entitySatis.MusteriId  = Convert.ToInt32(dr[ResourceSatis.MUSTERIID]);
                entitySatis.UrunId     = Convert.ToInt32(dr[ResourceSatis.URUNID]);
                entitySatis.PersonelId = Convert.ToInt32(dr[ResourceSatis.PERID]);
            }

            dr.Close();
            return(entitySatis);
        }
示例#2
0
        public static int MusteriEkle(EntityMusteri musteriDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceMusteri.InsertMusteriSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceMusteri.Parameter1, musteriDeger.MusteriAd);
            command.Parameters.AddWithValue(ResourceMusteri.Parameter2, musteriDeger.MusteriSoyad);
            return(command.ExecuteNonQuery());
        }
示例#3
0
        public static bool PersonelSil(int?id)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourcePersonel.DeletePersonelSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourcePersonel.IdParameter, id);

            return(command.ExecuteNonQuery() > 0);
        }
示例#4
0
        public static int DepartmanEkle(EntityDepartman departmanDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceDepartman.InsertDepartmanSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceDepartman.Parameter, departmanDeger.DepartmanAd);

            return(command.ExecuteNonQuery());
        }
示例#5
0
        public static int UrunEkle(EntityUrun urunDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceUrun.InsertUrunSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceUrun.Parameter1, urunDeger.UrunAd);
            command.Parameters.AddWithValue(ResourceUrun.Parameter2, urunDeger.UrunFiyat);
            command.Parameters.AddWithValue(ResourceUrun.Parameter3, urunDeger.UrunAdet);

            return(command.ExecuteNonQuery());
        }
示例#6
0
        public static int MusteriGuncelle(EntityMusteri musteriDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceMusteri.UpdateMusteriSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceMusteri.AdParam, musteriDeger.MusteriAd);
            command.Parameters.AddWithValue(ResourceMusteri.SoyadParam, musteriDeger.MusteriSoyad);
            command.Parameters.AddWithValue(ResourceDepartman.IdParameter, musteriDeger.MusteriId);

            return(command.ExecuteNonQuery());
        }
示例#7
0
        public static int UrunGuncelle(EntityUrun urunDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceUrun.UpdateUrunSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceUrun.IdParameter, urunDeger.UrunId);
            command.Parameters.AddWithValue(ResourceUrun.AdParam, urunDeger.UrunAd);
            command.Parameters.AddWithValue(ResourceUrun.FiyatParam, urunDeger.UrunFiyat);
            command.Parameters.AddWithValue(ResourceUrun.AdetParam, urunDeger.UrunAdet);

            return(command.ExecuteNonQuery());
        }
示例#8
0
        public static int SatisEkle(EntitySatis satisDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceSatis.InsertSatisSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceSatis.Parameter1, satisDeger.UrunId);
            command.Parameters.AddWithValue(ResourceSatis.Parameter2, satisDeger.PersonelId);
            command.Parameters.AddWithValue(ResourceSatis.Parameter3, satisDeger.MusteriId);
            command.Parameters.AddWithValue(ResourceSatis.Parameter4, satisDeger.Tutar);

            return(command.ExecuteNonQuery());
        }
示例#9
0
        public static int PersonelEkle(EntityPersonel personelDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourcePersonel.InsertPersonelSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourcePersonel.Parameter1, personelDeger.PersonelAd);
            command.Parameters.AddWithValue(ResourcePersonel.Parameter2, personelDeger.PersonelSoyad);
            command.Parameters.AddWithValue(ResourcePersonel.Parameter3, personelDeger.PersonelDepartmanId);
            command.Parameters.AddWithValue(ResourcePersonel.Parameter4, personelDeger.PersonelMaas);

            return(command.ExecuteNonQuery());
        }
示例#10
0
        public static int SatisGuncelle(EntitySatis satisDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourceSatis.UpdateSatisSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceSatis.IdParameter, satisDeger.SatisId);
            command.Parameters.AddWithValue(ResourceSatis.PersonelParam, satisDeger.PersonelId);
            command.Parameters.AddWithValue(ResourceSatis.MusteriParam, satisDeger.MusteriId);
            command.Parameters.AddWithValue(ResourceSatis.UrunParam, satisDeger.UrunId);
            command.Parameters.AddWithValue(ResourceSatis.TutarParam, satisDeger.Tutar);

            return(command.ExecuteNonQuery());
        }
示例#11
0
        public static int PersonelGuncelle(EntityPersonel personelDeger)
        {
            SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourcePersonel.UpdatePersonelSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourcePersonel.IdParameter, personelDeger.PersonelId);
            command.Parameters.AddWithValue(ResourcePersonel.AdParam, personelDeger.PersonelAd);
            command.Parameters.AddWithValue(ResourcePersonel.SoyadParam, personelDeger.PersonelSoyad);
            command.Parameters.AddWithValue(ResourcePersonel.DepartmanParam, personelDeger.PersonelDepartmanId);
            command.Parameters.AddWithValue(ResourcePersonel.MaasParam, personelDeger.PersonelMaas);

            return(command.ExecuteNonQuery());
        }
示例#12
0
        public static EntityDepartman DepartmanGetirById(byte?id)
        {
            EntityDepartman entityDepartman = new EntityDepartman();
            SqlCommand      command         = MyExtensions.CreateCommandAndOpenConnection(ResourceDepartman.SelectDepartmanByIdSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceDepartman.IdParameter, id);

            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                entityDepartman.DepartmanId = Convert.ToByte(dr[ResourceDepartman.DEPARTMANID]);
                entityDepartman.DepartmanAd = dr[ResourceDepartman.DEPARTMANAD].ToString();
            }

            dr.Close();
            return(entityDepartman);
        }
示例#13
0
        public static List <EntityDepartman> DepartmanListesi()
        {
            List <EntityDepartman> departmanListesi = new List <EntityDepartman>();
            SqlCommand             command          = MyExtensions.CreateCommandAndOpenConnection(ResourceDepartman.SelectDepartmanSorgu, Baglanti.connection);

            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                departmanListesi.Add(new EntityDepartman
                {
                    DepartmanId = Convert.ToByte(dr[ResourceDepartman.DEPARTMANID].ToString()),
                    DepartmanAd = dr[ResourceDepartman.DEPARTMANAD].ToString()
                });
            }

            dr.Close();
            return(departmanListesi);
        }
示例#14
0
        public static EntityMusteri MusteriGetirById(int?id)
        {
            EntityMusteri entityMusteri = new EntityMusteri();
            SqlCommand    command       = MyExtensions.CreateCommandAndOpenConnection(ResourceMusteri.SelectMusteriByIdSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceMusteri.IdParameter, id);

            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                entityMusteri.MusteriId    = Convert.ToInt32(dr[ResourceMusteri.MUSTERIID]);
                entityMusteri.MusteriAd    = dr[ResourceMusteri.MUSTERIAD].ToString();
                entityMusteri.MusteriSoyad = dr[ResourceMusteri.MUSTERISOYAD].ToString();
            }

            dr.Close();
            return(entityMusteri);
        }
示例#15
0
        public static List <EntityUrun> UrunListesi()
        {
            List <EntityUrun> urunListesi = new List <EntityUrun>();
            SqlCommand        command     = MyExtensions.CreateCommandAndOpenConnection(ResourceUrun.SelectUrunSorgu, Baglanti.connection);
            SqlDataReader     dr          = command.ExecuteReader();

            while (dr.Read())
            {
                urunListesi.Add(new EntityUrun {
                    UrunId    = Convert.ToInt32(dr[ResourceUrun.URUNID]),
                    UrunAd    = dr[ResourceUrun.URUNAD].ToString(),
                    UrunFiyat = Convert.ToDecimal(dr[ResourceUrun.URUNFIYAT]),
                    UrunAdet  = Convert.ToInt32(dr[ResourceUrun.URUNADET])
                });
            }

            dr.Close();
            return(urunListesi);
        }
示例#16
0
        public static List <EntityMusteri> MusteriListesi()
        {
            List <EntityMusteri> musteriListesi = new List <EntityMusteri>();
            SqlCommand           command        = MyExtensions.CreateCommandAndOpenConnection(ResourceMusteri.SelectMusteriSorgu, Baglanti.connection);

            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                musteriListesi.Add(new EntityMusteri
                {
                    MusteriId    = Convert.ToInt32(dr[ResourceMusteri.MUSTERIID]),
                    MusteriAd    = dr[ResourceMusteri.MUSTERIAD].ToString(),
                    MusteriSoyad = dr[ResourceMusteri.MUSTERISOYAD].ToString(),
                });
            }

            dr.Close();
            return(musteriListesi);
        }
示例#17
0
        public static EntityUrun UrunGetirById(int?id)
        {
            EntityUrun entityUrun = new EntityUrun();
            SqlCommand command    = MyExtensions.CreateCommandAndOpenConnection(ResourceUrun.SelectUrunByIdSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourceUrun.IdParameter, id);

            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                entityUrun.UrunId    = Convert.ToInt32(dr[ResourceUrun.URUNID]);
                entityUrun.UrunAd    = dr[ResourceUrun.URUNAD].ToString();
                entityUrun.UrunFiyat = Convert.ToDecimal(dr[ResourceUrun.URUNFIYAT]);
                entityUrun.UrunAdet  = Convert.ToInt32(dr[ResourceUrun.URUNADET]);
            }

            dr.Close();
            return(entityUrun);
        }
示例#18
0
        public static EntityPersonel PersonelGetirById(int?id)
        {
            EntityPersonel entityPersonel = new EntityPersonel();
            SqlCommand     command        = MyExtensions.CreateCommandAndOpenConnection(ResourcePersonel.SelectPersonelByIdSorgu, Baglanti.connection);

            command.Parameters.AddWithValue(ResourcePersonel.IdParameter, id);

            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                entityPersonel.PersonelId          = Convert.ToInt32(dr[ResourcePersonel.PERSONELID].ToString());
                entityPersonel.PersonelAd          = dr[ResourcePersonel.PERSONELAD].ToString();
                entityPersonel.PersonelSoyad       = dr[ResourcePersonel.PERSONELSOYAD].ToString();
                entityPersonel.PersonelDepartmanId = Convert.ToByte(dr[ResourcePersonel.PERSONELDEPARTMAN]);
                entityPersonel.PersonelMaas        = Convert.ToDecimal(dr[ResourcePersonel.PERSONELMAAS]);
            }

            dr.Close();
            return(entityPersonel);
        }
示例#19
0
        public static List <EntitySatis> SatisListesi()
        {
            List <EntitySatis> satisListesi = new List <EntitySatis>();
            SqlCommand         command      = MyExtensions.CreateCommandAndOpenConnection(ResourceSatis.spSatislar, Baglanti.connection);

            command.CommandType = CommandType.StoredProcedure;
            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                satisListesi.Add(new EntitySatis {
                    SatisId  = Convert.ToInt32(dr[ResourceSatis.SATISID]),
                    Urun     = dr[ResourceSatis.URUNAD].ToString(),
                    Personel = dr[ResourceSatis.PERSONEL].ToString(),
                    Musteri  = dr[ResourceSatis.MUSTERI].ToString(),
                    Tutar    = Convert.ToDecimal(dr[ResourceSatis.TUTAR])
                });
            }

            dr.Close();
            return(satisListesi);
        }
示例#20
0
        public static List <EntityPersonel> PersonelListesi()
        {
            List <EntityPersonel> personelListesi = new List <EntityPersonel>();
            SqlCommand            command         = MyExtensions.CreateCommandAndOpenConnection(ResourcePersonel.spSelectPersonelwithDepartmanAd, Baglanti.connection);

            command.CommandType = CommandType.StoredProcedure;
            SqlDataReader dr = command.ExecuteReader();

            while (dr.Read())
            {
                personelListesi.Add(new EntityPersonel
                {
                    PersonelId        = Convert.ToInt32(dr[ResourcePersonel.PERSONELID]),
                    PersonelAd        = dr[ResourcePersonel.PERSONELAD].ToString(),
                    PersonelSoyad     = dr[ResourcePersonel.PERSONELSOYAD].ToString(),
                    PersonelDepartman = dr[ResourcePersonel.DEPARTMANAD].ToString(),
                    PersonelMaas      = Convert.ToDecimal(dr[ResourcePersonel.PERSONELMAAS]),
                });
            }

            dr.Close();
            return(personelListesi);
        }