private void PbStar1_Click(object sender, EventArgs e) { if (rbTEdilmemis.Checked) { return; } if (lstSiparisler.SelectedItem == null) { MessageBox.Show("Siparis Seçmediniz"); return; } SiparisRepo sp = new SiparisRepo(); Siparis siparis = sp.SiparisiGetir((lstSiparisler.SelectedItem as MusterininSiparisleriViewModel).SiparisID); siparis.Yildiz = byte.Parse((sender as PictureBox).Tag.ToString()); sp.Update(); FirmaRepo fr = new FirmaRepo(); int siparissayisi; int yildiz = fr.FirmaYildiziGuncelle(seciliSiparis.FirmaID, out siparissayisi); Firma firma = fr.FirmayiGetir((lstSiparisler.SelectedItem as MusterininSiparisleriViewModel).FirmaID); firma.Yildiz = Convert.ToDouble(yildiz / siparissayisi); fr.Update(); SiparisleriGetir(); }
private void btnTesim_Click(object sender, EventArgs e) { if (lstMusteriSiparis.SelectedItem == null) { MessageBox.Show("Lütfen teslim ettiğiniz siparişi seçiniz", "Sipariş Seçmediniz", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } SiparisRepo sp = new SiparisRepo(); Siparis siparis = sp.SiparisiGetir((lstMusteriSiparis.SelectedItem as FirmaVerilenSiparislerViewModel).SiparisID); //FirmaVerilenSiparislerViewModel secilisiparis = lstMusteriSiparis.SelectedItem as FirmaVerilenSiparislerViewModel; siparis.TeslimTarihi = DateTime.Now; sp.Update(); SiparisleriYukle(); }