public static void GirisCikis(string Islem) { using (BaglantiCumlesi db = new BaglantiCumlesi()) { tbl_olay_giris_cikis TblOlay = new tbl_olay_giris_cikis(); TblOlay.kullanici_id = int.Parse(HttpContext.Current.Request.Cookies["" + Class.Fonksiyonlar.Genel.Parametre().Select(b => b.guvenlik_kodu).FirstOrDefault() + "KullaniciID"].Value); TblOlay.islem = Islem; TblOlay.ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; TblOlay.all_http = HttpContext.Current.Request.ServerVariables["ALL_HTTP"];; TblOlay.all_raw = HttpContext.Current.Request.ServerVariables["ALL_RAW"];; db.AddTotbl_olay_giris_cikis(TblOlay); db.SaveChanges(); } }
protected void secilenlerisil_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(100); foreach (GridViewRow satir in kayitlar.Rows) { CheckBox kutu = (CheckBox)satir.FindControl("secim"); if (kutu.Checked) { int ID = int.Parse(kayitlar.DataKeys[satir.RowIndex].Value.ToString()); using (BaglantiCumlesi db = new BaglantiCumlesi()) { tbl_olay_giris_cikis TblSil = db.tbl_olay_giris_cikis.First(a => a.id == ID); db.DeleteObject(TblSil); db.SaveChanges(); } Yonetim.Olay.Islem("olay_giriscikis", "Silindi", ID.ToString()); } } KayitYukle(""); }