public ActionResult CariEkle(Cari ca)
 {
     ca.Durum = true;
     c.Caris.Add(ca);
     c.SaveChanges();
     return(RedirectToAction("Index"));
 }
Exemple #2
0
        public static bool UpdateCari(Cari model)
        {
            var result = false;

            try
            {
                using (var conn = new SQLiteConnection(Constr))
                {
                    var cmd = new SQLiteCommand("UPDATE Cariler SET Ad=@Ad,Telefon=@Telefon,Adres=@Adres,Ilce=@Ilce,Il=@Il,Email=@Email,Upt_tst=@Upt_tst WHERE CariKod=@CariKod", conn);
                    cmd.Parameters.AddWithValue("@CariKod", model.CariKod);
                    cmd.Parameters.AddWithValue("@Ad", model.Ad);
                    cmd.Parameters.AddWithValue("@Telefon", model.Telefon);
                    cmd.Parameters.AddWithValue("@Adres", model.Adres);
                    cmd.Parameters.AddWithValue("@Ilce", model.Ilce);
                    cmd.Parameters.AddWithValue("@Il", model.Il);
                    cmd.Parameters.AddWithValue("@Email", model.Email);
                    cmd.Parameters.AddWithValue("@Upt_tst", DateTime.Now);

                    conn.Open();
                    if (cmd.ExecuteNonQuery() > 0)
                    {
                        result = true;
                    }
                }
            }
            catch (Exception ex)
            {
                result = false;
            }
            return(result);
        }
        private void OnPrintDoc(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            font = new Font(_dizGenel.FontAdi, _dizGenel.FontBuyukluk);
            float yPozisyon  = 0;
            float leftMargin = 0; //e.MarginBounds.Left;
            float topMargin  = 0; //e.MarginBounds.Top;

            //1-Ust
            //2-Alt
            //3-Kalem
            BirimHarf = font.GetHeight(e.Graphics);
            List <DizaynKalem> kalemList  = _mngKal.GetByDizaynGenelNo(_dizGenel.Id);
            List <DizaynKalem> ustKalem   = kalemList.FindAll(x => x.SahaYeri == "1");
            List <DizaynKalem> altKalem   = kalemList.FindAll(x => x.SahaYeri == "2");
            List <DizaynKalem> kalemKalem = kalemList.FindAll(x => x.SahaYeri == "3");
            Cari cari = null;

            if (!string.IsNullOrEmpty(_fatIrsUst.CariKodu))
            {
                cari = _mngCari.GetById(_fatIrsUst.CariKodu, false);
            }
            UstBilgileriniYaz(e, ustKalem, cari);
            AltBilgileriniYaz(e, altKalem);
            KalemBilgileriniYaz(e, kalemKalem);
        }
