Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (YetkiKontrol(pageName + "-Delete"))
        {
            if (Page.IsPostBack && !string.IsNullOrEmpty(Request.Form["HdnSil"]) && Regex.IsMatch(Request.Form["HdnSil"].Replace(",", ""), "^\\d+$"))
            {//seçilen değerler varsa siliniyor
                Snlg_DBConnect vt = new Snlg_DBConnect(true);
                try
                {
                    vt.SorguCalistir("snlg_V1.msp_EPostaSablonSil", CommandType.StoredProcedure, new Snlg_DBParameter[1] { new Snlg_DBParameter("@EPId", SqlDbType.VarChar, Request.Form["HdnSil"])});
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz e-posta şablonu silindi.", false);
                    GV.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }
        else
        {
            Snlg_Hata.ziyaretci.HataGosterHatali("Bu işlemi yapmak için yetkili değilsiniz.", false);
            return;
        }

        if (IsPostBack)
            GridSayfala(GV, "Sayfalama");
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            GridSayfala(GVYorumlar, "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
                {
                    vt.SorguCalistir("DELETE FROM snlg_V1.TblMakaleYorum FROM snlg_V1.TblMakaleYorum AS TMY INNER JOIN snlg_V1.TblMakaleApp AS TMA ON TMY.MakId = TMA.MakId WHERE TMY.YId IN (" + Request.Form["HdnSil"] + ")", System.Data.CommandType.Text);
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz yorumlar silindi.", false);
                    GVYorumlar.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["rid"] == null && !Page.IsPostBack)
            Response.Redirect("roles.aspx", true);

        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
                {
                    vt.SorguCalistir("DELETE FROM snlg_V1.TblRol_Uye WHERE RolId = " + Convert.ToInt32(Request.QueryString["rid"]).ToString() + " AND UyeId IN (" + Request.Form["HdnSil"] + ")", System.Data.CommandType.Text);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Seçtiğiniz üyeler gurupdan silindi.", false);
                    GVUye.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }
    }
Exemple #4
0
    protected void BtnUC_Click(object sender, EventArgs e)
    {
        Snlg_DBConnect vt = new Snlg_DBConnect(true);
        foreach (GridViewRow satir in GVUC.Rows)
            if (((CheckBox)satir.FindControl("CBSec")).Checked)
            {
                if (string.IsNullOrEmpty(((TextBox)satir.FindControl("TB3")).Text))
                    break;

                //kontroller aktarılıyor
                Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[6];
                DBPrms[0] = new Snlg_DBParameter("@Title", System.Data.SqlDbType.NVarChar, ((TextBox)satir.FindControl("TB3")).Text, 100);
                DBPrms[1] = new Snlg_DBParameter("@Baslik", System.Data.SqlDbType.NVarChar, ((TextBox)satir.FindControl("TB1")).Text, 250);
                DBPrms[2] = new Snlg_DBParameter("@Gorunurluk", System.Data.SqlDbType.TinyInt, ((DropDownList)satir.FindControl("DDL1")).SelectedValue);
                DBPrms[3] = new Snlg_DBParameter("@BaslikGorunsun", System.Data.SqlDbType.Bit, ((CheckBox)satir.FindControl("CB1")).Checked);
                DBPrms[4] = new Snlg_DBParameter("@Aciklama", System.Data.SqlDbType.VarChar, ((TextBox)satir.FindControl("TB2")).Text, 500);
                DBPrms[5] = new Snlg_DBParameter("@UCPath", System.Data.SqlDbType.NVarChar, satir.Cells[1].Text.Replace(".ascx", ""), 250);

                if (string.IsNullOrEmpty(((TextBox)satir.FindControl("TB2")).Text))
                    DBPrms[4].Deger = DBNull.Value;
                if (string.IsNullOrEmpty(((TextBox)satir.FindControl("TB1")).Text))
                    DBPrms[1].Deger = DBNull.Value;

                vt.SorguCalistir("snlg_V1.msp_UCKontrolEkle", CommandType.StoredProcedure, DBPrms);
            }
        vt.Kapat();
        Snlg_Hata.ziyaretci.HataGosterBasarili("Kontroller tanımlandı.", false);
    }
Exemple #5
0
 protected void BtnKaydet_Click(object sender, EventArgs e)
 {
     if (YetkiKontrol(pageName + "-Update"))
     {
         Snlg_DBConnect vt = new Snlg_DBConnect(true);
         try
         {
             foreach (GridViewRow satir in GV1.Rows)
             {
                 Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[2];
                 DBPrms[0] = new Snlg_DBParameter("@Title", SqlDbType.NVarChar, ((TextBox)satir.FindControl("TB")).Text, 100);
                 DBPrms[1] = new Snlg_DBParameter("@ContainerId", SqlDbType.SmallInt, GV1.DataKeys[satir.RowIndex].Value.ToString());
                 if (string.IsNullOrEmpty(DBPrms[0].Deger.ToString()))
                     return;
                 vt.SorguCalistir("UPDATE snlg_V1.TblPlaceHolders SET Title = @Title WHERE (ContainerId = @ContainerId) ", CommandType.Text, DBPrms);
             }
             Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler kaydedildi.", false);
         }
         catch (Exception exc)
         {
             Snlg_Hata.ziyaretci.ExceptionLogla(exc);
             Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
         }
         vt.Kapat();
     }
 }
Exemple #6
0
 protected void GridBind()
 {
     Snlg_DBConnect vt = new Snlg_DBConnect(true);
     GV1.DataSource = vt.DBReaderOlustur("SELECT ContainerId, PHName, Title FROM snlg_V1.TblPlaceHolders ORDER BY PHName", CommandType.Text);
     GV1.DataBind();
     vt.Kapat();
 }
Exemple #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindGrdView();
        }
        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
                {
                    vt.SorguCalistir("snlg_V1.msp_ProjeAltBilgiSil", CommandType.StoredProcedure, new Snlg_DBParameter[1] { new Snlg_DBParameter("@ProjeAltId", SqlDbType.VarChar, Request.Form["HdnSil"])  });
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz proje sayfaları silindi.", false);
                    GVIcerikler.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }

        if (IsPostBack)
            GridSayfala(GVIcerikler, "Sayfalama");
    }
    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)
        {

        }

    }
