protected void Page_Load(object sender, System.EventArgs e) { if (IsPostBack) GridSayfala(GVUye, "Sayfalama"); if (Page.IsPostBack && !string.IsNullOrEmpty(Request.Form["HdnSil"]) && Regex.IsMatch(Request.Form["HdnSil"].Replace(",", ""), "^\\d+$")) {//seçilen değerler varsa siliniyor if (YetkiKontrol(pageName + "-Delete")) { Snlg_DBConnect vt = new Snlg_DBConnect(true); try { object resimler = vt.ScalarSorguCalistir("snlg_V1.msp_UyeSil", CommandType.StoredProcedure, new Snlg_DBParameter[2] { new Snlg_DBParameter("@Uyeler", SqlDbType.VarChar, Request.Form["HdnSil"]), new Snlg_DBParameter("@AdminId", SqlDbType.VarChar, Snlg_ConfigValues.AdminId) }); try { foreach (string resim in resimler.ToString().TrimEnd(',').Split(',')) File.Delete(Server.MapPath("~/uploads/user/" + resim)); } catch { } Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz üyeler silindi.", false); GVUye.DataBind(); } catch (Exception exc) { if (exc.Message.Contains("$#sqlhata1#$")) Snlg_Hata.ziyaretci.HataGosterHatali("Bu kullanıcı yönetici olarak tanımlanmıştır, silinemez.", false); else { Snlg_Hata.ziyaretci.ExceptionLogla(exc); Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false); } } vt.Kapat(); } } }
protected void YetkiKontrol(string yetki, bool redirect) { Snlg_DBConnect vt = new Snlg_DBConnect(true); { vt.Ac(); object sonuc = vt.ScalarSorguCalistir("snlg_V1.msp_AdminRolKontrol ", CommandType.StoredProcedure, new Snlg_DBParameter[2] { new Snlg_DBParameter("@pageName", SqlDbType.NVarChar, yetki), new Snlg_DBParameter("@UyeID", SqlDbType.Int, Snlg_MemberInfo.s_UserId) }); if (sonuc.ToString() == "0" && Snlg_MemberInfo.s_UserId != Snlg_ConfigValues.AdminId) { Snlg_Hata.ziyaretci.HataGosterHatali("Bu işlem için yetkili değilsiniz. \"" + yetki + "\" yetki anahtarı için yetki almalısınız.", true); if (Request.UrlReferrer != null) Response.Redirect(Request.UrlReferrer.AbsoluteUri, redirect); else Response.Redirect("/admin/login.aspx", redirect); } vt.Kapat(); } }
protected bool YetkiKontrol(string yetki) { Snlg_DBConnect vt = new Snlg_DBConnect(true); bool deger = true; vt.Ac(); object sonuc = vt.ScalarSorguCalistir("snlg_V1.msp_AdminRolKontrol ", CommandType.StoredProcedure, new Snlg_DBParameter[2] { new Snlg_DBParameter("@pageName", SqlDbType.NVarChar, yetki), new Snlg_DBParameter("@UyeID", SqlDbType.Int, Snlg_MemberInfo.s_UserId) }); if (sonuc.ToString() == "0" && Snlg_MemberInfo.s_UserId != Snlg_ConfigValues.AdminId) { Snlg_Hata.ziyaretci.HataGosterHatali("Bu işlem için yetkili değilsiniz. \"" + yetki + "\" yetki anahtarı için yetki almalısınız.", true); deger = false; } vt.Kapat(); return deger; }
public static void ApplicationStartMetod() { Snlg_DBConnect vt = new Snlg_DBConnect(true); Snlg_ConfigValues.DTurlKeyList = vt.DataTableOlustur("SELECT UrlKeyValue,UrlKeyName, Dil FROM snlg_V1.TblUrlKeys ", CommandType.Text); Snlg_ConfigValues.urlExtension = vt.ScalarSorguCalistir("SELECT Deger FROM snlg_V1.TblDegiskenler WHERE Degisken = 'urlExtension'", CommandType.Text).ToString(); Snlg_ConfigValues.startPage = vt.ScalarSorguCalistir("SELECT Deger FROM snlg_V1.TblDegiskenler WHERE Degisken = 'AcilisSayfasi'", CommandType.Text).ToString(); Snlg_ConfigValues.defaultLangId = vt.ScalarSorguCalistir("SELECT Deger FROM snlg_V1.TblDegiskenler WHERE Degisken = 'DefaultLang'", CommandType.Text).ToString(); Snlg_ConfigValues.adminDefaultLangId = Convert.ToInt32(vt.ScalarSorguCalistir("SELECT Deger FROM snlg_V1.TblDegiskenler WHERE Degisken = 'adminDefaultLangID'", CommandType.Text).ToString()); vt.Kapat(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Snlg_MemberInfo.s_UserId = null; Snlg_MemberInfo.s_UserId = null; Snlg_MemberInfo.s_UserId = null; //Snlg_MemberInfo.c_LoginGuid = null; Snlg_MemberInfo.s_UserUrl = null; //Snlg_MemberInfo.s_YetkiSayfalar = null; Snlg_MemberInfo.s_YetkiSayfalar = null; //Snlg_MemberInfo.c_UserName = null; Snlg_DBConnect vt = new Snlg_DBConnect(true); object versiyon = vt.ScalarSorguCalistir("SELECT Deger FROM [snlg_V1].[TblDegiskenler] WHERE Degisken = 'SanalogVersiyon'", CommandType.Text); vt.Kapat(); if (versiyon != null) LtrVers.Text = "<meta name=\"generator\" content=\"Sanalog - Bu Sitede GELECEK Var. " + versiyon.ToString() + "\" />"; } }