Exemple #1
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            try
            {
                bool success;
                using (var uyeBusiness = new UyeBusiness())
                {
                    success = uyeBusiness.Sil(Convert.ToInt32(txtUyeID.Text));
                }
                var message = success ? "done" : "failed";


                try
                {
                    using (var uyeBusiness = new UyeBusiness())
                    {
                        List <Uye> customers = uyeBusiness.Listele().OrderBy(x => x.UyeID).ToList();
                        dataGrid_TumUye.DataSource = customers.ToList();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error happened: " + ex.Message);
                }
                MessageBox.Show("Operation " + message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error happened: " + ex.Message);
            }
        }
Exemple #2
0
 private void btnListele_Click(object sender, EventArgs e)
 {
     try
     {
         using (var uyeBusiness = new UyeBusiness())
         {
             List <Uye> customers = uyeBusiness.Listele().OrderBy(x => x.UyeID).ToList();
             dataGrid_TumUye.DataSource = customers.ToList();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error happened: " + ex.Message);
     }
 }
Exemple #3
0
        private void btnEkle_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtUyeIsim.Text) || string.IsNullOrEmpty(txtUyeSoyisim.Text))
            {
                throw new ValidationException("Kullanıcı Adı veya Şifre Boş Geçilemez !");
            }
            else
            {
                try
                {
                    bool success;
                    using (var uyeBusiness = new UyeBusiness())
                    {
                        success = uyeBusiness.Ekle(new Uye()
                        {
                            Isim    = txtUyeIsim.Text,
                            Soyisim = txtUyeSoyisim.Text,
                            TcNo    = Convert.ToInt64(txtUyeTcNo.Text)
                        });
                    }
                    var message = success ? "done" : "failed";


                    try
                    {
                        using (var uyeBusiness = new UyeBusiness())
                        {
                            List <Uye> customers = uyeBusiness.Listele().OrderBy(x => x.UyeID).ToList();
                            dataGrid_TumUye.DataSource = customers.ToList();
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Error happened: " + ex.Message);
                    }
                    MessageBox.Show("Operation " + message);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error happened: " + ex.Message);
                }
            }
            try
            {
                bool success;
                using (var uyeBusiness = new UyeBusiness())
                {
                    success = uyeBusiness.Ekle(new Uye()
                    {
                        Isim    = txtUyeIsim.Text,
                        Soyisim = txtUyeSoyisim.Text,
                        TcNo    = Convert.ToInt64(txtUyeTcNo.Text)
                    });
                }
                var message = success ? "done" : "failed";


                try
                {
                    using (var uyeBusiness = new UyeBusiness())
                    {
                        List <Uye> customers = uyeBusiness.Listele().OrderBy(x => x.UyeID).ToList();
                        dataGrid_TumUye.DataSource = customers.ToList();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error happened: " + ex.Message);
                }
                MessageBox.Show("Operation " + message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error happened: " + ex.Message);
            }
        }