Beispiel #1
0
        public ActionResult SocialMediaAdd(HttpPostedFileBase Image, SocialMediasTable stable)
        {
            string filePath = "";

            if (Image != null)
            {
                filePath = Path.GetFileName(Image.FileName);
                var uploadPath = Path.Combine(Server.MapPath("~/Content/Images/"), filePath);
                Image.SaveAs(uploadPath);
            }
            else
            {
                filePath = stable.Image;
            }

            _modelSocialMedia.UpdateSocialMedia(stable.Banner, stable.Explanation, stable.Facebook, stable.Instagram,
                                                stable.Twitter, stable.Youtube, stable.LinkedIn, stable.Github, filePath, stable.FacebookPage, stable.TwitterPage);

            return(RedirectToAction("Index", "AdmSocialMedia"));
        }
Beispiel #2
0
 public ModelSocialMedia()
 {
     _socialContext     = new MyWebContext();
     _socialMediasTable = new SocialMediasTable();
 }
Beispiel #3
0
 public AdmSocialMediaController()
 {
     _socialMediasTable = new SocialMediasTable();
     _socialContext     = new MyWebContext();
     _modelSocialMedia  = new ModelSocialMedia();
 }