Exemple #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!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
                {
                    vt.SorguCalistir("snlg_V1.msp_SayfaSil", CommandType.StoredProcedure, new Snlg_DBParameter[1] { new Snlg_DBParameter("@SayfaId", SqlDbType.VarChar, Request.Form["HdnSil"]) });
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz sayfalar silindi.", false);

                    Response.Redirect(Request.Url.AbsolutePath);
                }
                catch (Exception exc)
                {
                    //Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    //Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }
        else
        {
            GridSayfala(GVSyf, "Sayfalama");
        }


    }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            GridBind();

        if (Page.IsPostBack && !string.IsNullOrEmpty(Request.Form["HdnSil"]) && Regex.IsMatch(Request.Form["HdnSil"].Replace(",", "").Replace("-", ""), "^\\d+$"))
        {//seçilen değerler varsa siliniyor
            if (YetkiKontrol(pageName + "-Delete"))
            {
                Snlg_DBConnect vt = new Snlg_DBConnect(true);
                try
                {
                    vt.SorguCalistir("DELETE FROM snlg_V1.TblPlaceHolders WHERE ContainerId IN (" + Request.Form["HdnSil"] + ")", System.Data.CommandType.Text);
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz yer tutucular silindi.", false);
                    GridBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        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
                {
                    using (SqlDataReader sdr = vt.DBReaderOlustur("SELECT Resim FROM snlg_V1.TblResimGaleriResimlerApp WHERE GId IN (" + Request.Form["HdnSil"] + "); DELETE FROM snlg_V1.TblResimGaleriApp WHERE GId IN (" + Request.Form["HdnSil"] + ") ;", CommandType.Text))
                    {
                        //while (sdr.Read())
                        //    try
                        //    {
                        //        File.Delete(Server.MapPath("~" + sdr["Resim"].ToString()));
                        //        File.Delete(Server.MapPath("~" + sdr["Resim"].ToString()));
                        //    }
                        //    catch { }
                    }
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", true);
                }
                vt.Kapat();
                Snlg_Hata.ziyaretci.HataGosterBasarili("Seçilen galeriler silindi.", true);
                Response.Redirect(Request.Url.AbsolutePath);
            }
        }

        GridSayfala(GVGal, "Sayfalama");
    }
