protected void txtFiyat_TextChanged(object sender, EventArgs e) { if (!YetkiKontrol(pageName + "-Insert")) { return; } try { TextBox txtFiyat = (TextBox)sender; GridViewRow gvRow = (GridViewRow)(sender as Control).Parent.Parent; int index = gvRow.RowIndex; string id = GVUrun.DataKeys[index].Value.ToString(); Snlg_DBConnect vt = new Snlg_DBConnect(true); vt.Ac(); int silinen = vt.SorguCalistir("UPDATE snlg_V1.TblUrunApp SET Fiyat = @fiyat WHERE UrunId = @id ", System.Data.CommandType.Text, new Snlg_DBParameter[2] { new Snlg_DBParameter("@fiyat", SqlDbType.Decimal, txtFiyat.Text), new Snlg_DBParameter("@id", SqlDbType.SmallInt, id) }); vt.Kapat(); } catch (Exception) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Uri realURL = new Uri(HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.RawUrl); guid = HttpUtility.ParseQueryString(realURL.Query).Get("guid"); if (!string.IsNullOrEmpty(guid)) { Snlg_DBConnect vt = new Snlg_DBConnect(true); vt.Ac(); string SqlSorgu = string.Format(@"SELECT * FROM snlg_V1.TblUyeApp AS TBUA INNER JOIN snlg_V1.TblUyeDetay AS TBUD ON TBUA.UyeId=TBUD.UyeId WHERE TBUA.SifreUnuttumGuid='{0}'", guid); DataTable DtKayitVari = vt.DataTableOlustur(SqlSorgu, CommandType.Text); if (DtKayitVari.Rows.Count > 0) { UyeAdi = DtKayitVari.Rows[0]["UyeAd"].ToString(); } vt.Kapat(); } } } catch (Exception) { } }
protected void BtnSifreSifirlama_Click(object sender, EventArgs e) { Uri realURL = new Uri(HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.RawUrl); guid = HttpUtility.ParseQueryString(realURL.Query).Get("guid"); if (!string.IsNullOrEmpty(guid)) { Snlg_DBConnect vt = new Snlg_DBConnect(true); vt.Ac(); if (!string.IsNullOrEmpty(TxtPassword.Text) && TxtPassword.Text == TxtPassword2.Text) { string SqlSorgu = string.Format(@"SELECT * FROM snlg_V1.TblUyeApp AS TBUA INNER JOIN snlg_V1.TblUyeDetay AS TBUD ON TBUA.UyeId=TBUD.UyeId WHERE TBUA.SifreUnuttumGuid='{0}'", guid); DataTable DtKayitVari = vt.DataTableOlustur(SqlSorgu, CommandType.Text); if (DtKayitVari.Rows.Count > 0) { #region parametreler string Sifre = TxtPassword.Text; Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[4]; try { string Eposta = DtKayitVari.Rows[0]["Eposta"].ToString(); DBPrms[0] = new Snlg_DBParameter("@IslemTipi", SqlDbType.Int, 1); DBPrms[1] = new Snlg_DBParameter("@Eposta", SqlDbType.VarChar, Eposta, 150); DBPrms[2] = new Snlg_DBParameter("@Sifre", SqlDbType.VarChar, Snlg_ConfigValues.MD5Olustur(Sifre), 128); DBPrms[3] = new Snlg_DBParameter("@guidDegeri", SqlDbType.VarChar, DBNull.Value); using (SqlDataReader sdr = vt.DBReaderOlustur("snlg_V1.zsp_UyeSifreSifirla", CommandType.StoredProcedure, DBPrms)) { try { if (sdr.Read()) { Snlg_Hata.ziyaretci.HataGosterBasarili(Resources._default.login_ascx_hata13, false, "#" + UserControlClientID); TxtPassword2.Text = TxtPassword.Text = ""; } } catch (Exception exc) { Snlg_Hata.ziyaretci.HataGosterHatali(Resources._default.hataBeklenmeyen, false, "#" + UserControlClientID); } } } catch { Snlg_Hata.ziyaretci.HataGosterHatali(Resources._default.hataBeklenmeyen, false, "#" + UserControlClientID); } #endregion } } else { Snlg_Hata.ziyaretci.HataGosterHatali(Resources._default.login_ascx_hata12, false, "#" + UserControlClientID); } } }
protected void FVSyf_DataBound(object sender, EventArgs e) { Literal LtrDil = (Literal)FVSyf.FindControl("LtrDiller"); Snlg_DBConnect vt = new Snlg_DBConnect(true); SqlDataReader Sdr = vt.DBReaderOlustur("SELECT * FROM snlg_V1.TblDiller WHERE Aktif=1", CommandType.Text); vt.Ac(); while (Sdr.Read()) { LtrDil.Text += "<a href='?dil=" + Sdr["DId"].ToString() + "'><img src='/admin/common/images/flags/" + Sdr["DId"].ToString() + ".png' /></a>"; } vt.Kapat(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Snlg_DBConnect vt = new Snlg_DBConnect(true); vt.Ac(); SqlDataReader Sdr = vt.DBReaderOlustur("SELECT * FROM snlg_V1.TblDiller WHERE Aktif=1", CommandType.Text); vt.Ac(); while (Sdr.Read()) { LtrDiller.Text += "<a href='?dil=" + Sdr["DId"].ToString() + "'><img src='/admin/common/images/flags/" + Sdr["DId"].ToString() + ".png' /></a>"; } vt.Kapat(); } } catch (Exception exc) { Snlg_Hata.ziyaretci.ExceptionLogla(exc); Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", true); } }
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); }
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(); } }