protected void gvSatis_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Duzenle") { guid = Convert.ToInt32(e.CommandArgument); lblId.Text = guid.ToString(); Satis.Text = "Guncelle"; //? if (guid != 0) { bagla(guid, sender, e); } ModalSatis.Show(); } else if (e.CommandName == "Sil") { try { long YemeklerId = Convert.ToInt64(e.CommandArgument); Satis Satis = SatisBLL.SelectWithId(YemeklerId); if (Satis != null) { Satis.SatisAktif = false; SatisBLL.Update(YemeklerId, Satis); } GridDoldur(); } catch (Exception ex) { } } }
private void bagla(long guid, object sender, EventArgs e) { try { Satis Satis = SatisBLL.SelectWithId(guid); if (Satis != null) { if (ddlYemekId != null) { ddlYemekId.SelectedValue = ddlYemekId.ToString(); } else { ddlYemekId.SelectedValue = ""; } if (Satis.SatisAdet != null) { string gecici = Satis.SatisAdet.ToString(); txtSatisAdet.Text = gecici.ToString(); } else { txtSatisAdet.Text = ""; } if (Satis.SatisTarih != null) { txtSatisTarih.Text = Satis.SatisTarih.Value.ToShortDateString(); } else { txtSatisTarih.Text = ""; } if (!string.IsNullOrEmpty(Satis.SatisTutar)) { txtSatisTutar.Text = Satis.SatisTutar; } else { txtSatisTutar.Text = ""; } } } catch (Exception ex) { } }