Exemple #1
0
        public ActionResult Edit([Bind(Include = "GID,GName,GPrice,GPhoto,GColor,GSize,GSaled,GBiaoshi,GDetails,GCID")] Goods goods)
        {
            if (Session["MGID"] != null)
            {
                if (ModelState.IsValid)
                {
                    db.Entry(goods).State = EntityState.Modified;
                    db.SaveChanges();

                    return(RedirectToAction("Index"));
                }

                return(View(goods));
            }
            else
            {
                return(RedirectToAction("ManagerLogin", "Manager"));
            }
        }
        public ActionResult Edit([Bind(Include = "VID,VName,VTime,VSavepath,VClicknum,VDownloadnum,VSrcimg")] Video video)
        {
            if (Session["MGID"] != null)
            {
                if (ModelState.IsValid)
                {
                    db.Entry(video).State = EntityState.Modified;
                    db.SaveChanges();

                    return(RedirectToAction("Index"));
                }

                return(View(video));
            }
            else
            {
                return(RedirectToAction("ManagerLogin", "Manager"));
            }
        }
        public ActionResult Edit([Bind(Include = "UserID,UserName,UserPassword,UserTpl,UserSex,UserAvatar,UserEmail,UserAge,UserHeight,UserWeight")] Users users)
        {
            if (Session["MGID"] != null)
            {
                if (ModelState.IsValid)
                {
                    db.Entry(users).State = EntityState.Modified;
                    db.SaveChanges();

                    return(RedirectToAction("Index"));
                }

                return(View(users));
            }
            else
            {
                return(RedirectToAction("ManagerLogin", "Manager"));
            }
        }
Exemple #4
0
        public ActionResult Edit([Bind(Include = "NID,NTime,NTitle,NImage,NContent,NCID,NViewnum,NCommentnum,VID")] News news)
        {
            if (Session["MGID"] != null)
            {
                if (ModelState.IsValid)
                {
                    db.Entry(news).State = EntityState.Modified;
                    db.SaveChanges();

                    return(RedirectToAction("Index"));
                }
                ViewBag.NCID = new SelectList(db.NewsComment, "NCID", "NCContent", news.NCID);
                ViewBag.VID  = new SelectList(db.Video, "VID", "VName", news.VID);

                return(View(news));
            }
            else
            {
                return(RedirectToAction("ManagerLogin", "Manager"));
            }
        }
        public ActionResult Edit([Bind(Include = "PID,UserID,PTitle,PTime,PContent,PViewnum,VID,PCID,PCommentnum")] Posts posts)
        {
            if (Session["MGID"] != null)
            {
                if (ModelState.IsValid)
                {
                    db.Entry(posts).State = EntityState.Modified;
                    db.SaveChanges();

                    return(RedirectToAction("Index"));
                }

                ViewBag.PCID   = new SelectList(db.PostsComment, "PCID", "PCContent", posts.PCID);
                ViewBag.UserID = new SelectList(db.Users, "UserID", "UserName", posts.UserID);
                ViewBag.VID    = new SelectList(db.Video, "VID", "VName", posts.VID);

                return(View(posts));
            }
            else
            {
                return(RedirectToAction("ManagerLogin", "Manager"));
            }
        }