private void dataGridView1_MouseClick(object sender, MouseEventArgs e)
        {
            try
            {
                int id = Convert.ToInt32(dataGridView1.CurrentRow.Cells["ID"].Value.ToString());
                //List<Kiralama> kiralamas = new List<Kiralama>();
                kiralamas = new Kiralama();
                kiralamas = db.Kiralamas.Find(id);

                Arabalar arabalar = new Arabalar();
                arabalar = db.Arabalars.Find(kiralamas.ArabaID);

                Musteriler musteriler = new Musteriler();
                musteriler = db.Musterilers.Find(kiralamas.MusteriID);

                textBox1.Text = arabalar.Marka.ToString();
                textBox2.Text = musteriler.Adi.ToString();

                textBox3.Text = kiralamas.AlisTarihi.ToString();
                textBox4.Text = kiralamas.TeslimTarihi.ToString();
                textBox5.Text = kiralamas.KiralanmaSuresi.ToString();
                textBox6.Text = kiralamas.FaturaTutari.ToString();

                textBox7.Text = arabalar.Model.ToString();
            }
            catch (Exception)
            {
                return;
            }
        }
Exemplo n.º 2
0
        public List <Musteriler> TakeData()
        {
            List <Musteriler> musteriler = new List <Musteriler>();
            Veri          veritabani     = new Veri();
            SqlConnection connection     = veritabani.OpenConnection();
            SqlCommand    sqlCommand     = veritabani.CreateConnection("SELECT MusteriID,SirketAdi,MusteriAdi," +
                                                                       "MusteriUnvani,Adres,Sehir,Bolge,PostaKodu,Ulke,Telefon,Faks from Musteriler");
            SqlDataReader dataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection);

            while (dataReader.Read())
            {
                Musteriler musteri = new Musteriler(
                    dataReader["MusteriID"].ToString(),
                    dataReader["SirketAdi"].ToString(),
                    dataReader["MusteriAdi"].ToString(),
                    dataReader["MusteriUnvani"].ToString(),
                    dataReader["Adres"].ToString(),
                    dataReader["Sehir"].ToString(),
                    dataReader["Bolge"].ToString(),
                    dataReader["PostaKodu"].ToString(),
                    dataReader["Ulke"].ToString(),
                    dataReader["Telefon"].ToString(),
                    dataReader["Faks"].ToString());
                musteriler.Add(musteri);
            }

            connection.Close();
            return(musteriler);
        }
Exemplo n.º 3
0
 public void MusteriEkle(Musteri m)
 {
     if (Musteriler.Count == 0)
     {
         Random r = new Random();
         m.MusteriNumarasi = r.Next(1, 1000);
         Random r1 = new Random();
         m.Sifre = r1.Next(1000, 9999);
     }
     else
     {
         foreach (var m1 in Musteriler)
         {
             Random r   = new Random();
             int    no  = r.Next(1, 1000);
             Random r1  = new Random();
             int    no1 = r1.Next(1000, 9999);
             if (no != m1.MusteriNumarasi)
             {
                 m.MusteriNumarasi = no;
             }
             if (no1 != m1.Sifre)
             {
                 m.Sifre = no1;
             }
         }
     }
     Musteriler.Add(m);
 }
Exemplo n.º 4
0
        private void müşteriToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Musteriler frm2 = new Musteriler();

            frm2.MdiParent = this;
            frm2.Show();
        }
