Пример #1
0
        public async Task <ActionResult> Create([Bind(Include = "UserName,Password,PubTime,Status")] User user)
        {
            if (ModelState.IsValid)
            {
                db.User.Add(user);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
Пример #2
0
        public async Task <ActionResult> Create([Bind(Include = "Sid,Img,Name,Position,Priority,Credit,Price,PubTime")] Scene scene)
        {
            if (ModelState.IsValid)
            {
                db.Scene.Add(scene);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(scene));
        }
Пример #3
0
        public async Task <ActionResult> Create([Bind(Include = "UserName,Password,PubTime")] Admin admin)
        {
            if (ModelState.IsValid)
            {
                db.Admin.Add(admin);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(admin));
        }
Пример #4
0
        public async Task <ActionResult> Create([Bind(Include = "Nid,UserName,Details,PubTime")] Note note)
        {
            if (ModelState.IsValid)
            {
                db.Note.Add(note);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.UserName = new SelectList(db.User, "UserName", "Password", note.UserName);
            return(View(note));
        }
Пример #5
0
        public async Task <ActionResult> Create([Bind(Include = "Oid,Sid,UserName,Total,PubTime")] Order order)
        {
            if (ModelState.IsValid)
            {
                db.Order.Add(order);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.Sid      = new SelectList(db.Scene, "Sid", "Img", order.Sid);
            ViewBag.UserName = new SelectList(db.User, "UserName", "Password", order.UserName);
            return(View(order));
        }