Esempio n. 1
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();
 }
Esempio n. 2
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");
    }
Esempio n. 3
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 { }
        }
    }
Esempio n. 4
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");
    }
    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);
            }
        }


    }
Esempio n. 6
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();
        }
    }
Esempio n. 7
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();
 }
Esempio n. 8
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);
        }
    }
Esempio n. 9
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();
            }

            
        }
      
    }
Esempio n. 10
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();
     }
 }
Esempio n. 11
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();
            }
        }

    }
Esempio n. 12
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";
    }
Esempio n. 13
0
    //AnalyticsService service = new AnalyticsService(HttpContext.Current.Request.Url.Host);

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            string GglUser = "";
            string GglPsw = "";
            string GglProfId = "";

            using (SqlDataReader sdr = vt.DBReaderOlustur("snlg_V1.msp_DashBoardVerileri", CommandType.StoredProcedure))
            {
                if (sdr.Read())
                {
                    HL1.Text = "<span class=\"sayi\">" + sdr[0].ToString() + "</span><br /><a href=\"polls.aspx\">" + Resources.admin_language.default_poll_rate + "</a>";
                    HL2.Text = "<span class=\"sayi\">" + sdr[1].ToString() + " </span><br /><a href=\"article-comments.aspx\">" + Resources.admin_language.default_comment + "</a>";
                    HL3.Text = "<span class=\"sayi\">" + sdr[2].ToString() + " </span><br /><a href=\"members.aspx\">" + Resources.admin_language.default_members + "</a>";
                    HL4.Text = "<span class=\"sayi\">" + sdr[3].ToString() + " </span><br /><a href=\"guestbook.aspx\">" + Resources.admin_language.default_guestbok + "</a>";
                    GglUser = sdr[4].ToString();
                    GglPsw = sdr[5].ToString();
                    GglProfId = sdr[6].ToString();
                }
            }
            vt.Kapat();

            //google verileri çekilyor
            //if (!string.IsNullOrEmpty(GglUser) && !string.IsNullOrEmpty(GglPsw) && !string.IsNullOrEmpty(GglProfId))
            //{
            //    try
            //    {
            //        service.setUserCredentials(GglUser, GglPsw);
            //        GVHits.DataSource = SayfaHitleri(GglProfId);
            //        GVHits.DataBind();
            //        GeoChart(GglProfId);
            //    }
            //    catch (Exception exc) { }
            //}
        }
    }
Esempio n. 14
0
    public static string[] GetCompletionList(string prefixText, int count, string contextKey)
    {
        Snlg_DBConnect vt = new Snlg_DBConnect(true);
        string[] sonuclar = new string[10];
        int i = 0;

        using (SqlDataReader Sdr = vt.DBReaderOlustur("SELECT TOP(10) UserName FROM snlg_V1.TblUyeApp WHERE UyeId <> " + Snlg_ConfigValues.AdminId + " AND (UserName LIKE '%" + prefixText.Replace("'", "").Replace("%", "") + "%')", System.Data.CommandType.Text))
        {
            while (Sdr.Read())
            {
                sonuclar[i] = Sdr[0].ToString();
                i++;
            }

            while (i < 10)
            {
                sonuclar[i] = "";
                i++;
            }
        }
        vt.Kapat();
        return sonuclar;
    }
Esempio n. 15
0
    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);
        }

    }
Esempio n. 16
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(DTMakKtgler.Select("UstId IS NULL"), "", null, DDLKtg);

        }
        else
            GridSayfala(GVIcerikler, "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_MakaleSil", CommandType.StoredProcedure, new Snlg_DBParameter[1] { new Snlg_DBParameter("@MakId", SqlDbType.VarChar, Request.Form["HdnSil"])}))
                    {
                    }
                    Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz makaleler silindi.", false);
                    
                    GVIcerikler.DataBind();
                }
                catch (Exception exc)
                {
                    Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                    Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
                }
                vt.Kapat();
            }
        }
    }
