예제 #1
0
 private bool InsertKullanici(string kullaniciAdi, string parola, string kullaniciTuru)
 {
     try
     {
         using (var kullaniciSoapClient = new KullaniciWebServiceSoapClient())
         {
             return(kullaniciSoapClient.InsertKullanici(new Kullanici()
             {
                 kullaniciAd = kullaniciAdi,
                 parola = parola,
                 kullaniciTuru = kullaniciTuru
             }));
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Customer doesn't exists.");
     }
 }
예제 #2
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            int kullaniciId;

            KullaniciService.Kullanici kullanici = new KullaniciService.Kullanici()
            {
                kullaniciAd   = txtKullaniciAdi.Text,
                kullaniciTuru = "yetkili",
                parola        = txtKullaniciSifre.Text
            };
            using (var kullaniciSoapClient = new KullaniciWebServiceSoapClient())
            {
                kullaniciSoapClient.InsertKullanici(kullanici);
                kullaniciId = kullaniciSoapClient.MaxKullaniciId();
            }
            Calisan calisan = new Calisan()
            {
                ad       = txtAd.Text,
                soyad    = txtSoyad.Text,
                sirketId = 5
            };

            using (var calisanSoapClient = new CalisanWebServiceSoapClient())
            {
                if (calisanSoapClient.InsertCalisan(calisan))
                {
                    MessageBox.Show("Personel Başarıyla Eklendi");
                    txtSoyad.Text          = "";
                    txtAd.Text             = "";
                    txtKullaniciAdi.Text   = "";
                    txtKullaniciSifre.Text = "";
                }
                else
                {
                    MessageBox.Show("Kayıt Yapılırken bir hata oluştu!");
                }
            }
        }
예제 #3
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            int kullaniciId;

            KullaniciService.Kullanici kullanici = new KullaniciService.Kullanici()
            {
                kullaniciAd   = txtKullaniciAdi.Text,
                kullaniciTuru = "yetkili",
                parola        = txtKullaniciSifre.Text
            };
            using (var kullaniciSoapClient = new KullaniciWebServiceSoapClient())
            {
                kullaniciSoapClient.InsertKullanici(kullanici);
                kullaniciId = kullaniciSoapClient.MaxKullaniciId();
            }
            Musteri musteri = new Musteri()
            {
                ad    = txtAd.Text,
                soyad = txtSoyad.Text
            };

            using (var musteriSoapClient = new MusteriWebServiceSoapClient())
            {
                if (musteriSoapClient.InsertMusteri(musteri))
                {
                    MessageBox.Show("Müşteri Başarıyla Eklendi");
                    txtSoyad.Text          = "";
                    txtAd.Text             = "";
                    txtKullaniciAdi.Text   = "";
                    txtKullaniciSifre.Text = "";
                }
                else
                {
                    MessageBox.Show("Kayıt Yapılırken bir hata oluştu!");
                }
            }
        }