Beispiel #1
0
        public ActionResult Slide_Delete(int slide_id)
        {
            tbl_slider _deleteslide = (from p in db.tbl_slider where p.Slider_image_ID == slide_id select p).SingleOrDefault();
            int        proid        = _deleteslide.Slider_image_ID;

            db.tbl_slider.Remove(_deleteslide);
            db.SaveChanges();
            return(RedirectToAction("Slider", "Admin"));
        }
Beispiel #2
0
        //public static bool saveSlide(tbl_slider _Slider)
        //{
        //    bool _result = true;
        //    using (seckinkirtasiyeEntities db = new seckinkirtasiyeEntities())
        //    {
        //        try
        //        {
        //            if (_Slider.Slider_image_ID == 0)
        //            {
        //                db.tbl_slider.Add(_Slider);
        //            }
        //            else
        //            {
        //                db.tbl_slider.Attach(_Slider);
        //                db.Entry(_Slider).State = System.Data.Entity.EntityState.Modified;
        //            }
        //            db.SaveChanges();
        //        }
        //        catch (Exception)
        //        {
        //            _result = false;

        //        }
        //    }

        //    return _result;

        //}



        public static bool saveSlide(tbl_slider _Slider)
        {
            bool _result = true;

            using (seckinkirtasiyeEntities db = new seckinkirtasiyeEntities())
            {
                try
                {
                    if (_Slider.Slider_image_ID == 0)
                    {
                        db.tbl_slider.Add(_Slider);
                    }
                    else
                    {
                        db.tbl_slider.Attach(_Slider);
                        db.Entry(_Slider).State = System.Data.Entity.EntityState.Modified;
                    }
                    db.SaveChanges();
                }
                catch (Exception)
                {
                    _result = false;
                }
            }

            return(_result);
        }
Beispiel #3
0
        public static bool saveBrand(tbl_Marka _Brands)
        {
            bool _result = true;

            using (seckinkirtasiyeEntities db = new seckinkirtasiyeEntities())
            {
                try
                {
                    if (_Brands.Marka_ID == 0)
                    {
                        db.tbl_Marka.Add(_Brands);
                    }
                    else
                    {
                        db.tbl_Marka.Attach(_Brands);
                        db.Entry(_Brands).State = System.Data.Entity.EntityState.Modified;
                    }
                    db.SaveChanges();
                }
                catch (Exception)
                {
                    _result = false;
                }
            }
            return(_result);
        }
Beispiel #4
0
        public static bool saveAboutus(tbl_AboutUs _About)
        {
            bool _result = true;

            using (seckinkirtasiyeEntities db = new seckinkirtasiyeEntities())
            {
                try
                {
                    if (_About.Aboutus_ID == 0)
                    {
                        db.tbl_AboutUs.Add(_About);
                    }
                    else
                    {
                        db.tbl_AboutUs.Attach(_About);
                        db.Entry(_About).State = System.Data.Entity.EntityState.Modified;
                    }
                    db.SaveChanges();
                }
                catch (Exception)
                {
                    _result = false;
                }
            }
            return(_result);
        }