Beispiel #1
0
        public enCarouselResim BirAlttakiResmiGetir(enCarouselResim gResim)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(@"SELECT TOP 1 * FROM CarouselResimleri 
                        WHERE carRes_car_id = @id AND carRes_sira > @sira ORDER BY carRes_sira ");

            MySqlDataAdapter adp = new MySqlDataAdapter(sb.ToString(), FxMySqlHelper.Connection());

            adp.SelectCommand.Parameters.AddWithValue("@id", gResim.CarouselId);

            adp.SelectCommand.Parameters.AddWithValue("@sira", gResim.Sira);

            DataTable dt = new DataTable();

            adp.Fill(dt);

            enCarouselResim resim = new enCarouselResim();

            if (dt.Rows.Count > 0)
            {
                DataRow rw = dt.Rows[0];

                resim.Buyuk       = rw["carRes_buyuk"].ToString();
                resim.CarouselId  = rw["carRes_car_id"].xToIntDefault();
                resim.Id          = rw["carRes_id"].xToIntDefault();
                resim.KayitTarihi = rw["carRes_kayitTar"].xToDateTimeDefault();
                resim.Kucuk       = rw["carRes_kucuk"].ToString();
                resim.Orta        = rw["carRes_orta"].ToString();
                resim.Sira        = rw["carRes_sira"].xToIntDefault();
                resim.Statu       = rw["carRes_statu"].xToBooleanDefault();
            }

            return(resim);
        }
Beispiel #2
0
        public void ResimStatuGuncelle(enCarouselResim resim)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();

            dict.Add("carRes_statu", resim.Statu);

            FxMySqlHelper.Update("CarouselResimleri", dict, "carRes_id", resim.Id);
        }
Beispiel #3
0
        public void NavUrlGuncelle(enCarouselResim resim)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();


            dict.Add("carRes_navUrl", resim.NavUrl);

            FxMySqlHelper.Update("CarouselResimleri", dict, "carRes_id", resim.Id);
        }
Beispiel #4
0
        public void FotoVideoLinkGuncelle(enCarouselResim resim)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();


            dict.Add("carRes_fotoLink", resim.FotoLink);
            dict.Add("carRes_videoLink", resim.VideoLink);

            FxMySqlHelper.Update("CarouselResimleri", dict, "carRes_id", resim.Id);
        }
