private void btnLogin_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtUsername.Text)) { MessageBox.Show("Lütfen kullanıcı adınızı giriniz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error); txtUsername.Focus(); } using (var db = new DbTeknikServisEntities1()) { var rec = db.Calisanlar.Where(u => u.KullaniciAdı == txtUsername.Text && u.Sifre == txtPassword.Text).FirstOrDefault(); if (rec != null) { Form1 frm = new Form1(); frm.Show(); this.Hide(); } else { logger.Error("Kullanıcı hatalı giriş yaptı."); MessageBox.Show("Kullanıcı adı veya şifre yanlış.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void FrmFaturaPopup_Load(object sender, EventArgs e) { DbTeknikServisEntities1 db = new DbTeknikServisEntities1(); gridControl1.DataSource = (from x in db.FaturaDetaylar.Where(y => y.FaturaId == id) select new { x.FaturaDetayId, x.Urun, x.Adet, x.Fiyat, x.Tutar, x.FaturaId }).ToList(); gridControl2.DataSource = (from f in db.Faturalar.Where(z => z.Id == id) select new { f.Id, f.SiraNo, f.Cariler.Ad, f.Tarih, f.VergiDaire }).ToList(); }