Exemple #4
0
        public static Cari GetCari_Kod(string str)
        {
            var cari = new Cari();

            try
            {
                using (var conn = new SQLiteConnection(Constr))
                {
                    var cmd = new SQLiteCommand(conn);

                    cmd.CommandText = "SELECT * FROM Cariler WHERE CariKod LIKE @src";
                    cmd.Parameters.AddWithValue("@src", str);


                    conn.Open();
                    var dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        cari.CariKod = dr.GetString(dr.GetOrdinal("CariKod"));
                        cari.Ad      = dr.GetString(dr.GetOrdinal("Ad"));
                        cari.Telefon = dr.GetString(dr.GetOrdinal("Telefon"));
                        cari.Adres   = dr.GetString(dr.GetOrdinal("Adres"));
                        cari.Ilce    = dr.GetString(dr.GetOrdinal("Ilce"));
                        cari.Il      = dr.GetString(dr.GetOrdinal("Il"));
                        cari.Email   = dr.GetString(dr.GetOrdinal("Email"));
                    }
                    dr.Close();
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
            return(cari);
        }
Exemple #5
0
 public ActionResult YeniCari(Cari p)
 {
     p.Durum = true;
     c.Caris.Add(p);
     c.SaveChanges();
     return(RedirectToAction("Index"));
 }
        void KayitSil()
        {
            DialogResult re = MessageBox.Show("Kayıt Silinsin mi?", "Dikkat", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (re == DialogResult.Yes)
            {
                try {
                    ListViewItem item     = listView1.SelectedItems[0];
                    string       cariKodu = item.SubItems[0].Text;
                    if (string.IsNullOrEmpty(cariKodu))
                    {
                        MessageBox.Show("cari seçiniz");
                        return;
                    }
                    Cari cari = mngCari.GetById(cariKodu, true);
                    mngCari.BeginTransaction();
                    mngCari.Delete(cari);
                } catch (Exception) {
                } finally {
                    try {
                        mngCari.CommitTransaction();
                        LoadCari();
                    } catch (Exception exc) { MessageBox.Show(exc.Message); LogWrite.Write(exc); }
                }
            }
        }
 public string GetCariFiyat(Cari cari, Stok stok, bool alici)
 {
     if (alici)
     {
         if (cari.AlisFiyatKod.Trim() == "AlisFiyat1")
         {
             return(stok.AlisFiyat1.FromNullableToString());
         }
         else if (cari.AlisFiyatKod.Trim() == "AlisFiyat2")
         {
             return(stok.AlisFiyat2.FromNullableToString());
         }
         else if (cari.AlisFiyatKod.Trim() == "AlisFiyat3")
         {
             return(stok.AlisFiyat3.FromNullableToString());
         }
     }
     else
     {
         if (cari.SatisFiyatKod.Trim() == "SatisFiyat1")
         {
             return(stok.SatisFiyat1.FromNullableToString());
         }
         else if (cari.SatisFiyatKod.Trim() == "SatisFiyat2")
         {
             return(stok.SatisFiyat2.FromNullableToString());
         }
         else if (cari.SatisFiyatKod.Trim() == "SatisFiyat3")
         {
             return(stok.SatisFiyat3.FromNullableToString());
         }
     }
     return("");
 }
Exemple #8
0
        public async Task <IActionResult> PutCari(int id, Cari cari)
        {
            if (id != cari.CariId)
            {
                return(BadRequest());
            }

            _context.Entry(cari).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CariExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #9
0
        public async Task <ActionResult <Cari> > PostCari(Cari cari)
        {
            _context.Cari.Add(cari);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCari", new { id = cari.CariId }, cari));
        }
Exemple #10
0
        protected override void GuncelNesneOlustur()
        {
            CurrentEntity = new Cari
            {
                Id           = Id,
                Kod          = txtKod.Text,
                CariAdi      = txtCariAdi.Text,
                TcKimlikNo   = txtTcKimlikNo.Text,
                Telefon1     = txtTelefon1.Text,
                Telefon2     = txtTelefon2.Text,
                Telefon3     = txtTelefon3.Text,
                Telefon4     = txtTelefon4.Text,
                Faks         = txtFaks.Text,
                Web          = txtWeb.Text,
                Email        = txtEmail.Text,
                VergiDairesi = txtVergiDairesi.Text,
                VergiNo      = txtVergiNo.Text,
                Adres        = txtAdres.Text,
                OzelKod1Id   = txtOzelKod1.Id,
                OzelKod2Id   = txtOzelKod2.Id,
                Aciklama     = txtAciklama.Text,
                Durum        = tglDurum.IsOn
            };

            ButonEnabledDurumu();
        }
Exemple #11
0
 public ActionResult CariEkle(Cari c)
 {
     c.Durum = true;
     dr.Caris.Add(c);
     dr.SaveChanges();
     return(RedirectToAction("Index"));
 }
        public PartialViewResult CariKayitPartial(Cari cari)
        {
            context.Caris.Add(cari);
            context.SaveChanges();

            return(PartialView());
        }
Exemple #13
0
        public static bool AddCari(Cari model)
        {
            var result = false;

            try
            {
                using (var conn = new SQLiteConnection(Constr))
                {
                    var cmd = new SQLiteCommand("INSERT INTO Cariler (CariKod,Ad,Telefon,Adres,Ilce,Il,Email,Crt_tst) values (@CariKod,@Ad,@Telefon,@Adres,@Ilce,@Il,@Email,@Crt_tst)", conn);
                    cmd.Parameters.AddWithValue("@CariKod", model.CariKod);
                    cmd.Parameters.AddWithValue("@Ad", model.Ad);
                    cmd.Parameters.AddWithValue("@Telefon", model.Telefon);
                    cmd.Parameters.AddWithValue("@Adres", model.Adres);
                    cmd.Parameters.AddWithValue("@Ilce", model.Ilce);
                    cmd.Parameters.AddWithValue("@Il", model.Il);
                    cmd.Parameters.AddWithValue("@Email", model.Email);
                    cmd.Parameters.AddWithValue("@Crt_tst", DateTime.Now);

                    conn.Open();
                    if (cmd.ExecuteNonQuery() > 0)
                    {
                        result = true;
                    }
                }
            }
            catch (Exception ex)
            {
                result = false;
            }
            return(result);
        }
        private void silToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var  delCari = new GenericRepository <Cari>(new OtoContext());
            Cari cari    = delCari.GetById(Carino);

            delCari.Delete(cari);
            FillGrid();
        }
        public ActionResult Create(Cari cari)
        {
            cari.Durum = true;
            context.Caris.Add(cari);
            context.SaveChanges();

            return(RedirectToAction("Index"));
        }
Exemple #16
0
        public ActionResult CariBilgiGuncelle(Cari cr)
        {
            var cari = c.Caris.Find(cr.Id);

            cari.Ad    = cr.Ad;
            cari.Soyad = cr.Soyad;
            cari.Sifre = cr.Sifre;
            c.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult CariGuncelle(Cari z)
        {
            var a = c.Caris.Find(z.CariID);

            a.CariAd    = z.CariAd;
            a.CariSoyad = z.CariSoyad;
            a.CariSehir = z.CariSehir;
            a.CariMail  = z.CariMail;
            c.SaveChanges();
            return(RedirectToAction("Index"));
        }
        private void txtCariKodu_KeyUp(object sender, KeyEventArgs e)
        {
            if (!string.IsNullOrEmpty(txtCariKodu.Text) && e.KeyCode == Keys.Tab)
            {
                try
                {
                    Cari cari = mngCari.GetById(txtCariKodu.Text, false);
                    if (cari != null)
                    {
                        CleareForm.ClearThisConrol(groupBox1)
                        .NotClearTheseConrols(txtCariKodu)
                        .BeginClear();
                        txtCariIsim.Text      = cari.CariIsim;
                        txtTel.Text           = cari.CariTel;
                        txtCepTel.Text        = cari.CepTel;
                        txtCariAdres.Text     = cari.CariAdres;
                        txtCariEmil.Text      = cari.CariEmail;
                        txtVergiDairesi.Text  = cari.VergiDairesi;
                        txtVergiNumarasi.Text = cari.VergiNumarasi;
                        txtWebAdres.Text      = cari.WebAdresi;
                        txtFax.Text           = cari.Fax;

                        if (cari.CariTip.Contains("AS"))
                        {
                            rbAliciSatici.Checked = true;
                        }
                        else if (cari.CariTip.Contains("S"))
                        {
                            rbSatici.Checked = true;
                        }
                        else
                        {
                            rbAlici.Checked = true;
                        }
                        txtCariGrup1.Text         = cari.Grup1.ProperyToStringOrEmpty(x => x.Id);
                        txtCariGrup2.Text         = cari.Grup2.ProperyToStringOrEmpty(x => x.Id);
                        txtCariGrup3.Text         = cari.Grup3.ProperyToStringOrEmpty(x => x.Id);
                        txtCariGrup4.Text         = cari.Grup4.ProperyToStringOrEmpty(x => x.Id);
                        txtIl.Text                = cari.Il;
                        txtIlce.Text              = cari.Ilce;
                        txtYetkiliKisi.Text       = cari.YetkiliKisi;
                        cmbAlisFiyatKod.Text      = cari.AlisFiyatKod;
                        cmbSatisFiyatKod.Text     = cari.SatisFiyatKod;
                        chkSubelerdeOrtak.Checked = cari.SubelerdeOrtak.HasValue ? cari.SubelerdeOrtak.Value : false;
                    }
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                txtCariIsim.Focus();
            }
        }
Exemple #19
0
        public ActionResult bilgiGuncelle(Cari cari)
        {
            var yeni = c.Caris.Find(cari.CariId);

            yeni.CariSehir = cari.CariSehir;
            yeni.CariAd    = cari.CariAd;
            yeni.CariSoyad = cari.CariSoyad;
            yeni.CariSifre = cari.CariSifre;
            c.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #20
0
        public ActionResult CariBilgiGuncelle(Cari cr)
        {
            var cari = c.Caris.Find(cr.CariID);

            cari.CariAd    = cr.CariAd;
            cari.CariSoyad = cr.CariSoyad;
            cari.CariMail  = cr.CariMail;
            cari.CariSehir = cr.CariSehir;
            cari.CariSifre = cr.CariSifre;
            c.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult CariBilgi(int id)
        {
            using (sayazilimEntities db = new sayazilimEntities())
            {
                Cari   emp      = db.Cari.Where(x => x.ID == id).FirstOrDefault <Cari>();
                string websifre = GirisKontrol.unhash(emp.WebSifre, true);
                emp.WebSifre = websifre;

                BALANCE BAL = db.BALANCE.Where(x => x.cariID == id && x.paraBirimi == emp.paraBirimi).FirstOrDefault <BALANCE>();

                return(Json(new { success = true, data = emp, bl = BAL }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #22
0
        //void DoldurStokBirimleri(Stok stok)
        //{
        //  cmbBirim.Items.Clear();
        //  if (!string.IsNullOrEmpty(stok.AnaBirim))
        //  {
        //    cmbBirim.Items.Add(stok.AnaBirim.Trim());
        //    cmbBirim.Text = stok.AnaBirim.Trim();
        //  }
        //  if (!string.IsNullOrEmpty(stok.AltBirim1))
        //    cmbBirim.Items.Add(stok.AltBirim1.Trim());
        //  if (!string.IsNullOrEmpty(stok.AltBirim2))
        //    cmbBirim.Items.Add(stok.AltBirim2.Trim());
        //  if (!string.IsNullOrEmpty(stok.AltBirim3))
        //    cmbBirim.Items.Add(stok.AltBirim3.Trim());
        //}
        void SetFiyat()
        {
            try {
                DoldurStokBirimleri(_currentStok, cmbBirim);
                txtStokMiktar.Text = mngSth.GetStokMiktar(txtStokKodu.Text).ToString();

                if (FTIRSIP.SaticiSip == _ftirsip)
                {
                    txtKdv.Text = _currentStok.AlisKdvOrani.ToString();
                    if (!string.IsNullOrEmpty(txtCari.Text))
                    {
                        Cari cari = mngCari.GetById(txtCari.Text, false);
                        if (cari != null && !string.IsNullOrEmpty(cari.SatisFiyatKod))
                        {
                            txtFyt.Text = GetCariFiyat(cari, _currentStok, true);
                        }
                        else
                        {
                            txtFyt.Text = _currentStok.AlisFiyat1.FromNullableToString();
                        }
                    }
                    else
                    {
                        txtFyt.Text = _currentStok.AlisFiyat1.FromNullableToString();
                    }
                }
                else if (FTIRSIP.MusSip == _ftirsip)
                {
                    txtKdv.Text = _currentStok.SatisKdvOrani.ToString();
                    if (!string.IsNullOrEmpty(txtCari.Text))
                    {
                        Cari cari = mngCari.GetById(txtCari.Text, false);
                        if (cari != null && !string.IsNullOrEmpty(cari.SatisFiyatKod))
                        {
                            txtFyt.Text = GetCariFiyat(cari, _currentStok, false);
                        }
                        else
                        {
                            txtFyt.Text = _currentStok.SatisFiyat1.FromNullableToString();
                        }
                    }
                    else
                    {
                        txtFyt.Text = _currentStok.SatisFiyat1.FromNullableToString();
                    }
                }
            } catch (Exception exc) {
                LogWrite.Write(exc);
                MessageBox.Show(exc.Message);
            }
        }
Exemple #23
0
        public ActionResult Edit(CariViewModel model, int id)
        {
            if (ModelState.IsValid)
            {
                Cari cari = db.Cari.Find(id);
                if (cari == null)
                {
                    return(HttpNotFound());
                }
                CariEhliyet cariEhliyet = db.CariEhliyet.First(x => x.Cari_ID == cari.Cari_ID);

                cari.CariSehir_ID      = model.CariSehir_ID;
                cari.Cari_Adres1       = model.Cari_Adres1;
                cari.Cari_Adres2       = model.Cari_Adres2;
                cari.Cari_AdSoyad      = model.Cari_AdSoyad;
                cari.Cari_Cinsiyet     = model.Cari_Cinsiyet;
                cari.Cari_DogumTarihi  = model.Cari_DogumTarihi;
                cari.Cari_EpostaAdresi = model.Cari_EpostaAdresi;
                cari.Cari_IDNumber     = model.Cari_IDNumber;
                cari.Cari_LokalTelefon = model.Cari_LokalTelefon;
                cari.Cari_MobilTelefon = model.Cari_MobilTelefon;
                cari.Cari_UyrukID      = model.Cari_UyrukID;

                cari.Cari_Tipi         = (int)model.Cari_Tipi;
                cari.Cari_VergiNo      = model.Cari_VergiNo;
                cari.Cari_VergiDairesi = model.Cari_VergiDairesi;

                cariEhliyet.Cari_ID = cari.Cari_ID;
                cariEhliyet.CariEhliyet_DogumYeri        = model.CariEhliyet_DogumYeri;
                cariEhliyet.CariEhliyet_EhliyetNumarasi  = model.CariEhliyet_EhliyetNumarasi;
                cariEhliyet.CariEhliyet_GecerlilikTarihi = model.CariEhliyet_GecerlilikTarihi;
                cariEhliyet.CariEhliyet_Status           = (int)DBStatus.Active;
                cariEhliyet.CariEhliyet_VerildigiYer     = model.CariEhliyet_VerildigiYer;
                cariEhliyet.CariEhliyet_VerilisTarihi    = model.CariEhliyet_VerilisTarihi;
                cariEhliyet.EhliyetSinif_ID = model.EhliyetSinif_ID;
                cariEhliyet.KanGrubu_ID     = model.KanGrubu_ID;


                db.Entry(cari).State        = EntityState.Modified;
                db.Entry(cariEhliyet).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EhliyetSinif = db.EhliyetSinif.Find(model.EhliyetSinif_ID).EhliyetSinif_Adi;
            ViewBag.KanGrubu     = db.KanGrubu.Find(model.KanGrubu_ID).KanGrubu_Adi;
            ViewBag.Cari_Uyruk   = db.CariUyruk.Find(model.Cari_UyrukID).CariUyruk_Adi;
            ViewBag.CariSehir    = db.CariSehir.Find(model.CariSehir_ID).CariSehir_Adi;
            return(View(model));
        }
        public ActionResult Create(int?id)
        {
            if (id is null)
            {
                return(View());
            }
            Cari      cari  = db.Cari.Find(id);
            KasaIslem model = new KasaIslem
            {
                KasaIslem_Aciklama = $"{cari.Cari_AdSoyad} adlı müşterinden tahsil edilmiştir."
            };

            return(View(model));
        }
 void SetData()
 {
     try {
         labSuanDurum.Text = g_cekDurum.ToString();
         g_cek             = g_mngCek.GetById(g_cekId, false);
         Cari cari = _mngCari.GetById(g_cek.CariKodu, false);
         labCariKod.Text  = cari.Id;
         labCariIsim.Text = cari.CariIsim;
         dateIslem.Value  = g_cek.IslemTarih;
         txtAciklama.Text = g_cek.Aciklama;
         if (g_cek.CekTip == CekTip.Alinan)
         {
             string      key = "rb" + g_cek.CekDurum.ToString();
             RadioButton rb  = (RadioButton)grbAlinanCek.Controls.Find(key, true)[0];
             rb.Checked = true;
             if (rb == rbTahsilEdildi)
             {
                 if (!string.IsNullOrEmpty(g_cek.DurumKasaKod))
                 {
                     cmbKasa.Text = g_cek.DurumKasaKod;
                 }
             }
             else if (rb == rbCiroEdildi)
             {
                 txtCari.Text = g_cek.DurumCariKod;
             }
             else if (rb == rbBankaTeminatVerildi || rb == rbBankayaTahsileVerildi ||
                      rb == rbTahsilBankaHesaba)
             {
                 txtBankaHesap.Text = g_cek.DurumBankaHesapNo;
             }
         }
         else
         {
             if (g_cek.CekDurum == CekDurum.Beklemede)
             {
                 rbBeklemedeVerilen.Checked = true;
             }
             else
             {
                 string      str = "rb" + g_cek.CekDurum.ToString();
                 RadioButton rb  = (RadioButton)grbVerilenCek.Controls.Find(str, true)[0];
                 rb.Checked = true;
             }
         }
     } catch (Exception exc) {
         LogWrite.Write(exc);
         MessageBox.Show(exc.Message);
     }
 }
Exemple #26
0
        public ActionResult CariGuncelle(Cari cari)
        {
            if (!ModelState.IsValid)
            {
                return(View("CariGetir"));
            }
            var deger = c.Caris.Find(cari.CariId);

            deger.CariAd    = cari.CariAd;
            deger.CariSehir = cari.CariSehir;
            deger.CariSoyad = cari.CariSoyad;
            deger.Carimail  = cari.Carimail;
            c.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult CariGiris(Cari P)
        {
            var deger = c.Caris.FirstOrDefault(x => x.Carimail == P.Carimail && x.CariSifre == P.CariSifre);

            if (deger != null)
            {
                FormsAuthentication.SetAuthCookie(P.Carimail, false);
                Session["CariMail"] = P.Carimail.ToString();
                return(RedirectToAction("Index", "CariPanel"));
            }
            else
            {
                return(RedirectToAction("Index", "LogIn"));
            }
        }
Exemple #28
0
        public ActionResult DekontBilgi(int id)
        {
            using (sayazilimEntities db = new sayazilimEntities())
            {
                Dekont emp = db.Dekont.Where(x => x.ID == id).FirstOrDefault <Dekont>();

                emp.IslemTarih = Convert.ToDateTime(emp.IslemTarih).ToString("yyyy-MM-dd");
                string vadetarihi = Convert.ToDateTime(emp.VadeTarihi).ToString("yyyy-MM-dd");

                Cari cr = db.Cari.Where(x => x.ID == emp.CariID).FirstOrDefault();


                return(Json(new { success = true, data = emp, vadetarihi = vadetarihi }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #29
0
        public ActionResult CariLogin1(Cari p)
        {
            var bilgiler = c.Caris.FirstOrDefault(x => x.CariMail == p.CariMail && x.CariSifre == p.CariSifre);

            if (bilgiler != null)
            {
                FormsAuthentication.SetAuthCookie(bilgiler.CariMail, false);
                Session["CariMail"] = bilgiler.CariMail.ToString();
                return(RedirectToAction("Index", "Caripanel"));
            }
            else
            {
                return(RedirectToAction("Index", "Login"));
            }
        }
Exemple #30
0
        public ActionResult CariGuncelle(Cari p)
        {
            if (!ModelState.IsValid)
            {
                return(View("CariGetir"));
            }
            var cari = c.Caris.Find(p.Id);

            cari.Ad    = p.Ad;
            cari.Soyad = p.Soyad;
            cari.Sehir = p.Sehir;
            cari.Mail  = p.Mail;
            c.SaveChanges();
            return(RedirectToAction("Index"));
        }