Beispiel #5
0
        public List <enCarouselResim> ResimleriGetir(int sayfaId, int?kayitSayisi, bool?statu)
        {
            string topStr = kayitSayisi == null ? "" : " TOP " + kayitSayisi + " ";

            StringBuilder sb = new StringBuilder();

            MySqlDataAdapter adp = new MySqlDataAdapter(sb.ToString(), FxMySqlHelper.Connection());

            if (statu != null)
            {
                sb.Append("SELECT " + topStr + " * FROM CarouselResimleri WHERE carRes_car_id = @id AND carRes_statu = @statu ORDER BY carRes_sira ");

                adp.SelectCommand.Parameters.AddWithValue("@id", sayfaId);
                adp.SelectCommand.Parameters.AddWithValue("@statu", statu);
            }
            else
            {
                sb.Append("SELECT " + topStr + " * FROM CarouselResimleri WHERE carRes_car_id = @id ORDER BY carRes_sira ");

                adp.SelectCommand.Parameters.AddWithValue("@id", sayfaId);
            }

            adp.SelectCommand.CommandText = sb.ToString();

            DataTable dt = new DataTable();

            adp.Fill(dt);

            List <enCarouselResim> resimler = new List <enCarouselResim>();

            foreach (DataRow rw in dt.Rows)
            {
                enCarouselResim resim = new enCarouselResim();

                resim.Buyuk       = rw["carRes_buyuk"].ToString();
                resim.CarouselId  = rw["carRes_car_id"].xToIntDefault();
                resim.Id          = rw["carRes_id"].xToIntDefault();
                resim.KayitTarihi = rw["carRes_kayitTar"].xToDateTimeDefault();
                resim.Kucuk       = rw["carRes_kucuk"].ToString();
                resim.Orta        = rw["carRes_orta"].ToString();
                resim.Sira        = rw["carRes_sira"].xToIntDefault();
                resim.Statu       = rw["carRes_statu"].xToBooleanDefault();
                resim.Baslik      = rw["carRes_baslik"].ToString();
                resim.NavUrl      = rw["carRes_navUrl"].ToString();
                resim.FotoLink    = rw["carRes_fotoLink"].xToBooleanDefault();
                resim.VideoLink   = rw["carRes_videoLink"].xToBooleanDefault();

                resimler.Add(resim);
            }

            return(resimler);
        }
        protected void lnkStatuDegistir_Click(object sender, EventArgs e)
        {
            LinkButton lnk = sender as LinkButton;

            int resimId = lnk.CommandArgument.xToIntDefault();

            enCarouselResim resim = bllCarouselResimleri.ResimGetir(resimId);

            resim.Statu = !resim.Statu;

            bllCarouselResimleri.ResimStatuGuncelle(resim);

            CarouselResimleriniGetir();
        }
        protected void txtSiraNo_TextChanged(object sender, EventArgs e)
        {
            RadTextBox txt = sender as RadTextBox;

            int id = txt.Attributes["dzID"].xToIntDefault();

            enCarouselResim resim = bllCarouselResimleri.ResimGetir(id);

            resim.Sira = txt.Text.xToIntDefault();

            bllCarouselResimleri.ResimSiraGuncelle(resim);

            CarouselResimleriniGetir();
        }
        public static void ResimSil(int resimId)
        {
            try
            {
                enCarouselResim resim = ResimGetir(resimId);

                File.Delete(HttpContext.Current.Server.MapPath("~" + resim.Kucuk));
                File.Delete(HttpContext.Current.Server.MapPath("~" + resim.Orta));
                File.Delete(HttpContext.Current.Server.MapPath("~" + resim.Buyuk));
            }
            catch
            {
            }
            new dalCarouselResimleri().ResimSil(resimId);
        }
Beispiel #9
0
        public void YeniResimEkle(enCarouselResim resim)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();


            dict.Add("carRes_car_id", resim.CarouselId);
            dict.Add("carRes_kucuk", resim.Kucuk);
            dict.Add("carRes_orta", resim.Orta);
            dict.Add("carRes_buyuk", resim.Buyuk);
            dict.Add("carRes_sira", resim.Sira);
            dict.Add("carRes_statu", resim.Statu);
            dict.Add("carRes_kayitTar", resim.KayitTarihi);
            dict.Add("carRes_baslik", resim.Baslik);
            dict.Add("carRes_navUrl", resim.NavUrl);
            dict.Add("carRes_fotoLink", resim.FotoLink);
            dict.Add("carRes_videoLink", resim.VideoLink);

            FxMySqlHelper.Insert("CarouselResimleri", dict);
        }
        protected void lnkSil_Click(object sender, EventArgs e)
        {
            LinkButton lnk = sender as LinkButton;

            int resimId = lnk.CommandArgument.xToIntDefault();

            enCarouselResim resim = bllCarouselResimleri.ResimGetir(resimId);

            try
            {
                bllCarouselResimleri.ResimSil(resimId);

                CarouselResimleriniGetir();
            }
            catch
            {
                uscUyari1.UyariGoster("Resim silinirken hata oluştu ! Lütfen tekrar deneyiniz.", "Resim Silme", false);
            }
        }
        protected void chkFotoLink_OnCheckedChanged(object sender, EventArgs e)
        {
            CheckBox chk = sender as CheckBox;

            int id = chk.Attributes["ResId"].xToIntDefault();

            enCarouselResim resim = bllCarouselResimleri.ResimGetir(id);

            if (!resim.FotoLink)
            {
                resim.FotoLink  = true;
                resim.VideoLink = false;
            }
            else
            {
                resim.FotoLink = false;
            }
            bllCarouselResimleri.FotoVideoLinkGuncelle(resim);

            CarouselResimleriniGetir();
        }
        protected void btnURLKaydet_Click(object sender, EventArgs e)
        {
            RadButton btn = sender as RadButton;

            RadTextBox txt = btn.Parent.FindControl("txtURL") as RadTextBox;

            int id = btn.CommandArgument.xToIntDefault();

            enCarouselResim resim = bllCarouselResimleri.ResimGetir(id);

            resim.NavUrl = txt.Text;

            bllCarouselResimleri.NavUrlGuncelle(resim);

            LinkButton lnk = btn.Parent.FindControl("lnkUrl") as LinkButton;

            lnk.Text = txt.Text;

            (sender as RadButton).Parent.FindControl("tblUrlDuzenle").Visible = false;
            (sender as RadButton).Parent.FindControl("lnkUrl").Visible        = true;
        }
