Пример #1
0
 public void Update(Musteriler kayit)
 {
     try
     {
         SqlDb db = new SqlDb(cls_settings.connectionString);
         db.Musterilers.Attach(kayit, true);
         db.SubmitChanges();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
 public void Save(Stoklar kayit)
 {
     try
     {
         SqlDb db = new SqlDb(cls_settings.connectionString);
         db.Stoklars.InsertOnSubmit(kayit);
         db.SubmitChanges();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #3
0
 public StokGC EvrakSatirGetir(int kayitNo)
 {
     try
     {
         SqlDb  db    = new SqlDb(cls_settings.connectionString);
         StokGC kayit = db.StokGCs.SingleOrDefault(S => S.StokGCKayitNo == kayitNo);
         return(kayit);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(null);
     }
 }
Пример #4
0
        public List <StokGC> GetAll(int evraktip)
        {
            SqlDb         db    = new SqlDb(cls_settings.connectionString);
            List <StokGC> liste = new List <StokGC>();

            try
            {
                liste = (from t in db.StokGCs where t.StokGCSatirNo == 0 && t.StokGCTipi == evraktip select t).ToList <StokGC>();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(liste);
        }
        public List <MusteriAdresleri> GetAll(string musteri)
        {
            SqlDb db = new SqlDb(cls_settings.connectionString);
            List <MusteriAdresleri> liste = new List <MusteriAdresleri>();

            try
            {
                liste = (from t in db.MusteriAdresleris where t.MusteriAdresMusteriKodu == musteri select t).ToList <MusteriAdresleri>();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(liste);
        }
Пример #6
0
        public List <StokFiyatlari> GetAll(string stok)
        {
            SqlDb db = new SqlDb(cls_settings.connectionString);
            List <StokFiyatlari> liste = new List <StokFiyatlari>();

            try
            {
                liste = (from t in db.StokFiyatlaris where t.StokFiyatStokKodu == stok select t).ToList <StokFiyatlari>();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(liste);
        }
Пример #7
0
 public void EvrakSil(int sira, int evraktip)
 {
     try
     {
         SqlDb db    = new SqlDb(cls_settings.connectionString);
         var   kayit = (from tbl in db.StokGCs
                        where tbl.StokGCTipi == evraktip && tbl.StokGCEvrakNo == sira
                        select tbl);
         db.StokGCs.DeleteAllOnSubmit(kayit);
         db.SubmitChanges();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #8
0
 public void SatirSil(int kayitNo)
 {
     try
     {
         SqlDb db    = new SqlDb(cls_settings.connectionString);
         var   kayit = (from tbl in db.StokGCs
                        where tbl.StokGCKayitNo == kayitNo
                        select tbl);
         db.StokGCs.DeleteAllOnSubmit(kayit);
         db.SubmitChanges();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #9
0
 public List <StokGC> EvrakGetir(int sira, int evraktip)
 {
     try
     {
         SqlDb         db    = new SqlDb(cls_settings.connectionString);
         List <StokGC> kayit = (from tbl in db.StokGCs
                                where tbl.StokGCEvrakNo == sira && tbl.StokGCTipi == evraktip
                                orderby tbl.StokGCSatirNo ascending
                                select tbl).ToList <StokGC>();
         return(kayit);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(null);
     }
 }
Пример #10
0
        public void Delete(Musteriler kayit)
        {
            try
            {
                SqlDb      db     = new SqlDb(cls_settings.connectionString);
                Musteriler sKayit = db.Musterilers.SingleOrDefault(S => S.MusteriKodu == kayit.MusteriKodu);

                if (sKayit != null)
                {
                    db.Musterilers.DeleteOnSubmit(sKayit);
                    db.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #11
0
        public void EvrakKaydetList(int sira, int evraktip, List <StokGC> Gelenkayitlar)
        {
            try
            {
                SqlDb         db          = new SqlDb(cls_settings.connectionString);
                List <StokGC> orjKayitlar = EvrakGetir(sira, evraktip);

                foreach (StokGC kayitOrjSil in orjKayitlar)
                {
                    bool sil   = true;
                    int  RecNo = 0;
                    foreach (StokGC kayitGlnSil in Gelenkayitlar)
                    {
                        if (kayitOrjSil.StokGCKayitNo == kayitGlnSil.StokGCKayitNo)
                        {
                            sil = false;
                        }
                        if (sil)
                        {
                            RecNo = kayitOrjSil.StokGCKayitNo;
                        }
                    }
                    if (sil)
                    {
                        SatirSil(RecNo);
                    }
                }

                int satirNo = 0;
                foreach (StokGC kayitGlnKayit in Gelenkayitlar)
                {
                    if (kayitGlnKayit.StokGCStokKodu != "" && kayitGlnKayit.StokGCStokKodu != null)
                    {
                        kayitGlnKayit.StokGCSatirNo = satirNo;
                        EvrakKaydet(kayitGlnKayit);
                        satirNo += 1;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #12
0
        public void Delete(StokFiyatlari kayit)
        {
            SqlDb db = new SqlDb(cls_settings.connectionString);

            try
            {
                StokFiyatlari sKayit = db.StokFiyatlaris.SingleOrDefault(S => S.StokFiyatStokKodu == kayit.StokFiyatStokKodu && S.StokFiyatNo == kayit.StokFiyatNo);

                if (sKayit != null)
                {
                    db.StokFiyatlaris.DeleteOnSubmit(sKayit);
                    db.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #13
0
        public void EvrakKaydet(StokGC Gelenkayit)
        {
            try
            {
                SqlDb db = new SqlDb(cls_settings.connectionString);

                if (Gelenkayit.StokGCKayitNo > 0)
                {
                    db.StokGCs.Attach(Gelenkayit, true);
                }
                else
                {
                    db.StokGCs.InsertOnSubmit(Gelenkayit);
                }
                db.SubmitChanges();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #14
0
        public int SonSiraGetir(int evraktip)
        {
            int sira = 1;

            try
            {
                SqlDb db    = new SqlDb(cls_settings.connectionString);
                var   kayit = (from tbl in db.StokGCs
                               where tbl.StokGCTipi == evraktip
                               orderby tbl.StokGCEvrakNo descending
                               select tbl).Take(1);
                foreach (StokGC kay in kayit)
                {
                    sira = Convert.ToInt32(kay.StokGCEvrakNo) + 1;
                }

                return(sira);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(sira);
            }
        }
        public int SonSiraGetir(string musteri)
        {
            int sira = 1;

            try
            {
                SqlDb db    = new SqlDb(cls_settings.connectionString);
                var   kayit = (from tbl in db.MusteriAdresleris
                               where tbl.MusteriAdresMusteriKodu == musteri
                               orderby tbl.MusteriAdresNo descending
                               select tbl).Take(1);
                foreach (MusteriAdresleri kay in kayit)
                {
                    sira = Convert.ToInt32(kay.MusteriAdresNo) + 1;
                }

                return(sira);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata oluştu: " + ex.Message, "Dikkat", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(sira);
            }
        }