Exemple #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //site içi sayfa linkleri listeleniyor
            Snlg_DBConnect vt = new Snlg_DBConnect(true);

            Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[1];
            DBPrms[0] = new Snlg_DBParameter("@Dil", SqlDbType.SmallInt, DBNull.Value);
            using (SqlDataReader sdr = vt.DBReaderOlustur("snlg_V1.msp_LinkListele", CommandType.StoredProcedure, DBPrms))
            {
                while (sdr.Read())
                {
                    ListItem item = new ListItem(sdr["LinkText"].ToString(), sdr["Link"].ToString());
                    item.Selected = sdr["Link"].ToString() == "/" + Snlg_ConfigValues.startPage;
                    DDLLinks.Items.Add(item);
                }
            }

            DataTable dtLang= vt.DataTableOlustur("SELECT DId, Name FROM snlg_V1.TblDiller WHERE Aktif = 1 ORDER BY Name", CommandType.Text);
            DDLDefLang.DataSource = dtLang;
            DDLDefLang.DataBind();
            DDLAdminLang.DataSource = dtLang;
            DDLAdminLang.DataBind();

            vt.Kapat();
            CBExtension.Checked = !string.IsNullOrEmpty(Snlg_ConfigValues.urlExtension);
            try { DDLDefLang.SelectedValue = Snlg_ConfigValues.defaultLangId; }
            catch { }
            try { DDLAdminLang.SelectedValue = Snlg_ConfigValues.adminDefaultLangId.ToString(); }
            catch { }
        }
    }
Exemple #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        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
                {
                    using (SqlDataReader Sdr = vt.DBReaderOlustur("snlg_V1.msp_ReferansKtgSil", CommandType.StoredProcedure, new Snlg_DBParameter[1] { new Snlg_DBParameter("@KtgId", SqlDbType.VarChar, Request.Form["HdnSil"]) }))
                    {
                        //if (Sdr.Read())
                        //    try
                        //    {
                        //        foreach (string resim in Sdr[0].ToString().TrimEnd(',').Split(','))
                        //            File.Delete(Server.MapPath("~/uploads/referans/rf_" + resim));
                        //    }
                        //    catch { }
                    }
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz kategoriler silindi.", false);
                    GVKtg.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }

        if (IsPostBack)
            GridSayfala(GVKtg, "Sayfalama");
    }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack && !string.IsNullOrEmpty(Request.Form["HdnSil"]) && Regex.IsMatch(Request.Form["HdnSil"].Replace(",", "").Replace("-", ""), "^\\d+$"))
        {//seçilen değerler varsa siliniyor
            if (YetkiKontrol(pageName + "-Delete"))
            {
                Snlg_DBConnect vt = new Snlg_DBConnect(true);
                try
                {
                    vt.SorguCalistir("DELETE FROM snlg_V1.TblUCApp WHERE UCId IN (" + Request.Form["HdnSil"] + ")", System.Data.CommandType.Text);
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz bloklar silindi.", false);
                    GVSyf.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
            else
            {
                Snlg_Hata.ziyaretci.HataGosterHatali("Bu işlemi yapmak için yetkili değilsiniz.", false);
                return;
               
            }
        }

        if (IsPostBack)
            GridSayfala(GVSyf, "Sayfalama");
    }
Exemple #15
0
    protected void ImgKaydet_Click(object sender, EventArgs e)
    {
        if (YetkiKontrol(pageName + "-Update"))
        {
            if (!("," + Request.Form["CBDil"] + ",31,").Contains("," + Snlg_ConfigValues.defaultLangId + ","))
            {
                Snlg_Hata.ziyaretci.HataGosterHatali("Varsayılan olarak seçili dilin işaretini kaldıramazsın.", false);
                return;
            }

            string sorgu = "UPDATE snlg_V1.TblDiller SET Aktif = 0 WHERE DId <> " + Snlg_ConfigValues.defaultLangId + "; ";
            try
            {
                sorgu += "UPDATE snlg_V1.TblDiller SET Aktif = 1 WHERE DId = 31; ";
                if (!string.IsNullOrEmpty(Request.Form["CBDil"]))
                    sorgu += "UPDATE snlg_V1.TblDiller SET Aktif = 1 WHERE DId IN (" + Request.Form["CBDil"] + "); ";
                Snlg_DBConnect vt = new Snlg_DBConnect(true);
                vt.SorguCalistir(sorgu, CommandType.Text);
                Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler kaydedildi.", true);
                vt.Kapat();
            }
            catch { Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluşut.", true); }
            Response.Redirect(Request.Url.AbsoluteUri);
        }
    }
    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);
            }
        }


    }