Exemplo n.º 5
0
        private void btnEkle_Click(object sender, EventArgs e)
        {
            Musteriler m = new Musteriler();

            m.Adi          = txtAdi.Text;
            m.Soyadi       = txtSoyadi.Text;
            m.SirketAdi    = txtSirketAdi.Text;
            m.Tckn         = mskdTckn.Text;
            m.TelNo        = mskdTelefon.Text;
            m.DogumTarihi  = dtpDogumTarihi.Value;
            m.MedeniDurumu = (MedeniDurumTip)Enum.Parse(typeof(MedeniDurumTip), cmbMedeniDurum.SelectedItem.ToString());
            m.Cinsiyet     = (Cinsiyet)Enum.Parse(typeof(Cinsiyet), cmbCinsiyet.SelectedItem.ToString());

            bool sonuc = mOrm.Insert(m);

            if (sonuc)
            {
                dataGridView1.DataSource = mOrm.Select();
                MessageBox.Show("Müşteri Eklenmiştir.");
            }
            else
            {
                MessageBox.Show("Müşteri Eklerken Hata Oluştu");
            }
        }
        private void cariodetamaminiode_Click(object sender, EventArgs e)
        {
            Musteriler musteriler     = new Musteriler();
            var        MusteriCariOde = db.Musteriler.Where(w => w.MusteriAdi == cariodemusteriadi.Text).FirstOrDefault();

            try
            {
                String Odeme = MusteriCariOde.MusteriBakiyesi;
                MusteriCariOde.MusteriBakiyesi = "0";
                db.SaveChanges();
                var explorer   = new PosExplorer();
                var deviceInfo = explorer.GetDevice(DeviceType.PosPrinter);
                if (deviceInfo == null)
                {
                    MessageBox.Show("BİLGİSAYARA BAĞLI YAZICI YOK YADA BAĞLANTI KURULAMADI", "ÇEKİRDEK KOD TERS MÜHENDİSLİK KORUMASI!");
                    return;
                }
                Yazici = (PosPrinter)explorer.CreateInstance(deviceInfo);
                Yazici.Open();
                Yazici.Claim(500);
                Yazici.DeviceEnabled      = true;
                Yazici.StatusUpdateEvent += (s, evt) =>
                {
                    if (evt.Status == PosPrinter.StatusCoverOpen)
                    {
                        MessageBox.Show("Yazıcının kağıt kapağı açıldı");
                    }
                    if (evt.Status == PosPrinter.StatusCoverOK)
                    {
                        MessageBox.Show("Yazıcının kağıt kapağı kapandı");
                    }
                    if (evt.Status == PosPrinter.StatusJournalCartridgeEmpty)
                    {
                        MessageBox.Show("Yazıcının kartuşu bitmek üzere");
                    }
                };
                Yazici.PrintNormal(PrinterStation.Slip, "                          PRESTIGE CAFE                       " + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "CARİ ÖDEME BİLGİ FİŞİ" + "  TARİH: " + DateTime.Now.ToShortDateString() + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "**************************************************************" + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "MÜŞTERİ ADI   : " + MusteriCariOde.MusteriAdi + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "--------------------------------------------------------------" + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "MÜŞTERİ CARİSİ: " + Odeme + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "--------------------------------------------------------------" + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "ÖDENEN MİKTAR : " + Odeme + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "**************************************************************" + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "                        TEŞEKKÜR EDERİZ                       " + Environment.NewLine);
                Yazici.PrintNormal(PrinterStation.Slip, "MARKETMATİK BETA V.1.0.2 [email protected]" + Environment.NewLine);
                Yazici.CutPaper(100);
                musteriyonetimformu = new MusteriYonetimFormu();
                musteriyonetimformu.Show();
                this.Close();
            }
            catch
            {
                MessageBox.Show("DÖNGÜSEL VERİTABANI HATASI. DATA BULUNAMADI YADA VERİTABANI BAĞLANTISI KESİLDİ.", "ÇEKİRDEK KOD ÖLÜMCÜL HATA!");
                MessageBox.Show("LÜTFEN GELİŞTİRİCİ İLE İRTİBAT KURUN. PROGRAM SONLANICAK", "ÇEKİRDEK KOD TERS MÜHENDİSLİK KORUMASI");
                Application.Exit();
            }
        }