Esempio n. 17
0
    protected void FVSyf_DataBound(object sender, EventArgs e)
    {
        DropDownList DDLLinks = (DropDownList)FVSyf.FindControl("DDLLinks");
        DropDownList DDLUst = (DropDownList)FVSyf.FindControl("DDLUst");
        try
        {
            DDLUst.Items.Clear();
            DDLUst.Items.Add(new ListItem("Ana Kategori Olsun", ""));
            DDLDoldur(DTMenuler.Select("UstId IS NULL", "Sira"), null, DDLUst);
        }
        catch { }
        DataRow satir = DTMenuler.Rows.Find(editedMenuID);
        try
        {
            if (satir == null || string.IsNullOrEmpty(satir["UstId"].ToString()))
                DDLUst.Items.FindByValue("").Selected = true;
            else
                DDLUst.Items.FindByValue(satir["UstId"].ToString()).Selected = true;
        }
        catch { }

        Snlg_DBConnect vt = new Snlg_DBConnect(true);
        Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[1];
        DBPrms[0] = new Snlg_DBParameter("@Dil", SqlDbType.SmallInt, dil);

        try
        {
            DDLLinks.DataSource = vt.DBReaderOlustur("snlg_V1.msp_LinkListele", CommandType.StoredProcedure, DBPrms);
            DDLLinks.DataBind();
        }
        catch { }
        vt.Kapat();

    }