Beispiel #13
0
        public enCarouselResim ResimGetir(int resimId)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT * FROM CarouselResimleri WHERE carRes_id = @id ");

            MySqlDataAdapter adp = new MySqlDataAdapter(sb.ToString(), FxMySqlHelper.Connection());

            adp.SelectCommand.Parameters.AddWithValue("@id", resimId);

            DataTable dt = new DataTable();

            adp.Fill(dt);

            enCarouselResim resim = new enCarouselResim();

            if (dt.Rows.Count > 0)
            {
                DataRow rw = dt.Rows[0];

                resim.Buyuk       = rw["carRes_buyuk"].ToString();
                resim.CarouselId  = rw["carRes_car_id"].xToIntDefault();
                resim.Id          = rw["carRes_id"].xToIntDefault();
                resim.KayitTarihi = rw["carRes_kayitTar"].xToDateTimeDefault();
                resim.Kucuk       = rw["carRes_kucuk"].ToString();
                resim.Orta        = rw["carRes_orta"].ToString();
                resim.Sira        = rw["carRes_sira"].xToIntDefault();
                resim.Statu       = rw["carRes_statu"].xToBooleanDefault();
                resim.Baslik      = rw["carRes_baslik"].ToString();
                resim.NavUrl      = rw["carRes_navUrl"].ToString();
                resim.FotoLink    = rw["carRes_fotoLink"].xToBooleanDefault();
                resim.VideoLink   = rw["carRes_videoLink"].xToBooleanDefault();
            }

            return(resim);
        }
        protected void btnResimYukle_click(object sender, EventArgs e)
        {
            enCarousel Carousel = bllCarousel.Getir(Request.QueryString["id"].xToIntDefault());

            foreach (string resimUrl in VwResimler)
            {
                ResimKucult("~/yukleme/resim/CarouselResim/temp/", resimUrl, 1920, "~/yukleme/resim/CarouselResim/", true);

                enCarouselResim resim = new enCarouselResim();

                resim.CarouselId = Request.QueryString["id"].xToIntDefault();
                resim.Sira       = bllCarouselResimleri.SonSiraNoGetir(resim.CarouselId) + 1;
                resim.Statu      = false;
                resim.Kucuk      = "/yukleme/resim/CarouselResim/" + resimUrl;
                resim.Orta       = "/yukleme/resim/CarouselResim/" + resimUrl;
                resim.Buyuk      = "/yukleme/resim/CarouselResim/" + resimUrl;
                resim.NavUrl     = "#!";

                bllCarouselResimleri.YeniResimEkle(resim);
            }

            VwResimler.Clear();
            CarouselResimleriniGetir();
        }
 public static void FotoVideoLinkGuncelle(enCarouselResim resim)
 {
     new dalCarouselResimleri().FotoVideoLinkGuncelle(resim);
 }
 public static void NavUrlGuncelle(enCarouselResim resim)
 {
     new dalCarouselResimleri().NavUrlGuncelle(resim);
 }
 public static enCarouselResim BirAlttakiResmiGetir(enCarouselResim gResim)
 {
     return(new dalCarouselResimleri().BirAlttakiResmiGetir(gResim));
 }
 public static void ResimBaslikGuncelle(enCarouselResim resim)
 {
     new dalCarouselResimleri().ResimBaslikGuncelle(resim);
 }
 public static void YeniResimEkle(enCarouselResim resim)
 {
     new dalCarouselResimleri().YeniResimEkle(resim);
 }