private void guncelleBtn_Click(object sender, EventArgs e)
        {
            if (id != -1)
            {
                var entity = _musteriServis.Update(new Musteri
                {
                    ID         = id,
                    AD         = adTxt.Text.ToString(),
                    SOYAD      = soyadTxt.Text.ToString(),
                    TELEFON1   = telefon1Masked.Text.ToString(),
                    TELEFON2   = telefon2Masked.Text.ToString(),
                    TC         = tcTxt.Text.ToString(),
                    MAIL       = mailTxt.Text.ToString(),
                    IL         = ilCbx.SelectedText.ToString(),
                    ILCE       = ilceCbx.SelectedText.ToString(),
                    ADRES      = adresTxt.Text.ToString(),
                    VERGIDAIRE = vergiDairesiTxt.Text.ToString()
                });

                if (entity != null)
                {
                    BindData();
                    MessageBox.Show("Güncelleme işlemi başarılı oldu.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Temizle();
                }
                else
                {
                    MessageBox.Show("Güncelleme işlemi başarısız oldu.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Lütfen listeden Güncelleme müsteriyi seçiniz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
示例#2
0
 private void barDuzenle_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (MessageBox.Show("Müşteri Bilgilerini Güncellemek İstiyor musunuz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         try
         {
             _musteriService.Update(new Musteri
             {
                 MusteriId  = int.Parse(textId.Text),
                 Ad         = textAd.Text,
                 Soyad      = textSoyad.Text,
                 Tc         = maskTCKimlik.Text,
                 Telefon1   = maskTelefon1.Text,
                 Telefon2   = maskTelefon2.Text,
                 Mail       = txtMail.Text,
                 Il         = comIl.Text,
                 Ilce       = comIlce.Text,
                 Adres      = richAdres.Text,
                 VergiDaire = textvergiDairesi.Text,
             });
             MessageBox.Show("Güncelleme İşlemi Başarılı. Değişiklikleri Görmek için YENİLE Butonuna Basınız", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         catch (Exception exception)
         {
             MessageBox.Show(exception.Message);
             MessageBox.Show("Müşteri Bilgileri Güncellenemedi ", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("Müşteri Bilgileri Güncellenemedi ", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
示例#3
0
 private void Guncelle()
 {
     if (id != -1)
     {
         try
         {
             musteriServis.Update(new Entities.Concrete.Musteri
             {
                 Id                = id,
                 MusteriAd         = adTxt.Text.ToString(),
                 MusteriSoyad      = soyadTxt.Text.ToString(),
                 MusteriTelefon    = telefonTxt.Text.ToString(),
                 MusteriMail       = mailTxt.Text.ToString(),
                 MusteriBanka      = bankaTxt.Text.ToString(),
                 MusteriVergiDaire = vergiDairesiTxt.Text.ToString(),
                 MusteriVergiNo    = vergiNumarasiTxt.Text.ToString(),
                 MusteriStatu      = statuTxt.Text.ToString(),
                 MusteriIl         = ilTxt.Text.ToString(),
                 MusteriIlce       = ilceTxt.Text.ToString(),
                 MusteriAcikAdres  = acikAdresTxt.Text.ToString()
             });
             MessageBox.Show("Müşteri güncelleme işlemi başarılı oldu.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Güncellenecek müşteriyi listeden seçiniz.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public async Task <IActionResult> Save([FromForm] Musteri musteri)
        {
            try
            {
                musteri.FirmaId         = HttpContext.Session.GetInt32(Metrics.SessionKeys.FirmaId).Value;
                musteri.CreatorId       = HttpContext.Session.GetInt32(Metrics.SessionKeys.UserId).Value;
                musteri.Kullanici.RolId = await _rolService.MusteriRolId();

                if (musteri.Id == 0)
                {
                    musteri.KullaniciId = await _kullaniciService.Save(musteri.Kullanici);

                    musteri.Kullanici = null;
                    await _musteriService.Save(musteri);
                }
                else
                {
                    var model = await _musteriService.Get(musteri.Id, musteri.FirmaId.Value);

                    musteri.Kullanici.Id = model.KullaniciId;
                    musteri.KullaniciId  = model.KullaniciId;
                    await _kullaniciService.Update(musteri.Kullanici);

                    await _musteriService.Update(musteri);
                }

                return(Json(true));
            }
            catch (Exception e)
            {
                return(Json(false));
            }
        }
      public ActionResult Index(MusteriModel model, int page = 1)
      {
          Musteri musteri = _musteriService.GetById(model.MusteriBilgiler.MusteriId);

          musteri.Parola = model.MusteriBilgiler.Parola;
          var musteri1 = _musteriService.Update(musteri);

          string aboneNo          = musteri1.AboneNo;
          var    sinyaller        = _sinyallerService.GetAboneSinyal(aboneNo);
          var    aranacak         = _aranacakService.GetAll(aboneNo);
          var    islenmisSinyaler = _islenmisSinyallerService.GetAboneSinyal(aboneNo);
          int    sayfaBoyu        = 10;

          MusteriModel model1 = new MusteriModel()
          {
              Aranacaklars       = aranacak,
              MusteriBilgiler    = musteri1,
              IslenmisSinyallers = islenmisSinyaler,
              //bulunulan sayfa*sabit satır sayısı kadar atla
              MusteriSinyaller = sinyaller.Skip((page - 1) * sayfaBoyu).Take(sayfaBoyu).ToList()
          };



          return(View(model1));
      }
示例#6
0
 public IActionResult AboneGuncelle(MusteriAddModel model)
 {
     if (ModelState.IsValid) // Gerekli Alanlar Dolduruldu ise
     {
         try
         {
             // Veri tabanına kayıt işlemleri
             _musteriService.Update(model.musteri);
             foreach (var arakisi in model.Aranacaklars)
             {
                 _aranacakService.Update(arakisi);
             }
             TempData["sonuc"] = "0";
         }
         catch (Exception e)
         { Console.WriteLine(e);
           TempData["sonuc"] = "1"; }
     }
     return(View());
 }