Esempio n. 18
0
    public void GeleriEmbed(StringBuilder SBicerik, Snlg_DBConnect vt, Snlg_InterfaceBaseClass pg)
    {
        byte x = 0;

        while (SBicerik.ToString().Contains("image_gallery") && x < 20)
        {
            x++;//metinde image_gallery kelimesi geçiyorsa sonsuz döngüye girmemesi için en fazla 30 kez dönülüyor
            int galleryPosition = SBicerik.ToString().IndexOf("image_gallery");
            int tagPositionStart = SBicerik.ToString().LastIndexOf("<img", galleryPosition);
            int tagPositionEnd = SBicerik.ToString().IndexOf("/>", tagPositionStart) + 2;
            string tag = SBicerik.ToString().Substring(tagPositionStart, tagPositionEnd - tagPositionStart);
            StringBuilder SBGaleriHtmlKodlari = new StringBuilder();

            XmlDocument xDoc = new XmlDocument();
            xDoc.LoadXml(tag);
            XmlNode node = xDoc.SelectSingleNode("/img");
            string StyleWH = "";
            if (node.Attributes["width"] != null)
                StyleWH += " style=\"width:" + node.Attributes["width"].Value + "px;";
            else
                StyleWH += " style=\"width:100%;";
            if (node.Attributes["height"] != null)
                StyleWH += "height:" + node.Attributes["height"].Value + "px;\"";
            else
                StyleWH += "\"";

            Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[2];
            DBPrms[0] = new Snlg_DBParameter("@GId", SqlDbType.Int, node.Attributes["gallery_id"].Value);
            DBPrms[1] = new Snlg_DBParameter("@Dil", SqlDbType.SmallInt, Snlg_ConfigValues.s_ZDilId);

            #region ZoomGallery resim galerisi için kodlar
            if (node.Attributes["gallery_type"].Value == "zoom_gallery")
            {
                //bu galeri için gerekli scriptler ve css ler import edilyoir
                pg.ScriptOrCssFileImportHead("/scripts/JQuery_Zoom_Wizard/js/5c8a156.js");
                pg.ScriptOrCssFileImportHead("/scripts/JQuery_Zoom_Wizard/css/c3732c4.css");
                pg.SBJsKodlari.Append("$(document).ready(function () {$('.jquery_zoom1_thumbs img').click(function (event) { $('.jquery_zoom1 img.zoomwizard').attr('src', $(this).attr('src').replace('k_glr_', 'glr_')); });});");

                //galeirnin oluşması için gerekkli html kodları oluşturuluyor.
                SBGaleriHtmlKodlari.Append("<div " + StyleWH + " class=\"row\">");

                //resimler çekilyor
                DataTable DTResimler = vt.DataTableOlustur("snlg_V1.zsp_GaleridekiResimler", CommandType.StoredProcedure, DBPrms);


                SBGaleriHtmlKodlari.Append("<div class=\"jquery_zoom1_thumbs col-md-3\">");

                //thumb'lar listeleniyor
                foreach (DataRow dr in DTResimler.Rows)
                    SBGaleriHtmlKodlari.AppendFormat("<img src=\"{0}\" class=\"img-responsive\"/>", dr["Resim"].ToString());

                SBGaleriHtmlKodlari.Append("</div>");


                SBGaleriHtmlKodlari.Append("<div class=\"jquery_zoom1 col-md-9\"><div class=\"img-wrap img-responsive\">");



                //default resim ayarlanıyor
                if (DTResimler.Rows.Count > 0)
                    SBGaleriHtmlKodlari.AppendFormat("<img src=\"{0}\" class=\"zoomwizard\" />", DTResimler.Rows[0]["Resim"].ToString());


                SBGaleriHtmlKodlari.Append("</div></div></div>");

            }





            #endregion

            #region LightBox tarzı resim galerisi için kodlar
            if (node.Attributes["gallery_type"].Value == "lightbox")
            {
                //bu galeri için gerekli scriptler ve css ler import edilyor
                pg.ScriptOrCssFileImportHead("/scripts/bootstrap-lightbox/js/bootstrap-lightbox.js");
                pg.ScriptOrCssFileImportHead("/scripts/bootstrap-lightbox/css/bootstrap-lightbox.css");

                //galeirnin oluşması için gerekli html kodları oluşturuluyor.
                SBGaleriHtmlKodlari.Append("<div " + StyleWH + ">");
                SBGaleriHtmlKodlari.Append("<div class=\"LBGallery\"><div class=\"row\">");

                using (SqlDataReader sdr = vt.DBReaderOlustur("snlg_V1.zsp_GaleridekiResimler", CommandType.StoredProcedure, DBPrms))
                {//galerideki resimler alınıyor
                    while (sdr.Read())
                        SBGaleriHtmlKodlari.AppendFormat("<div class=\"gallery-img-wrapper col-sm-4 mb-lg\"><div class=\"gallery-img-title\">{2}</div><div class=\"gallery-img-image\"><a rel=\"{0}\" href=\"{1}\" data-title=\"{2}\"  data-footer=\"{3}\"  data-toggle=\"lightbox\" data-gallery=\"multiimages\"><img src=\"{1}\" title=\"{2}\" alt=\"{3}\" class=\"img-responsive\"/></a></div></div>", node.Attributes["gallery_id"].Value, sdr["Resim"].ToString(), sdr["Baslik"].ToString().Replace("\"", ""), sdr["Bilgi"].ToString().Replace("\"", ""));
                }
                SBGaleriHtmlKodlari.Append("</div></div></div>");
            }
            #endregion

            #region bootstrap carousel
            if (node.Attributes["gallery_type"].Value == "bootstrap-carousel")
            {
                DataTable DT = vt.DataTableOlustur("snlg_V1.zsp_GaleridekiResimler", CommandType.StoredProcedure, DBPrms);

                //galeirnin oluşması için gerekkli html kodları oluşturuluyor.
                SBGaleriHtmlKodlari.AppendFormat(@"
                    <div id='myCarousel-{0}' class='carousel slide' data-ride='carousel'>
                        <ol class='carousel-indicators'>", node.Attributes["gallery_id"].Value);

                for (int i = 0; i < DT.Rows.Count; i++)
                    SBGaleriHtmlKodlari.AppendFormat(@"<li data-target='#myCarousel-{0}' data-slide-to='{1}' {2}></li>", node.Attributes["gallery_id"].Value, i.ToString(), (i == 0 ? "class='active'" : ""));


                SBGaleriHtmlKodlari.Append(@"
                    </ol>
                    <div class='carousel-inner' role='listbox'>");


                for (int i = 0; i < DT.Rows.Count; i++)
                {
                    SBGaleriHtmlKodlari.AppendFormat(@"
                        <div class='item {0}'>
                            <a {4}><img src='{1}' alt='{2}' ></a>
                            <div class='carousel-caption'>
                                <h3>{2}</h3>
                                <p>{3}</p>
                            </div>
                        </div>",
                            (i == 0 ? "active" : ""), DT.Rows[i]["Resim"].ToString(), HttpContext.Current.Server.HtmlEncode(DT.Rows[i]["Baslik"].ToString()), HttpContext.Current.Server.HtmlEncode(DT.Rows[i]["Bilgi"].ToString()), (string.IsNullOrEmpty(DT.Rows[i]["LinkUrl"].ToString()) ? "" : "href='" + DT.Rows[i]["LinkUrl"].ToString() + "'"));
                }


                SBGaleriHtmlKodlari.AppendFormat(@"
                    </div>
                    <a class='left carousel-control' href='#myCarousel-{0}' role='button' data-slide='prev'>
                        <span class='glyphicon glyphicon-chevron-left' aria-hidden='true'></span>
                        <span class='sr-only'>Previous</span>
                    </a>
                    <a class='right carousel-control' href='#myCarousel-{0}' role='button' data-slide='next'>
                        <span class='glyphicon glyphicon-chevron-right' aria-hidden='true'></span>
                        <span class='sr-only'>Next</span>
                    </a>
                </div>
                ", node.Attributes["gallery_id"].Value);



            }
            #endregion

            SBicerik.Replace(tag, SBGaleriHtmlKodlari.ToString());
        }
    }
Esempio n. 19
0
    protected void FVDetay_DataBound(object sender, EventArgs e)
    {
        if (FVDetay.CurrentMode == FormViewMode.ReadOnly)
            return;
        
        ListBox lb = (ListBox)FVDetay.FindControl("ListKtg");
        lb.Items.Clear();
        ListDoldur(DTKtgler.Select("UstId IS NULL"), null, lb);

        if (FVDetay.CurrentMode == FormViewMode.Edit)
        {
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            SqlDataReader SDRKtgler = vt.DBReaderOlustur("SELECT UrunId, KtgId FROM snlg_V1.TblUrun_Kategori WHERE UrunId = " + Request.QueryString["uid"], CommandType.Text);
            while (SDRKtgler.Read())
                try { lb.Items.FindByValue(SDRKtgler["KtgId"].ToString()).Selected = true; }
                catch { }

            SDRKtgler.Close();

            
            Repeater rpResmler=(Repeater)FVDetay.FindControl("rpResimler");
            DataTable dt = vt.DataTableOlustur("SELECT * FROM snlg_V1.TblUrunResim  WHERE UrunId=" + Request.QueryString["uid"], CommandType.Text);
            rpResmler.DataSource = dt;
            rpResmler.DataBind();
            
            vt.Kapat();
        }
    }
Esempio n. 20
0
    private void UrlRewrite(object sender)
    {
        #region url Rewrite
        if (File.Exists(HttpContext.Current.Server.MapPath(HttpContext.Current.Request.Url.AbsolutePath)))
            return;
        if (Directory.Exists(HttpContext.Current.Server.MapPath(HttpContext.Current.Request.Url.AbsolutePath)))
            return;
        if (HttpContext.Current.Request.Url.AbsolutePath.ToLower().Equals("/"))
            return;
        if (HttpContext.Current.Request.RawUrl == "/")
            HttpContext.Current.Response.RedirectPermanent("/" + Snlg_ConfigValues.defaultLang + "/" + Snlg_ConfigValues.startPage);

        string[] urlDizi = HttpContext.Current.Request.RawUrl.Split('/');
        CultureInfo cu = new CultureInfo("tr");
        try { cu = new CultureInfo(urlDizi[1]); }
        catch { return; }

        if (Directory.Exists(HttpContext.Current.Server.MapPath(urlDizi[1])))
            return;

        {
            HttpApplication app = (HttpApplication)sender;

            Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[1];

            try { DBPrms[0] = new Snlg_DBParameter("@Url", SqlDbType.VarChar, Path.GetFileNameWithoutExtension(HttpContext.Current.Request.RawUrl.Substring(0, HttpContext.Current.Request.RawUrl.IndexOf('?')))); }
            catch
            {//eğer querystring yoksa hata fırlatacak o yüzden direk dosya adı alınıyor
                DBPrms[0] = new Snlg_DBParameter("@Url", SqlDbType.VarChar, Path.GetFileNameWithoutExtension(HttpContext.Current.Request.RawUrl));
            }
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            string sp = "snlg_V1.zsp_QueryStringPages";
            if (urlDizi.Length == 4)
            {
                DataRow[] drs = Snlg_ConfigValues.DTurlKeyList.Select("Dil = " + cu.LCID.ToString() + " AND UrlKeyValue='" + urlDizi[2] + "'");
                sp = "snlg_V1.zsp_QueryString" + drs[0]["UrlKeyName"].ToString().Replace("-", "_");
            }
            if (urlDizi.Length == 5)
            {
                //blog url tagı
                DataRow[] drs = Snlg_ConfigValues.DTurlKeyList.Select("Dil = " + cu.LCID.ToString() + " AND UrlKeyValue='" + urlDizi[2] + "'");
                sp = "snlg_V1.zsp_QueryString" + drs[0]["UrlKeyName"].ToString().Replace("-", "_");
                //blog tagı için url tagı
                drs = Snlg_ConfigValues.DTurlKeyList.Select("Dil = " + cu.LCID.ToString() + " AND UrlKeyValue='" + urlDizi[3] + "'");
                sp += drs[0]["UrlKeyName"].ToString().Replace("-", "_");
            }

            using (SqlDataReader SDR = vt.DBReaderOlustur(sp, CommandType.StoredProcedure, DBPrms))
            {
                if (SDR.Read())
                {
                    if (Snlg_ConfigValues.urlExtension != Path.GetExtension(HttpContext.Current.Request.RawUrl))
                    {
                        vt.Kapat();
                        throw new HttpException(404, "Not Found");
                    }

                    HttpContext.Current.RewritePath("~/SnlgPages.aspx?" + SDR[0].ToString());
                    vt.Kapat();
                    return;
                }
                else
                {
                    vt.Kapat();
                    throw new HttpException(404, "Not Found");
                }
            }
        }
        #endregion
    }
Esempio n. 21
0
    protected void FVIcerik_DataBound(object sender, EventArgs e)
    {
        if (FVIcerik.CurrentMode == FormViewMode.ReadOnly)
            return;
        
        ListBox lb = (ListBox)FVIcerik.FindControl("ListKtg");
        lb.Items.Clear();
        ListDoldur(DTMakKtgler.Select("UstId IS NULL"), null, lb);

        if (FVIcerik.CurrentMode == FormViewMode.Insert)
            ((TextBox)FVIcerik.FindControl("TbTarih")).Text = DateTime.Today.ToShortDateString();
        else if (FVIcerik.CurrentMode == FormViewMode.Edit)
        {
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            SqlDataReader SDRKtgler = vt.DBReaderOlustur("SELECT MakId, KtgId FROM snlg_V1.TblMakale_Kategori WHERE MakId = " + Request.QueryString["makid"], CommandType.Text);
            while (SDRKtgler.Read())
                try { lb.Items.FindByValue(SDRKtgler["KtgId"].ToString()).Selected = true; }
                catch { }

            SDRKtgler.Close();
            vt.Kapat();
        }
    }
Esempio n. 22
0
    protected void FVIcerik_DataBound(object sender, EventArgs e)
    {
        if (FVIcerik.CurrentMode == FormViewMode.ReadOnly)
            return;

        ListBox lb = (ListBox)FVIcerik.FindControl("ListKtg");
        lb.Items.Clear();
        ListDoldur(DTMakKtgler.Select("UstId IS NULL"), null, lb);

        if (FVIcerik.CurrentMode == FormViewMode.Edit)
        {
            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            SqlDataReader SDRKtgler = vt.DBReaderOlustur("SELECT ProjeId, KtgId FROM snlg_V1.TblProje_Kategori WHERE ProjeId = " + Request.QueryString["projeid"], CommandType.Text);
            while (SDRKtgler.Read())
                try { lb.Items.FindByValue(SDRKtgler["KtgId"].ToString()).Selected = true; }
                catch { }

            SDRKtgler.Close();
            vt.Kapat();

            DropDownList DDLLinks = (DropDownList)FVIcerik.FindControl("DDLLinks");
            foreach (ListItem item in DDLLinks.Items)
                item.Text += Snlg_ConfigValues.urlExtension;
        }
    }
Esempio n. 23
0
    protected void BtnLogin_Click(object sender, EventArgs e)
    {

        Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[3];

        DBPrms[0] = new Snlg_DBParameter("@Sifre", SqlDbType.VarChar, Snlg_ConfigValues.MD5Olustur(TBSifre.Text), 75);
        DBPrms[1] = new Snlg_DBParameter("@AdminId", SqlDbType.Int, WebConfigurationManager.AppSettings["AdminId"]);
        DBPrms[2] = new Snlg_DBParameter("@UserName", SqlDbType.NVarChar, TBUser.Text, 25);

        Snlg_DBConnect vt = new Snlg_DBConnect(true);
        try
        {
            //if (Request.Url.Host.Contains("demo.sanalog."))
            //    dbReset(vt);

            SqlDataReader sdr = vt.DBReaderOlustur("snlg_V1.msp_AdminLogin", CommandType.StoredProcedure, DBPrms);
            if (sdr.Read())
            {
                //Snlg_MemberInfo.s_UserId = sdr["UyeId"].ToString();
                Snlg_MemberInfo.s_UserId = sdr["UyeId"].ToString();
                //Snlg_MemberInfo.c_LoginGuid = sdr["LoginGuid"].ToString();
                Snlg_MemberInfo.s_UserUrl = sdr["SeoUrl"].ToString();

                if (!string.IsNullOrEmpty(sdr[1].ToString().Trim()))
                {
                    //Snlg_MemberInfo.s_YetkiSayfalar = sdr[1].ToString().Trim() + ",";
                    Snlg_MemberInfo.s_YetkiSayfalar = sdr[1].ToString().Trim() + ",";
                }

                Snlg_MemberInfo.s_UserName = TBUser.Text;
            }
            else
            {

                //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;

            }


            sdr.Close();
        }
        catch (Exception exc)
        {
            //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;

            if (exc.Message.Contains("$#sqlhata1#$"))
                Snlg_Hata.ziyaretci.HataGosterHatali(Resources.admin_language.login_user_psw_wrong, false, "#divLogin");
            else
            {
                Snlg_Hata.ziyaretci.ExceptionLogla(exc);
                Snlg_Hata.ziyaretci.HataGosterHatali(Resources.admin_language.eror_unexcepted, false, "#divLogin");
            }
        }
        vt.Kapat();

        if (!string.IsNullOrEmpty((Snlg_MemberInfo.s_UserId)))
        {//login olduysa
            if (string.IsNullOrEmpty(Request.QueryString["url"]))
                Response.Redirect("default.aspx");
            else
                Response.Redirect(Server.UrlDecode(Request.QueryString["url"]));
        }
    }