Exemple #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (!IsPostBack)
        {
            BindGrdView();
        }
        if (Page.IsPostBack && !string.IsNullOrEmpty(Request.Form["HdnSil"]) && Regex.IsMatch(Request.Form["HdnSil"].Replace(",", ""), "^\\d+$"))
        {//seçilen resimler varsa siliniyor
            if (YetkiKontrol(pageName + "-Delete"))
            {
                Snlg_DBConnect vt = new Snlg_DBConnect(true);
                try
                {
                    //seçilen resimleri tablodan al sonra sil sonra da varsayılan resim (silindiyse) başka resim tanımla
                    using (SqlDataReader sdr = vt.DBReaderOlustur(@"
SELECT Resim FROM snlg_V1.TblUrunResim WHERE ResimId IN (" + Request.Form["HdnSil"] + @") AND UrunId=@UrunId;               
DELETE FROM snlg_V1.TblUrunResim WHERE ResimId IN (" + Request.Form["HdnSil"] + @") AND UrunId=@UrunId;               
UPDATE snlg_V1.TblUrunApp SET Resim = (SELECT TOP (1) Resim FROM snlg_V1.TblUrunResim WHERE (UrunId = @UrunId)) 
    WHERE (UrunId = @UrunId) 
        AND NOT EXISTS(SELECT TUA.UrunId FROM snlg_V1.TblUrunApp AS TUA 
                                            INNER JOIN snlg_V1.TblUrunResim AS TUR ON TUA.UrunId = TUR.UrunId AND TUA.Resim = TUR.Resim 
                        WHERE (TUA.UrunId = @UrunId));", CommandType.Text, new Snlg_DBParameter[1] { new Snlg_DBParameter("@UrunId", SqlDbType.Int, Request.QueryString["uid"]) }))
                    {
                        //while (sdr.Read())
                        //    try
                        //    {
                        //        File.Delete(Server.MapPath("~/uploads/urun/u_" + sdr["Resim"].ToString()));
                        //        File.Delete(Server.MapPath("~/uploads/urun/k_u_" + sdr["Resim"].ToString()));
                        //    }
                        //    catch { }
                    }
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", true);
                }
                vt.Kapat();
                Snlg_Hata.ziyaretci.HataGosterBasarili("Seçilen resimler silindi.", true);
                Response.Redirect(Request.Url.AbsoluteUri);
            }
        }


        if (Request.QueryString["uid"] != null)
        {
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            SqlDataReader SDRUrunBilgisi = vt.DBReaderOlustur("SELECT * FROM  snlg_V1.TblUrunDetay WHERE UrunId=@UrunId", CommandType.Text, new Snlg_DBParameter[1] { new Snlg_DBParameter("@UrunId", SqlDbType.Int, Request.QueryString["uid"]) });

            if (SDRUrunBilgisi.Read())
            {
                LblUrunAdi.Text = SDRUrunBilgisi["UrunAd"].ToString();
            }
            vt.Kapat();
        }
    }
Exemple #18
0
    protected void LinkRSil_Click(object sender, EventArgs e)
    {//resim silniyor.
        if (!YetkiKontrol(pageName + "-Delete"))
            return;

        Snlg_DBConnect vt = new Snlg_DBConnect(true);
        int silinen = vt.SorguCalistir("UPDATE snlg_V1.TblReferansApp SET Resim = NULL WHERE RId = @RId ", CommandType.Text, new Snlg_DBParameter[] { new Snlg_DBParameter("@RId", SqlDbType.Int, Request.QueryString["rid"]) });
        vt.Kapat();
        Snlg_Hata.ziyaretci.HataGosterBasarili("Resim silindi.", false);
        FVResim.DataBind();
    }
Exemple #19
0
 private void BindGrdView()
 {
     Snlg_DBConnect vt = new Snlg_DBConnect(true);
     string sqlSorgu = string.Format(@"SELECT  TblProjeAltBilgiApp.ProjeAltId, TblProjeAltBilgiApp.Sira, TblProjeAltBilgiDetay.Baslik,
                                         TblProjeAltBilgiApp.Gorunurluk, TblProjeAltBilgiDetay.SeoUrl
                                         FROM    snlg_V1.TblProjeAltBilgiApp INNER JOIN
                                                     snlg_V1.TblProjeAltBilgiDetay ON TblProjeAltBilgiApp.ProjeAltId = TblProjeAltBilgiDetay.ProjeAltId INNER JOIN
                                                     snlg_V1.TblProjeDetay ON TblProjeAltBilgiApp.ProjeId = TblProjeDetay.ProjeId
                                         WHERE   (TblProjeAltBilgiDetay.Dil = {0}) ORDER BY TblProjeAltBilgiApp.Sira ASC", Snlg_ConfigValues.defaultLangId);
     GrdSiralama.DataSource = vt.DataTableOlustur(sqlSorgu, System.Data.CommandType.Text);
     GrdSiralama.DataBind();
 }
Exemple #20
0
 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();
 }
Exemple #21
0
    protected void SDSYorum_Updated(object sender, SqlDataSourceStatusEventArgs e)
    {
        if (e.Exception == null)
        {
            Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler kaydedildi.", false);
            MPE1.Hide();
            GVYorumlar.DataBind();
            if (((CheckBox)FVYorum.FindControl("CBMail")).Checked)
            {
                Snlg_DBConnect vt = new Snlg_DBConnect(true);
                try
                {
                    DataTable DtMail = vt.DataTableOlustur("snlg_V1.zsp_EPostaSablonGetir_Smtp", CommandType.StoredProcedure, new Snlg_DBParameter[2] { new Snlg_DBParameter("@Anahtar", SqlDbType.VarChar, "makaleYorumOnay"), new Snlg_DBParameter("@Ozelifadeler", SqlDbType.VarChar, "$#url_adresi#$") });

                    Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[1];
                    DBPrms[0] = new Snlg_DBParameter("@YId", SqlDbType.Int, e.Command.Parameters["@YId"].Value.ToString());
                    SqlDataReader sdr = vt.DBReaderOlustur("snlg_V1.msp_MakaleYorumCevapEposta", CommandType.StoredProcedure, DBPrms);

                    if (DtMail.Rows.Count > 0)
                    {//mail gönder
                        DataRow drMail = DtMail.Rows[0];
                        Snlg_Mail eposta = new Snlg_Mail();
                        while (sdr.Read())
                        {
                            if (!string.IsNullOrEmpty(drMail["Kimden"].ToString()) && !string.IsNullOrEmpty(drMail["SmtpHost"].ToString()))
                            {
                                eposta.smtp = new System.Net.Mail.SmtpClient(drMail["SmtpHost"].ToString(), Convert.ToInt32(drMail["SmtpPort"]));
                                eposta.smtp.EnableSsl = Convert.ToBoolean(drMail["SSL_"]);
                                eposta.smtp.Credentials = new System.Net.NetworkCredential(drMail["Kimden"].ToString(), drMail["SmtpPsw"].ToString());
                            }
                            try
                            {//ilgili yorumculra mesaj
                                eposta.Gonder(drMail["Kimden"].ToString(), drMail["KimdenIsim"].ToString(), sdr["Kime"].ToString(), drMail["Konu"].ToString(), drMail["Mesaj"].ToString().Replace("$#url_adresi#$", Request.Url.Host + sdr["SeoUrl"].ToString()));
                            }
                            catch { }
                        }
                        sdr.Close();
                    }
                }
                catch { }
                vt.Kapat();
            }
        }
        else
        {
            MPE1.Hide();
            Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
            e.ExceptionHandled = true;
            Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", true);
        }
    }
Exemple #22
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(UCId))
            UCId = "-1";

        Snlg_DBConnect vt = new Snlg_DBConnect(true);
        dtMenuGroup = vt.DataTableOlustur("SELECT * FROM snlg_V1.TblUcApp WHERE BlokType = 'Menu' ORDER BY Title", CommandType.Text);
        vt.Kapat();
        if (dtMenuGroup.Rows.Count < 1)
        {
            Snlg_Hata.ziyaretci.HataGosterUyari("Menü oluşturmadan önce bir menü grubu tanımlamalısınız.", true);
            Response.Redirect("menu-groups.aspx");
        }
    }
