Exemplo n.º 1
0
        public ActionResult addproduct(int?id = 0)
        {
            product model = new product();

            if (id != 0)
            {
                model = prbll.GetById((int)id);
            }
            return(View(model));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 产品详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult particulars(int?id = 0)
        {
            product model = new product();

            try
            {
                model         = _productbll.GetById((int)id);
                ViewBag.shang = _productbll.shang((int)id);
                ViewBag.xia   = _productbll.xia((int)id);
                //select top 1 * from newst where id <2 order by id DESC

                //select top 1 * from newst where id > 2 order by id ASC
                return(View(model));
            }
            catch (Exception)
            {
                return(View(model));
            }
        }