Exemplo n.º 7
0
        public ActionResult DeleteConfirmed(int id)
        {
            Musteriler musteriler = db.Musterilers.Find(id);

            db.Musterilers.Remove(musteriler);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 8
0
        public void MusteriSil(Musteriler musteri)
        {
            SqlCommand cmd = dbhelper.GetSqlCommand();

            cmd.CommandText = "DELETE FROM TBL_MUSTERILER WHERE MusteriTC = @p1";
            cmd.Parameters.AddWithValue("@p1", musteri.MusteriTC);
            cmd.ExecuteNonQuery();
        }
        private void btn_AracKirala_Click(object sender, EventArgs e)
        {
            Musteriler m = new Musteriler();

            m.MusteriId = musteriler.Find(x => x.MusteriAd == cmb_MusSec.SelectedItem.ToString()).MusteriId;
            //a.AracId = firmalar.Find(x => x.FirmaAdi == cmb_FirmaSec.SelectedItem.ToString()).FirmaId;
            arac.Kirala(aracid);
            MessageBox.Show("Arac Kiralandi");
        }
Exemplo n.º 10
0
        public ActionResult MusteriDuzenle(int Id)
        {
            Musteriler model = _users.MusteriDetails(Id);

            ViewBag.sehir   = _film.IlListesi();
            ViewBag.sehirId = _film.IlceDetails(model.DigerBilgiler.IlceID).IlID;
            ViewBag.ilceId  = _film.IlceDetails(model.DigerBilgiler.IlceID).ID;
            return(View(model));
        }
Exemplo n.º 11
0
 private void dt_MusterileriGor_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     a = mus.IdyeGoreGetir(Convert.ToInt32(dt_MusterileriGor.SelectedRows[0].Cells[0].Value));
     txt_MusteriAd.Text        = a.MusteriAd;
     txt_MusteriSoyad.Text     = a.MusteriSoyad;
     txt_MusteriEhliyetNo.Text = a.MusteriEhliyetNo.ToString();
     txt_MusteriTelNo.Text     = a.MusteriTelNo;
     txt_MusteriEmail.Text     = a.MusteriEmail;
 }