Exemple #23
0
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!Page.IsPostBack)
        {//ust kategori için ddl dolduruluyor

            DDLKtg.Items.Clear();
            DDLKtg.Items.Add(new ListItem("Tüm Kategorileri Göster", ""));
            DataTable dt = new DataTable();
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            dt = vt.DataTableOlustur("SELECT snlg_V1.TblReferansKtgApp.KtgId, snlg_V1.TblReferansKtgDetay.KtgAd FROM snlg_V1.TblReferansKtgApp LEFT OUTER JOIN snlg_V1.TblReferansKtgDetay ON snlg_V1.TblReferansKtgApp.KtgId = snlg_V1.TblReferansKtgDetay.KtgId AND snlg_V1.TblReferansKtgDetay.Dil= " + Snlg_ConfigValues.defaultLangId, CommandType.Text);
            foreach (DataRow dr in dt.Rows)
            {
                DDLKtg.Items.Add(new ListItem(dr["KtgAd"].ToString(), dr["KtgId"].ToString()));
            }
            vt.Kapat();
        }
        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
                {
                    using (SqlDataReader Sdr = vt.DBReaderOlustur("snlg_V1.msp_ReferansSil", CommandType.StoredProcedure, new Snlg_DBParameter[1] { new Snlg_DBParameter("@RId", SqlDbType.VarChar, Request.Form["HdnSil"]) }))
                    {
                        //if (Sdr.Read())
                        //    try
                        //    {
                        //        foreach (string resim in Sdr[0].ToString().TrimEnd(',').Split(','))
                        //            File.Delete(Server.MapPath("~/uploads/referans/rf_" + resim));
                        //    }
                        //    catch { }
                    }
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz referanslar silindi.", false);
                    GVResim.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }

            
        }
      
    }
