Exemplo n.º 1
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");
    }
    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();
            }
        }
    }
Exemplo n.º 3
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();
        }
    }
Exemplo n.º 4
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);
    }
    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();
        }
    }
Exemplo n.º 6
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.TblZiyaretciDefteri WHERE UstYId IN (" + Request.Form["HdnSil"] + ")", System.Data.CommandType.Text);
                    vt.SorguCalistir("DELETE FROM snlg_V1.TblZiyaretciDefteri WHERE 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();
            }
        }
    }
Exemplo n.º 7
0
    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)
        {
        }
    }
Exemplo n.º 8
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();
     }
 }
Exemplo n.º 9
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");
        }
    }
Exemplo n.º 10
0
    protected void txtFiyat_TextChanged(object sender, EventArgs e)
    {
        if (!YetkiKontrol(pageName + "-Insert"))
        {
            return;
        }
        try
        {
            TextBox     txtFiyat = (TextBox)sender;
            GridViewRow gvRow    = (GridViewRow)(sender as Control).Parent.Parent;
            int         index    = gvRow.RowIndex;
            string      id       = GVUrun.DataKeys[index].Value.ToString();

            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            vt.Ac();
            int silinen = vt.SorguCalistir("UPDATE snlg_V1.TblUrunApp SET Fiyat = @fiyat WHERE UrunId = @id ",
                                           System.Data.CommandType.Text, new Snlg_DBParameter[2] {
                new Snlg_DBParameter("@fiyat", SqlDbType.Decimal, txtFiyat.Text), new Snlg_DBParameter("@id", SqlDbType.SmallInt, id)
            });
            vt.Kapat();
        }
        catch (Exception)
        {
        }
    }
Exemplo n.º 11
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);
        }
    }
Exemplo n.º 12
0
    protected void LKtgSil_Click(object sender, EventArgs e)
    {//ktg siliniyor
        if (!YetkiKontrol(pageName + "-Delete"))
        {
            return;
        }

        if (string.IsNullOrEmpty(Request.Form["CBSec"]))
        {
            Snlg_Hata.ziyaretci.HataGosterUyari("Herhangi bir seçim yapmadınız.", false);
            return;
        }

        DTMenuler = null;//verilerin son haliyle çekilmesi için önce boşaltılıyor

        Snlg_DBConnect vt = new Snlg_DBConnect(true);

        try
        {
            foreach (string id in Request.Form["CBSec"].Split(",".ToCharArray()))
            {
                vt.SorguCalistir("snlg_V1.msp_MenuKategoriSil", CommandType.StoredProcedure, new Snlg_DBParameter[2] {
                    new Snlg_DBParameter("@MenuId", SqlDbType.Int, id), new Snlg_DBParameter("@Dil", SqlDbType.Int, dil)
                });
            }
            Snlg_Hata.ziyaretci.HataGosterBasarili("Menü kaldırıldı.", true);
        }
        catch (Exception exc)
        {
            Snlg_Hata.ziyaretci.HataGosterHatali("Menü altında başka Menü bulunduğu için silinemiyor.", true);
        }
        vt.Kapat();
        Response.Redirect(Request.Url.AbsolutePath + "?gid=" + UCId);
    }
Exemplo n.º 13
0
    protected void TxtUrlKeysDegeri_TextChanged(object sender, EventArgs e)
    {
        if (!YetkiKontrol(pageName + "-Update"))
        {
            Snlg_Hata.ziyaretci.HataGosterHatali("Bu işlemi yapmak için yetkili değilsiniz.", false);
            return;
        }
        try
        {
            TextBox t = (TextBox)sender;
            t.Text = trReplace(t.Text);
            GridViewRow satir = (GridViewRow)t.NamingContainer;

            if (satir.RowType == DataControlRowType.DataRow)
            {
                GVUrlKeys.UpdateRow(satir.RowIndex, true);
            }

            Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler güncellendi.", false);
        }
        catch (Exception exc)
        {
            Snlg_Hata.ziyaretci.ExceptionLogla(exc);
            Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
        }

        Snlg_DBConnect vt = new Snlg_DBConnect(true);

        Snlg_ConfigValues.DTurlKeyList = vt.DataTableOlustur("SELECT UrlKeyValue,UrlKeyName, Dil FROM snlg_V1.TblUrlKeys ", CommandType.Text);
        vt.Kapat();
    }
Exemplo n.º 14
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");
        }
    }
Exemplo n.º 15
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();
        }
    }
Exemplo n.º 16
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");
        }
    }
Exemplo n.º 17
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 { }
        }
    }
Exemplo n.º 18
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");
    }
