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

            if (id != 0)
            {
                model = prbll.GetById((int)id);
            }
            return(View(model));
        }
Esempio 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));
            }
        }