Exemple #24
0
 protected void BtnTasi_Click(object sender, EventArgs e)
 {
     Snlg_DBConnect vt = new Snlg_DBConnect(true);
     try
     {
         vt.SorguCalistir("snlg_V1.msp_SablonTasi", System.Data.CommandType.StoredProcedure, new Snlg_DBParameter[2] { new Snlg_DBParameter("@SablonIdFrom", SqlDbType.SmallInt, DDLFrom.SelectedValue), new Snlg_DBParameter("@SablonIdTo", SqlDbType.SmallInt, DDLTo.SelectedValue) });
         Snlg_Hata.ziyaretci.HataGosterBasarili("İşleminiz gerçekleştirildi.", false);
     }
     catch (Exception exc)
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(exc);
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
     vt.Kapat();
 }
Exemple #25
0
    protected void SdsUrlkeysGroup_Inserted(object sender, SqlDataSourceStatusEventArgs e)
    {
        if (e.Exception == null)
            Snlg_Hata.ziyaretci.HataGosterBasarili("Url Keys tanımlandı.", true);
        else
        {
            Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
            e.ExceptionHandled = true;
            Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", true);
        }

        Snlg_DBConnect vt = new Snlg_DBConnect(true);
        Snlg_ConfigValues.DTurlKeyList = vt.DataTableOlustur("SELECT UrlKeyValue,UrlKeyName, Dil FROM snlg_V1.TblUrlKeys ", CommandType.Text);
        vt.Kapat();
        Response.Redirect(Request.Url.AbsoluteUri, true);
    }
