示例#1
0
        public ActionResult detailSP(string MASP)
        {
            SanPhamDao            dao  = new SanPhamDao();
            BINHLUANDao           dao1 = new BINHLUANDao();
            SanPham               sp   = dao.detail(MASP);
            IQueryable <BINHLUAN> bl   = dao1.ListBL(MASP);
            var slbl = dao1.SLBL(MASP);

            ViewBag.SLBL = slbl;
            CMTofSP cmt = new CMTofSP()
            {
                SanPham = sp,
                listBL  = bl
            };

            return(View(cmt));
        }
示例#2
0
        public ActionResult AddBL(string MASP, string COMMENT)
        {
            if (Session["UserName"] != null)

            {
                string      email = Convert.ToString(Session["UserName"]);
                var         ngay  = DateTime.Now.Date;
                BINHLUANDao dao   = new BINHLUANDao();
                BINHLUAN    bl    = new BINHLUAN();
                bl.MASP    = MASP;
                bl.NGAYCM  = ngay;
                bl.EMAIL   = email;
                bl.COMMENT = COMMENT;
                if (ModelState.IsValid)
                {
                    dao.AddBL(bl);
                }
            }
            return(Redirect("detailSP?MASP=" + MASP + ""));
        }