// GET: ColorClient
        public ActionResult Index(int id)
        {
            var listHX = new CarManufacturerDAO().ListOf();

            ViewBag.HX = listHX;

            var listTL = new CategoryDAO().ListOf();

            ViewBag.TL = listTL;

            var listPK = new CylinderCapacityDAO().ListOf();

            ViewBag.PK = listPK;

            var listCL = new ColorDAO().ListOf();

            ViewBag.CL = listCL;

            var listNews = new NewsDAO().ListAll();

            ViewBag.New = listNews;

            var listNewPr = new ProductDAO().ListNewPro();

            ViewBag.Product = listNewPr;

            var listAllPr = new ProductDAO().ListByIDColor(id);

            ViewBag.ALLPro = listAllPr;

            return(View());
        }
        // GET: Admin/CylinderCapacityAdmin
        public ActionResult Index(string search, int page = 1, int pageSize = 10)
        {
            var iplAcc = new CylinderCapacityDAO();
            var model  = iplAcc.ListAllPage(search, page, pageSize);

            ViewBag.Search = search;

            return(View(model));
        }
Example #3
0
        public ActionResult Create(FeedbackModel model)
        {
            if (ModelState.IsValid)
            {
                var login = new FeedbackDAO();

                var user = new Feedback();
                user.id_User    = model.User_ID;
                user.id_Product = model.Product_ID;
                user.star       = model.Star;
                user.note       = model.Note;

                var result = login.Insert(user);
                if (result > 0)
                {
                    ViewBag.Success = "Đăng đánh giá bình luận thành công.";
                    return(RedirectToAction("Index", "ProductClient"));
                }
                else
                {
                    ModelState.AddModelError("", "Đăng đánh giá bình luận không thành công !!!");
                }
            }
            var listHX = new CarManufacturerDAO().ListOf();

            ViewBag.HX = listHX;

            var listTL = new CategoryDAO().ListOf();

            ViewBag.TL = listTL;

            var listPK = new CylinderCapacityDAO().ListOf();

            ViewBag.PK = listPK;

            var listCL = new ColorDAO().ListOf();

            ViewBag.CL = listCL;

            var listAllPr = new ProductDAO().ListAll();

            ViewBag.Pr = listAllPr;

            var listNews = new NewsDAO().ListAll();

            ViewBag.New = listNews;

            var listNewPr = new ProductDAO().ListNewPro();

            ViewBag.Product = listNewPr;

            return(View("Index"));
        }
        public ActionResult Edit(CylinderCapacity cylinderCapacity)
        {
            if (ModelState.IsValid)
            {
                var dao = new CylinderCapacityDAO();

                var result = dao.Update(cylinderCapacity);
                if (result)
                {
                    return(RedirectToAction("Index", "CylinderCapacityAdmin"));
                }
                else
                {
                    ModelState.AddModelError("", "Cập nhật thất bại");
                }
            }
            return(View("Index"));
        }
        public ActionResult Create(CylinderCapacity cylinderCapacity)
        {
            if (ModelState.IsValid)
            {
                var dao = new CylinderCapacityDAO();

                long id = dao.Insert(cylinderCapacity);
                if (id > 0)
                {
                    return(RedirectToAction("Index", "CylinderCapacityAdmin"));
                }
                else
                {
                    ModelState.AddModelError("", "Thêm mới thất bại");
                }
            }
            return(View());
        }
Example #6
0
        // GET: Admin/Product/Create
        public ActionResult Create()
        {
            CarManufacturerDAO hx = new CarManufacturerDAO();
            var hxList            = hx.ListOf();

            CategoryDAO lx     = new CategoryDAO();
            var         lxList = lx.ListOf();

            CylinderCapacityDAO dtxl = new CylinderCapacityDAO();
            var dtxlList             = dtxl.ListOf();

            ColorDAO mx     = new ColorDAO();
            var      mxList = mx.ListOf();

            ViewBag.HX   = hxList;
            ViewBag.LX   = lxList;
            ViewBag.DTXL = dtxlList;
            ViewBag.MX   = mxList;

            return(View());
        }
Example #7
0
        // GET: Admin/Product/Edit/5
        public ActionResult Edit(int id)
        {
            var sp = new ProductDAO().ViewDetail(id);

            CarManufacturerDAO hx = new CarManufacturerDAO();
            var hxList            = hx.ListOf();

            CategoryDAO lx     = new CategoryDAO();
            var         lxList = lx.ListOf();

            CylinderCapacityDAO dtxl = new CylinderCapacityDAO();
            var dtxlList             = dtxl.ListOf();

            ColorDAO mx     = new ColorDAO();
            var      mxList = mx.ListOf();

            ViewBag.HX   = hxList;
            ViewBag.LX   = lxList;
            ViewBag.DTXL = dtxlList;
            ViewBag.MX   = mxList;

            return(View(sp));
        }
Example #8
0
        // GET: ProductClient
        public ActionResult Index(string search, int page = 1, int pageSize = 20)
        {
            var listHX = new CarManufacturerDAO().ListOf();

            ViewBag.HX = listHX;

            var listTL = new CategoryDAO().ListOf();

            ViewBag.TL = listTL;

            var listPK = new CylinderCapacityDAO().ListOf();

            ViewBag.PK = listPK;

            var listCL = new ColorDAO().ListOf();

            ViewBag.CL = listCL;

            var listNews = new NewsDAO().ListAll();

            ViewBag.New = listNews;

            var listNewPr = new ProductDAO().ListNewPro();

            ViewBag.Product = listNewPr;

            //var listAllPr = new ProductDAO().ListOf();
            //ViewBag.ALLPro = listAllPr;

            var iplAcc = new ProductDAO();
            var model  = iplAcc.ListAllPage(search, page, pageSize);

            ViewBag.Search = search;

            return(View(model));
        }
        // GET: Admin/CylinderCapacity/Edit/5
        public ActionResult Edit(int id)
        {
            var cl = new CylinderCapacityDAO().Detail(id);

            return(View(cl));
        }