Exemple #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Snlg_DBConnect vt = new Snlg_DBConnect(true);
         using (SqlDataReader sdr = vt.DBReaderOlustur("SELECT GglDogrula, GglAnalytic, GglUser, GglPsw, GglProfId FROM snlg_V1.TblAramaMotoru", CommandType.Text))
         {
             if (sdr.Read())
             {
                 TBAnly.Text = sdr["GglAnalytic"].ToString();
                 TBValid.Text = sdr["GglDogrula"].ToString();
             }
         }
         vt.Kapat();
     }
 }
Exemple #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {//ust kategori için ddl dolduruluyor
            DDLKtg.Items.Clear();
            DDLKtg.Items.Add(new ListItem("Tüm Kategorileri Göster", ""));
            DDLDoldur(DTKtgler.Select("UstId IS NULL"), "", null, DDLKtg);
        }
        else
            GridSayfala(GVUrun, "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
                {
                    using (SqlDataReader Sdr = vt.DBReaderOlustur("snlg_V1.msp_UrunSil", CommandType.StoredProcedure, new Snlg_DBParameter[1] { new Snlg_DBParameter("@UrunId", SqlDbType.VarChar, Request.Form["HdnSil"]) }))
                    {
                        //if (Sdr.Read())
                        //    foreach (string resim in Sdr[0].ToString().TrimEnd(',').Split(','))
                        //    {
                        //        try
                        //        {
                        //            File.Delete(Server.MapPath("~/uploads/urun/k_u_" + resim.Trim()));
                        //            File.Delete(Server.MapPath("~/uploads/urun/u_" + resim.Trim()));
                        //        }
                        //        catch { }
                        //    }
                    }
                    HdnHataTur.Value = "basarili";
                    HdnHata.Value = "Seçtiğiniz ürünler silindi.";
                    GVUrun.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    HdnHataTur.Value = "hatali";
                    HdnHata.Value = "Beklenmeyen bir hata oluştu.";
                }
                vt.Kapat();
            }
        }

    }
Exemple #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            GridSayfala(GVResim, "Sayfalama");
        else if (string.IsNullOrEmpty(Request.QueryString["gid"]))
            Response.Redirect("photo-galleries.aspx");

        if (!IsPostBack)
        {
            BindGrdView();
        }


        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);
                //using (SqlDataReader sdr = vt.DBReaderOlustur("SELECT Resim FROM snlg_V1.TblResimGaleriResimlerApp WHERE RId IN (" + Request.Form["HdnSil"] + ")", CommandType.Text))
                //{
                //    while (sdr.Read())
                //    {
                //        try
                //        {
                //            File.Delete(Server.MapPath("~" + sdr["Resim"].ToString()));
                //            File.Delete(Server.MapPath("~" + sdr["Resim"].ToString()));
                //        }
                //        catch { }
                //    }
                //}
                try
                {
                    vt.SorguCalistir("DELETE FROM snlg_V1.TblResimGaleriResimlerApp WHERE RId IN (" + Request.Form["HdnSil"] + ")", CommandType.Text);
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz resimler silindi.", false);
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
                GVResim.DataBind();
            }
        }
    }
