Exemple #1
0
        public ActionResult PresidentDetailEdit(int id)
        {
            var PresidentDetails = db.PresidentDetail.Find(id);

            //var image = new UploadImageModel()
            //{
            //    InstanceId = PresidentDetails.ID,
            //    ParentId = PresidentDetails.ID,
            //    IsPrimary = false,
            //    CurrentImage = null,
            //    Type = "presidentDetail"
            //};

            PresidentDetailEditViewModel _presidentDetail = new PresidentDetailEditViewModel
            {
                ID = PresidentDetails.ID,
                Name = PresidentDetails.Name,
                Position = PresidentDetails.Position,
                Description = PresidentDetails.Description,
                //Image = image,
                Facebook = PresidentDetails.Facebook,
                Twitter = PresidentDetails.Twitter,
                Google = PresidentDetails.Google,
                LinkedIn = PresidentDetails.LinkedIn,
                Email = PresidentDetails.Email,
                Skype = PresidentDetails.Skype,
                ImagePath = PresidentDetails.ImageUrl
            };
            return View(_presidentDetail);
        }
Exemple #2
0
        public ActionResult PresidentDetailSubmit(PresidentDetailEditViewModel submit_PresidentDetail)
        {
            var presidentDetail = db.PresidentDetail.Find(submit_PresidentDetail.ID);

            presidentDetail.Name = submit_PresidentDetail.Name;
            presidentDetail.Position = submit_PresidentDetail.Position;
            presidentDetail.Description = submit_PresidentDetail.Description;
            presidentDetail.Facebook = submit_PresidentDetail.Facebook;
            presidentDetail.Twitter = submit_PresidentDetail.Twitter;
            presidentDetail.Google = submit_PresidentDetail.Google;
            presidentDetail.LinkedIn = submit_PresidentDetail.LinkedIn;
            presidentDetail.Email = submit_PresidentDetail.Email;
            presidentDetail.Skype = submit_PresidentDetail.Skype;
            //presidentDetail.ImageUrl = submit_PresidentDetail.ImagePath;

            db.SaveChanges();

            return RedirectToAction("PresidentDetail");
        }
Exemple #3
0
        public ActionResult PresidentDetailCreateSubmit(PresidentDetailEditViewModel create_PresidentDetail)
        {
            PresidentDetail presidentDetail = new PresidentDetail
            {
                Name = create_PresidentDetail.Name,
                Position = create_PresidentDetail.Position,
                Description = create_PresidentDetail.Description,
                Email = create_PresidentDetail.Email,
                Facebook = create_PresidentDetail.Facebook,
                Google = create_PresidentDetail.Google,
                LinkedIn = create_PresidentDetail.LinkedIn,
                Twitter = create_PresidentDetail.Twitter,
                Skype = create_PresidentDetail.Skype
            };

            db.PresidentDetail.Add(presidentDetail);
            db.SaveChanges();

            //ImageUpload _upload = new ImageUpload(Server);

            //create_PresidentDetail.Image.Type = "PresidentDetail";
            //create_PresidentDetail.Image.InstanceId = presidentDetail.ID;
            //create_PresidentDetail.Image.ParentId = presidentDetail.ID;

            //_upload.UploadImage(create_PresidentDetail.Image);

            return RedirectToAction("PresidentDetail");
        }