Exemplo n.º 19
0
    protected void BtnSaveImage_Click(object sender, EventArgs e)
    {
        if (!YetkiKontrol(pageName + "-Insert"))
        {
            return;
        }
        try
        {
            Snlg_DBParameter[] DBPrms = new Snlg_DBParameter[5];
            DBPrms[0] = new Snlg_DBParameter("@Bilgi", SqlDbType.NVarChar, "");
            DBPrms[1] = new Snlg_DBParameter("@GId", SqlDbType.Int, Request.QueryString["gid"]);
            DBPrms[2] = new Snlg_DBParameter("@Baslik", SqlDbType.NVarChar, "");
            DBPrms[3] = new Snlg_DBParameter("@Resim", SqlDbType.VarChar, HdnImg.Value);
            DBPrms[4] = new Snlg_DBParameter("@LinkUrl", SqlDbType.VarChar, "");

            Snlg_DBConnect vt = new Snlg_DBConnect(true);
            vt.SorguCalistir("snlg_V1.msp_GaleriResimEkle", CommandType.StoredProcedure, DBPrms);
            vt.Kapat();
            Response.Redirect(Request.Url.AbsoluteUri);
        }
        catch (Exception exc)
        {
            Snlg_Hata.ziyaretci.ExceptionLogla(exc);
        }
    }
Exemplo n.º 20
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;
            }
        }
    }
Exemplo n.º 21
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();
    }
Exemplo n.º 22
0
    public static void ApplicationStartMetod()
    {
        Snlg_DBConnect vt = new Snlg_DBConnect(true);

        Snlg_ConfigValues.DTurlKeyList       = vt.DataTableOlustur("SELECT UrlKeyValue,UrlKeyName, Dil FROM snlg_V1.TblUrlKeys ", CommandType.Text);
        Snlg_ConfigValues.urlExtension       = vt.ScalarSorguCalistir("SELECT Deger FROM snlg_V1.TblDegiskenler WHERE Degisken = 'urlExtension'", CommandType.Text).ToString();
        Snlg_ConfigValues.startPage          = vt.ScalarSorguCalistir("SELECT Deger FROM snlg_V1.TblDegiskenler WHERE Degisken = 'AcilisSayfasi'", CommandType.Text).ToString();
        Snlg_ConfigValues.defaultLangId      = vt.ScalarSorguCalistir("SELECT Deger FROM snlg_V1.TblDegiskenler WHERE Degisken = 'DefaultLang'", CommandType.Text).ToString();
        Snlg_ConfigValues.adminDefaultLangId = Convert.ToInt32(vt.ScalarSorguCalistir("SELECT Deger FROM snlg_V1.TblDegiskenler WHERE Degisken = 'adminDefaultLangID'", CommandType.Text).ToString());
        vt.Kapat();
    }
Exemplo n.º 23
0
    protected void LnkKaldir_Click(object sender, EventArgs e)
    {
        if (!YetkiKontrol(pageName + "-Delete"))
        {
            return;
        }
        Snlg_DBConnect vt = new Snlg_DBConnect(true);

        vt.SorguCalistir("DELETE FROM snlg_V1.TblDesignSablonIcerik WHERE (UCId = " + Request.QueryString["ucid"] + ")", CommandType.Text);
        vt.Kapat();
    }
 protected void BtnRSil_Click(object sender, EventArgs e)
 {
     if (YetkiKontrol(pageName + "-Delete"))
     {
         Snlg_DBConnect vt = new Snlg_DBConnect(true);
         vt.SorguCalistir("UPDATE snlg_v1.TblMakaleKtgApp SET Resim = NULL WHERE KtgID = " + editetKtgID, CommandType.Text);
         vt.Kapat();
         FVSyf.DataBind();
         Snlg_Hata.ziyaretci.HataGosterBasarili("Resim silindi.", false);
     }
 }
    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);
        }
    }
    protected void LinkRSil_Command(object sender, CommandEventArgs e)
    {//resim silniyor.
        if (!YetkiKontrol(pageName + "-Delete"))
        {
            return;
        }
        Snlg_DBConnect vt      = new Snlg_DBConnect(true);
        int            silinen = vt.SorguCalistir("UPDATE snlg_V1.TblVarsayilanResimler SET ResimYol = NULL WHERE AnahtarId = @AnahtarId ", CommandType.Text, new Snlg_DBParameter[] { new Snlg_DBParameter("@AnahtarId", SqlDbType.Int, e.CommandArgument.ToString()) });

        vt.Kapat();
        Snlg_Hata.ziyaretci.HataGosterBasarili("Resim silindi.", false);
        GV.DataBind();
    }
Exemplo n.º 27
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();
    }
    protected void BtnRSil_Click(object sender, EventArgs e)
    {
        if (!YetkiKontrol(pageName + "-Delete"))
        {
            return;
        }

        Snlg_DBConnect vt = new Snlg_DBConnect(true);

        vt.SorguCalistir("UPDATE snlg_v1.TblResimGaleriResimlerApp SET Resim = NULL WHERE RId = " + Request.QueryString["rid"], CommandType.Text);
        vt.Kapat();
        FVResim.DataBind();
        Snlg_Hata.ziyaretci.HataGosterBasarili("Resim silindi.", false);
    }
Exemplo n.º 29
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();
    }
Exemplo n.º 30
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();
            }
        }
    }