Exemple #29
0
 protected void ImgKaydet_Click(object sender, EventArgs e)
 {
     if (YetkiKontrol(pageName + "-Insert"))
     {
         Snlg_DBConnect vt = new Snlg_DBConnect(true);
         Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[5];
         DBPrms[0] = new Snlg_DBParameter("@GglProfId", SqlDbType.NVarChar, "");
         DBPrms[1] = new Snlg_DBParameter("@GglDogrula", SqlDbType.NVarChar, TBValid.Text);
         DBPrms[2] = new Snlg_DBParameter("@GglAnalytic", SqlDbType.NVarChar, TBAnly.Text);
         DBPrms[3] = new Snlg_DBParameter("@GglUser", SqlDbType.NVarChar, "");
         DBPrms[4] = new Snlg_DBParameter("@GglPsw", SqlDbType.NVarChar, "");
         vt.SorguCalistir("snlg_V1.msp_AramaMotoruDuzenle", CommandType.StoredProcedure, DBPrms);
         Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler kaydedildi.", false);
         vt.Kapat();
         Snlg_ConfigValues.aramaMotoru = TBValid.Text + TBAnly.Text;
     }
 }
Exemple #30
0
    public static string AnketSonuc(int AnketId)
    {
        if (!string.IsNullOrEmpty(AnketId.ToString()))
        {
            StringBuilder sb = new StringBuilder();
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            try
            {
                Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[1];
                DBPrms[0] = new Snlg_DBParameter("@AnketId", SqlDbType.Int, AnketId);

                using (SqlDataReader SDR = vt.DBReaderOlustur("snlg_V1.msp_AnketSonuc", CommandType.StoredProcedure, DBPrms))
                {
                    if (SDR.Read())
                    {
                        sb.AppendFormat("{{\"{0}\":[{{\"{1}\":{2}}},{{\"{3}\":{4}}}", SDR["Soru"].ToString(), SDR["A"].ToString(), SDR["ASay"].ToString(), SDR["B"].ToString(), SDR["BSay"].ToString());
                        if (!string.IsNullOrEmpty(SDR["C"].ToString()))
                            sb.AppendFormat(",{{\"{0}\":{1}}}", SDR["C"].ToString(), SDR["CSay"].ToString());
                        if (!string.IsNullOrEmpty(SDR["D"].ToString()))
                            sb.AppendFormat(",{{\"{0}\":{1}}}", SDR["D"].ToString(), SDR["DSay"].ToString());
                        if (!string.IsNullOrEmpty(SDR["E"].ToString()))
                            sb.AppendFormat(",{{\"{0}\":{1}}}", SDR["E"].ToString(), SDR["ESay"].ToString());
                        if (!string.IsNullOrEmpty(SDR["F"].ToString()))
                            sb.AppendFormat(",{{\"{0}\":{1}}}", SDR["F"].ToString(), SDR["FSay"].ToString());
                        if (!string.IsNullOrEmpty(SDR["G"].ToString()))
                            sb.AppendFormat(",{{\"{0}\":{1}}}", SDR["G"].ToString(), SDR["GSay"].ToString());
                        if (!string.IsNullOrEmpty(SDR["H"].ToString()))
                            sb.AppendFormat(",{{\"{0}\":{1}}}", SDR["H"].ToString(), SDR["HSay"].ToString());
                        sb.Append("]}");
                    }
                }
            }
            catch (Exception exc)
            {
                vt.Kapat();
                Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                return "0";
            }
            vt.Kapat();

            return sb.ToString();
        }

        return "0";
    }