Ejemplo n.º 1
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     try
     {
         bool success;
         using (var customerSoapClient = new KullaniciServisSoapClient())
         {
             success = customerSoapClient.InsertKullanici(new KullaniciServis.Kullanici()
             {
                 Ad      = txtCalisanAd.Text,
                 Soyad   = txtCalisanSoyad.Text,
                 Adres   = txtAdres.Text,
                 Telefon = txtTelefon.Text,
                 Email   = txtEmail.Text,
                 Sifre   = txtSifre.Text,
                 Rol     = txtRol.Text
             });
             MessageBox.Show("Kaydedildi.");
             temizle();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error happened: " + ex.Message);
     }
 }
Ejemplo n.º 2
0
        private void btnGüncelle_Click(object sender, EventArgs e)
        {
            try
            {
                using (var kullaniciServis = new KullaniciServisSoapClient())
                {
                    foreach (var item in KuList)
                    {
                        if (int.Parse(txtCalisanSil.Text) == item.KullaniciID)
                        {
                            var musteri = new KullaniciServis.Kullanici()
                            {
                                KullaniciID = item.KullaniciID,
                                Ad          = txtCalisanAd.Text,
                                Soyad       = txtCalisanSoyad.Text,
                                Adres       = txtAdres.Text,
                                Telefon     = txtTelefon.Text,
                                Email       = txtEmail.Text,
                                Sifre       = txtSifre.Text,
                                Rol         = txtRol.Text
                            };

                            kullaniciServis.UpdateKullanici(musteri);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error happened: " + ex.Message);
            }
        }
Ejemplo n.º 3
0
 public void KullaniciListele()
 {
     KuList.Clear();
     try
     {
         using (var customerSoapClient = new KullaniciServisSoapClient())
         {
             foreach (var responsedCustomer in customerSoapClient.SelectAllKullanici().OrderBy(x => x.KullaniciID).ToList())
             {
                 Kullanici castedCustomer = new Kullanici()
                 {
                     KullaniciID = responsedCustomer.KullaniciID,
                     Ad          = responsedCustomer.Ad,
                     Soyad       = responsedCustomer.Soyad,
                     Adres       = responsedCustomer.Adres,
                     Telefon     = responsedCustomer.Telefon,
                     Email       = responsedCustomer.Email,
                     Sifre       = responsedCustomer.Sifre,
                     Rol         = responsedCustomer.Rol
                 };
                 KuList.Add(castedCustomer);
             }
             dgvListele.DataSource = KuList.ToList();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error happened: " + ex.Message);
     }
 }
Ejemplo n.º 4
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            using (var KullaniciSoapClient = new KullaniciServisSoapClient())
            {
                foreach (var item in KuList.ToList())
                {
                    if (item.Ad == txtCalisanSil.Text)
                    {
                        KullaniciSoapClient.DeleteKullanici(item.KullaniciID);
                        KuList.Remove(item);
                        MessageBox.Show("Silindi.");
                    }
                }
            }

            KullaniciListele();
            txtCalisanSil.Clear();
        }