コード例 #1
0
        public ActionResult EditStatutes([Bind(Include = "Id, UploadedFile")] GoaRehabImg goaRehabTbl, string filename)
        {
            //if (ModelState.IsValid)
            //{
            string fn          = "";
            var    existingRec = db.GoaRehabTbls.Find(1);

            //GoaRehabTbl goaRehab = new GoaRehabTbl
            //{
            //    Id = goaRehabTbl.Id
            //};

            if (goaRehabTbl.UploadedFile != null)
            {
                fn = goaRehabTbl.UploadedFile.FileName.Substring(goaRehabTbl.UploadedFile.FileName.LastIndexOf('\\') + 1);
                fn = goaRehabTbl.Id + "_" + fn;
                string SavePath = System.IO.Path.Combine(Server.MapPath("~/Uploads/Documents/"), fn);
                goaRehabTbl.UploadedFile.SaveAs(SavePath);
                existingRec.Statutes = fn;
            }
            else
            {
                existingRec.Statutes = filename;
            }

            db.Entry(existingRec).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("InnerCircle", "Home"));
            //}
            //return View(goaRehabTbl);
        }
コード例 #2
0
        public ActionResult EditMission([Bind(Include = "Id,Mission")] GoaRehabImg goaRehabTbl)
        {
            var existingRec = db.GoaRehabTbls.Find(1);

            existingRec.Mission = goaRehabTbl.Mission;

            db.Entry(existingRec).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("InnerCircle", "Home"));
        }
コード例 #3
0
        public ActionResult EditVision([Bind(Include = "Id,Vision")] GoaRehabImg goaRehabTbl)
        {
            //if (ModelState.IsValid)
            //{
            var existingRec = db.GoaRehabTbls.Find(1);

            existingRec.Vision = goaRehabTbl.Vision;

            db.Entry(existingRec).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("InnerCircle", "Home"));
            //}
            //return View(goaRehabTbl);
        }
コード例 #4
0
        public ActionResult EditVision(int?id)
        {
            id = 1;
            GoaRehabTbl goaRehabTbl = db.GoaRehabTbls.Find(id);

            if (goaRehabTbl == null)
            {
                return(HttpNotFound());
            }
            GoaRehabImg ViewInfo = new GoaRehabImg
            {
                Id      = goaRehabTbl.Id,
                Mission = goaRehabTbl.Mission,
                Vision  = goaRehabTbl.Vision
            };

            return(View(ViewInfo));
        }
コード例 #5
0
        public ActionResult EditStatutes(int?id)
        {
            id = 1;
            GoaRehabTbl goaRehabTbl = db.GoaRehabTbls.Find(id);

            if (goaRehabTbl.Statutes == null)
            {
                ViewBag.ExistingDoc = "No Existing File";
            }
            else
            {
                ViewBag.ExistingDoc = goaRehabTbl.Statutes;
            }
            if (goaRehabTbl == null)
            {
                return(HttpNotFound());
            }
            GoaRehabImg ViewInfo = new GoaRehabImg
            {
                Id = goaRehabTbl.Id
            };

            return(View(ViewInfo));
        }