shzxscmvc/Controllers/shopController.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using shzxscmvc.Models;

namespace shzxscmvc.Controllers
{
    public class shopController : Controller
    {
        //
        // GET: /shop/
        shzxscmvc.Models.shzxscentiti shdb = new Models.shzxscentiti();
        public ActionResult Index()
        {
            var gtypeM = shdb.gtypes.Include("stypes");
            var stypeM = shdb.sitems.Include("goods");
            return this.View(new TypeViewModel { gtypes = gtypeM, sitems = stypeM });
        }
                
        //
        // GET: /shop/Details/5
        [Authorize]
        public ActionResult Details(int Id)
        {
            var goodsm = shdb.goods.Include("brand").SingleOrDefault(g => g.Id == Id);
            return View(goodsm);
        }
        
        //
        // GET: /shop/Create

        public ActionResult Create()
        {
            return View();
        } 

        //
        // POST: /shop/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        
        //
        // GET: /shop/Edit/5
 
        public ActionResult Edit(int id)
后面还有 70 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。