Exemplo n.º 12
0
        public ActionResult Guncelle(Musteriler p1)
        {
            var musteri = db.Musterilers.Find(p1.MusteriID);

            musteri.MusteriAd    = p1.MusteriAd;
            musteri.MusteriSoyad = p1.MusteriSoyad;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 13
0
        private void btn_MusteridekiKiralikAraclar_Click(object sender, EventArgs e)
        {
            //sor sor sor
            MusterilerRepository arac = new MusterilerRepository();
            Musteriler           m    = new Musteriler();

            m.MusteriId = musteriler.Find(x => x.MusteriAd == cmb_MusteriSec.SelectedItem.ToString()).MusteriId;
            dt_MusteridekiKiralikAraclar.DataSource = arac.MusteridekiAraclar(m.MusteriId);
        }
Exemplo n.º 14
0
        public ActionResult repassword(string nowpassword, string newpassword, string newpassword2)
        {
            if (string.IsNullOrWhiteSpace(newpassword))
            {
                TempData["ok"] = "0";
                return(View());
            }
            if (string.IsNullOrWhiteSpace(newpassword2))
            {
                TempData["ok"] = "0";
                return(View());
            }
            Guid _id = getLoginUserId();

            if (_id == null)
            {
                return(new HttpNotFoundResult("Geçersiz hesap id parametresi"));
            }
            if (_id == Guid.Empty)
            {
                return(new HttpNotFoundResult("Geçersiz hesap id parametresi"));
            }
            Musteriler result      = _cari.Find(_id);
            string     nowPassHash = _hash.Create(nowpassword);

            if (result.GeciciPassword.Equals(nowPassHash))
            {
                string passHash1 = _hash.Create(newpassword);
                string passHash2 = _hash.Create(newpassword2);
                if (passHash1.Equals(passHash2))
                {
                    result.GeciciPassword
                        = passHash1;
                    _cari.Update(result);
                    TempData["ok"] = "1";
                    _hareket.Insert(new MusteriGirisHareketleri()
                    {
                        IslemTarihi        = DateTime.Now,
                        Islem              = HareketTipleri.Sifre_Degistirme,
                        IslemAciklama      = "Profilinizden şifrenizi değiştirdiniz.",
                        MusteriId          = result.Id,
                        CihazIp            = _client.GetClientIp(),
                        CihazBrowserAnonId = _client.GetClientAnonId(),
                        CihazBrowser       = _client.GetBrowser(_client.GetUserAgent(), _client.GetVersion())
                    });
                }
                else
                {
                    TempData["ok"] = "2";
                }
            }
            else
            {
                TempData["ok"] = "3";
            }
            return(View());
        }
 public ActionResult Edit([Bind(Include = "TC,Ad,Soyad,Cinsiyet,DoğumTarihi,Telefon,EMail,Adres,Sifre")] Musteriler musteriler)
 {
     if (ModelState.IsValid)
     {
         db.Entry(musteriler).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(musteriler));
 }
Exemplo n.º 16
0
 [HttpPost] //bir şeye nbasınca
 public ActionResult YeniMusteri(Musteriler p1)
 {
     if (!ModelState.IsValid)
     {
         return(View("YeniMusteri"));
     }
     db.Musterilers.Add(p1);
     db.SaveChanges();
     return(View());
 }
Exemplo n.º 17
0
 public ActionResult Edit([Bind(Include = "MusteriID,MusteriAdi,MusteriSoyadi,Adresi,TelNo,Telno2")] Musteriler musteriler)
 {
     if (ModelState.IsValid)
     {
         db.Entry(musteriler).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(musteriler));
 }
        private void btn_KiralaBitir_Click(object sender, EventArgs e)
        {
            Musteriler m = new Musteriler();

            m.MusteriId = musteriler.Find(x => x.MusteriAd == comboBox1.SelectedItem.ToString()).MusteriId;
            arac.KiralananıSal(aracid);
            gelirgider    = arac.GelirGiderler();
            textBox1.Text = gelirgider[0].AracGunlukKar.ToString();

            MessageBox.Show("Arac Bırakıldı");
        }
Exemplo n.º 19
0
        private void MusteriBilgileri(string tc)
        {
            Musteriler musteri = db.Musterilers.Where(x => x.TC == tc).FirstOrDefault();

            txt_tc.Text      = musteri.TC;
            txt_isim.Text    = musteri.Adi;
            txt_soyisim.Text = musteri.Soyadi;
            txt_ehliyet.Text = musteri.EhliyetNo;
            txt_adres.Text   = musteri.Adres;
            txt_tel.Text     = musteri.Telefon;
        }
Exemplo n.º 20
0
        private void btn_m_ekle_Click(object sender, EventArgs e)
        {
            Button btndzn = new Button();

            btndzn.Visible = true;
            this.Controls.Add(btndzn);
            Kullanicilar kullanici = new Kullanicilar();
            Musteriler   musteri   = new Musteriler();

            musteri.Ad        = txt_m_isim.Text;
            musteri.Soyad     = txt_m_soyisim.Text;
            musteri.TC        = txt_m_tc.Text;
            musteri.EhliyetNo = txt_m_ehliyet.Text;
            musteri.Telefon   = txt_m_telefon.Text;
            Regex reg = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");

            if (!reg.IsMatch(txt_m_email.Text))
            {
                MessageBox.Show("Geçersiz Mail Adresi");
                return;
            }
            else
            {
                musteri.Email = txt_m_email.Text;
            }
            musteri.Adres          = txt_m_adres.Text;
            musteri.Sifre          = txt_m_sifre.Text;
            musteri.AddDate        = DateTime.Now;
            musteri.AktifMi        = Convert.ToBoolean(cmb_m_aktifmi.SelectedIndex);
            kullanici.KullaniciAdi = txt_m_tc.Text;
            kullanici.Yetki        = "2";
            kullanici.Sifre        = txt_m_sifre.Text;
            db.Kullanicilars.Add(kullanici);
            db.Customers.Add(musteri);
            db.SaveChanges();
            MessageBox.Show("Müşteri kaydı eklendi");
            DialogResult cancel = new DialogResult();

            cancel = MessageBox.Show("Yeni Kayıt eklemek ister misiniz?", "Çıkmak için Hayıra basınız", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (cancel == DialogResult.No)
            {
                this.Close();
            }
            cmb_m_aktifmi.SelectedIndex = -1;
            txt_m_isim.Text             = string.Empty;
            txt_m_soyisim.Text          = default(string);
            txt_m_tc.Text      = default(string);
            txt_m_ehliyet.Text = string.Empty;
            txt_m_telefon.Text = string.Empty;
            txt_m_email.Text   = string.Empty;
            txt_m_adres.Text   = string.Empty;
            txt_m_sifre.Text   = string.Empty;
            CustomerList();
        }
Exemplo n.º 21
0
        public ActionResult YeniMusteri(Musteriler customer)
        {
            if (!ModelState.IsValid)
            {
                return(View("YeniMusteri"));
            }

            db.Musteriler.Add(customer);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Create([Bind(Include = "TC,Ad,Soyad,Cinsiyet,DoğumTarihi,Telefon,EMail,Adres,Sifre")] Musteriler musteriler)
        {
            if (ModelState.IsValid)
            {
                db.Musteriler.Add(musteriler);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(musteriler));
        }
Exemplo n.º 23
0
        public ActionResult Create([Bind(Include = "MusteriID,MusteriAdi,MusteriSoyadi,Adresi,TelNo,Telno2")] Musteriler musteriler)
        {
            if (ModelState.IsValid)
            {
                db.Musterilers.Add(musteriler);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(musteriler));
        }
Exemplo n.º 24
0
 public bool Sil(Musteriler obje)
 {
     try
     {
         string strSql = "UPDATE Musteriler SET SilindiMi = 1 WHERE MusteriId = '" + obje.MusteriId + "'";
         Baglanti.VeriGuncelle(strSql);
     }
     catch (Exception ex)
     { }
     return(false);
 }
 private void frmKullaniciİslemleri_Load(object sender, EventArgs e)
 {
     musteriler         = db.Musterilers.Find(id);
     txt_Adi.Text       = musteriler.Adi;
     txt_Soyadi.Text    = musteriler.Soyadi;
     txt_EhliyetNo.Text = musteriler.EhliyetNo;
     txt_Telefon.Text   = musteriler.Telefon;
     txt_TC.Text        = musteriler.TC;
     txt_Sifre.Text     = musteriler.Sifre;
     txt_Mail.Text      = musteriler.Email;
     txt_Adres.Text     = musteriler.Adres;
 }
Exemplo n.º 26
0
        public static Musteriler ConvertToMusteriler(MusterilerModel mm)
        {
            Musteriler m = new Musteriler();

            m.MusteriID    = mm.MusteriID;
            m.MusteriAd    = mm.MusteriAd;
            m.MusteriSoyad = mm.MusteriSoyad;
            m.Telefon      = mm.Telefon;
            m.Adres        = mm.Adres;

            return(m);
        }
Exemplo n.º 27
0
 public ActionResult edit(Musteriler model)
 {
     if (ModelState.IsValid)
     {
         _cari.Update(model);
         TempData["ok"] = "1";
     }
     else
     {
         TempData["ok"] = "0";
     }
     return(View(model));
 }
Exemplo n.º 28
0
 public bool Ekle(Musteriler entity)
 {
     try
     {
         Context.Set <Musteriler>().Add(entity);
         Context.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         throw new Exception("Business:AraclarBusiness::AracEkle::Error occured.", ex);
     }
 }
Exemplo n.º 29
0
 public bool Guncelle(Musteriler obje)
 {
     try
     {
         string strSql = @"UPDATE Musteriler SET MusteriAd = '" + obje.MusteriAd + "', MusteriSoyad = '" + obje.MusteriSoyad
                         + "', MusteriEhliyetNo = '" + obje.MusteriEhliyetNo + "', MusteriTCKNo = '" + obje.MusteriTCKNo + "', MusteriTelNo = '" + obje.MusteriTelNo
                         + "', MusteriEmail = '" + obje.MusteriEmail + "' WHERE MusteriId = '" + obje.MusteriId + "'";
         Baglanti.VeriGuncelle(strSql);
     }
     catch (Exception ex)
     { }
     return(false);
 }
Exemplo n.º 30
0
        // GET: Musteriler/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Musteriler musteriler = db.Musterilers.Find(id);

            if (musteriler == null)
            {
                return(HttpNotFound());
            }
            return(View(musteriler));
        }