// GET: Admin/HomeSocial/Delete
        public ActionResult Delete(int id)
        {
            HomeSocial homeSocial = db.HomeSocials.Find(id);

            if (homeSocial == null)
            {
                return(HttpNotFound());
            }
            db.HomeSocials.Remove(homeSocial);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
        // GET: Admin/HomeSocial/Update

        public ActionResult Update(int id)
        {
            HomeSocial homeSocial = db.HomeSocials.Find(id);

            if (homeSocial == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Home       = db.HomeSettings.ToList();
            ViewBag.SocialType = db.SocialTypes.ToList();

            return(View(homeSocial));
        }
        public ActionResult Update(HomeSocial homeSocial)
        {
            if (ModelState.IsValid)
            {
                db.Entry(homeSocial).State = EntityState.Modified;

                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.Home       = db.HomeSettings.ToList();
            ViewBag.SocialType = db.SocialTypes.ToList();

            return(View(homeSocial));
        }
        public ActionResult Create(HomeSocial homeSocial)
        {
            if (ModelState.IsValid)
            {
                db.HomeSocials.Add(homeSocial);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            ViewBag.Home       = db.HomeSettings.ToList();
            ViewBag.SocialType = db.SocialTypes.ToList();

            return(View(homeSocial));
        }
Пример #5
0
        public ResponseModel GetHomeOperations()
        {
            var        homeData = (Home)aHomeSocialManager.GetHomeOperations().Data;
            HomeSocial _data    = new HomeSocial()
            {
                Title         = homeData.Title,
                SubTitle      = homeData.SubTitle,
                HomeImageLink = homeData.HomeImageLink
            };
            List <Social> socialData = (List <Social>)aHomeSocialManager.GetSocalLink().Data;

            _data.SocialList = new List <Social>();
            // _data.SocialList.Add(socialData);
            foreach (Social aSocial in (IEnumerable)socialData)
            {
                _data.SocialList.Add((Social)aSocial);
            }
            return(_aModel.Respons(_data));
        }