Beispiel #1
0
        private void mbtnGuncelle_Click(object sender, EventArgs e)
        {
            bool kontrol = Kontrol();

            if (MessageBox.Show("KARTI GÜNCELLEMEK İSTEDİĞİNİZE EMİN MİSİNİZ", "UYARI", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                if (!kontrol)
                {
                    try
                    {
                        _kartService.Update(new Kart
                        {
                            KartId          = Convert.ToInt32(mgrdGuncelle.CurrentRow.Cells[0].Value),
                            TeknikUzmanId   = Convert.ToInt32(mcbxTeknikUzmanGuncelle.SelectedValue),
                            Tarih           = Convert.ToDateTime(mdtmTarihGuncelle.Value),
                            KartNo          = Convert.ToInt32(mtbxKartNoGuncelle.Text),
                            ProjeNoAd       = mtbxProjeNoAdGuncelle.Text,
                            TahminiSure     = Convert.ToInt32(mcbxTahminiSureGuncelle.SelectedValue),
                            GerceklesenSure = Convert.ToInt32(mtbxGerceklesenSureGuncelle.Text),
                            IsinAciklamasi  = tbxIsAciklamaGuncelle.Text,
                            Notlar          = tbxNotlarGuncelle.Text
                        });
                        MessageBox.Show("Kart Güncellendi");
                        mgrdGuncelle.DataSource = _kartService.GetAll();
                        Temizle();
                        pnlGuncelle.Enabled = false;
                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show(exception.Message);
                    }
                }
            }
            else
            {
                MessageBox.Show("Kart Güncellenemedi");
                Temizle();
                pnlGuncelle.Enabled = false;
            }
        }
Beispiel #2
0
 public IActionResult Put([FromBody] KartItem kart)
 {
     _kartService.Update(kart);
     return(base.Ok(new NoContentResponse("Ok", "updated kart")));
 }