示例#1
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();
            }
        }
    }
示例#2
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");
    }
示例#3
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");
    }
示例#4
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");
        }


    }
示例#5
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);
        }
    }
示例#6
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");
    }
示例#7
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 { }
        }
    }
示例#8
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");
    }
示例#9
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
                {
                    vt.SorguCalistir("DELETE FROM snlg_V1.TblAnketApp WHERE AnketId IN (" + Request.Form["HdnSil"] + ")", System.Data.CommandType.Text);
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz anketler silindi.", false);
                    GVAnketler.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }

        if (IsPostBack)
            GridSayfala(GVAnketler, "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)
        {

        }

    }
示例#11
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);
    }
示例#12
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();
     }
 }
示例#13
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();
 }
示例#14
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";
    }
示例#15
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();
        }
    }
示例#16
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();
    }
示例#17
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();
 }
示例#18
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);
        }
    }
示例#19
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");
        }
    }
示例#20
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();
            }

            
        }
      
    }
示例#21
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();
 }
示例#22
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);
    }
示例#23
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();
     }
 }
示例#24
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();
            }
        }

    }
示例#25
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();
            }
        }
    }
示例#26
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;
     }
 }
示例#27
0
    protected void ImgKaydet_Click(object sender, EventArgs e)
    {
        if (YetkiKontrol(pageName + "-Insert"))
        {
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            StringBuilder sbSorgu = new StringBuilder();
            foreach (GridViewRow satir in GVYetki.Rows)
                if (((CheckBox)satir.FindControl("CB")).Checked)
                    sbSorgu.Append("INSERT INTO snlg_V1.TblRol_Yetki (RolId, YetkiId) VALUES(@RolId, " + GVYetki.DataKeys[satir.RowIndex].Value.ToString() + "); ");

            Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[2];
            DBPrms[1] = new Snlg_DBParameter("@RolId", SqlDbType.Int, Request.QueryString["rid"]);
            DBPrms[0] = new Snlg_DBParameter("@YetkiSql", SqlDbType.NVarChar, sbSorgu.ToString());

            vt.SorguCalistir("snlg_V1.msp_Rol_YetkiTanimla", System.Data.CommandType.StoredProcedure, DBPrms);
            vt.Kapat();
            Snlg_Hata.ziyaretci.HataGosterBasarili("Yetkiler tanımlandı.", false);
        }
    }
示例#28
0
 public static string Siralama_Kaydet(string _siralama)
 {
     StringBuilder SBSorgu = new StringBuilder();
     string[] siralama = _siralama.Replace("liMenu", "").Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
     foreach (string altSira in siralama)
     {
         string[] list = altSira.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         for (int i = 0; i < list.Length; i++)
             SBSorgu.AppendFormat("UPDATE snlg_V1.TblMakaleKtgApp SET Sira = {0} WHERE KtgId = {1}; ", i.ToString(), list[i]);
     }
     try
     {
         Snlg_DBConnect vt = new Snlg_DBConnect(true);
         vt.SorguCalistir(SBSorgu.ToString(), CommandType.Text);
         vt.Kapat();
         return "Sıralama kaydedildi.";
     }
     catch { return "Beklenmeyen bir hata oluştu..."; }
 }
示例#29
0
 protected void BtnEkle_Click(object sender, EventArgs e)
 {
     if (YetkiKontrol(pageName + "-Insert"))
     {
         Snlg_DBConnect vt = new Snlg_DBConnect(true);
         try
         {
             vt.SorguCalistir("snlg_V1.msp_RoleUyeEkle", System.Data.CommandType.StoredProcedure, new Snlg_DBParameter[3] { new Snlg_DBParameter("@UserName", SqlDbType.NVarChar, TBUser.Text.Trim()), new Snlg_DBParameter("@RolId", SqlDbType.SmallInt, Request.QueryString["rid"]), new Snlg_DBParameter("@AdminId", SqlDbType.Int, WebConfigurationManager.AppSettings["AdminId"]) });
             HdnHataTur.Value = "alert alert-success";
             HdnHata.Value = "Üye gruba eklendi.";
             GVUye.DataBind();
         }
         catch (Exception exc)
         {
             Snlg_Hata.ziyaretci.ExceptionLogla(exc);
             HdnHataTur.Value = "alert alert-danger";
             HdnHata.Value = "Beklenmeyen bir hata oluştu.";
         }
         vt.Kapat();
     }
 }
示例#30
0
    protected void ImgKaydet_Click(object sender, EventArgs e)
    {
        if (!YetkiKontrol(pageName + "-Update"))
            return;

        Snlg_ConfigValues.startPage = DDLLinks.SelectedValue.Remove(0, 1);
        Snlg_ConfigValues.defaultLangId = DDLDefLang.SelectedValue;
        Snlg_ConfigValues.adminDefaultLangId = Convert.ToInt32(DDLAdminLang.SelectedValue);
        Snlg_ConfigValues.urlExtension = (CBExtension.Checked ? ".aspx" : "");

        Snlg_DBConnect vt = new Snlg_DBConnect(true);

        vt.SorguCalistir("UPDATE snlg_V1.TblDegiskenler SET Deger = @Deger WHERE Degisken = N'AcilisSayfasi'", CommandType.Text, new Snlg_DBParameter[1] { new Snlg_DBParameter("@Deger", SqlDbType.NVarChar, DDLLinks.SelectedValue.Remove(0, 1)) });
        vt.SorguCalistir("UPDATE snlg_V1.TblDegiskenler SET Deger = @Deger WHERE Degisken = N'urlExtension'", CommandType.Text, new Snlg_DBParameter[1] { new Snlg_DBParameter("@Deger", SqlDbType.NVarChar, Snlg_ConfigValues.urlExtension) });
        vt.SorguCalistir("UPDATE snlg_V1.TblDegiskenler SET Deger = @Deger WHERE Degisken = N'DefaultLang'", CommandType.Text, new Snlg_DBParameter[1] { new Snlg_DBParameter("@Deger", SqlDbType.NVarChar, Snlg_ConfigValues.defaultLangId) });
        vt.SorguCalistir("UPDATE snlg_V1.TblDegiskenler SET Deger = @Deger WHERE Degisken = N'adminDefaultLangID'", CommandType.Text, new Snlg_DBParameter[1] { new Snlg_DBParameter("@Deger", SqlDbType.NVarChar, Snlg_ConfigValues.adminDefaultLangId) });

        vt.Kapat();

        Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler kaydedildi.", false);
    }