public ActionResult Edit(string id)
        {
            model = new ShopLapModel();
            Product product = model.Products.Find(id);

            pro             = product;
            ViewBag.Dongmay = new SelectList(model.SubCategories.ToList().OrderBy(x => x.mahienthi), "mahienthi", "tendanhmuccon");
            return(View(product));
        }
Beispiel #2
0
        public ActionResult CreateSubCategory()
        {
            model             = new ShopLapModel();
            ViewBag.madanhmuc = madanhmuc;
            dao = new CategoryDao();
            Category cate = dao.FindCategory(madanhmuc);

            ViewBag.tendanhmuc = cate.tendanhmuc;
            return(View());
        }
Beispiel #3
0
        public ActionResult Details(int ma)
        {
            madonhang = ma;
            ShopLapModel model = new ShopLapModel();
            Order        order = model.Orders.Find(ma);

            ViewBag.giohang = order;
            var rs = from s in model.OrderDetails where s.madathang == order.ma select s;

            return(View(rs));
        }
Beispiel #4
0
        public ActionResult EditSubCategory(string ma)
        {
            dao = new CategoryDao();
            SubCategory subCate = dao.FindSubCategory(ma);

            model = new ShopLapModel();
            SelectList selectList = new SelectList(model.Categories.ToList().OrderBy(x => x.ma), "ma", "tendanhmuc");

            ViewBag.Danhmuc = selectList;

            return(View(subCate));
        }
Beispiel #5
0
        public ActionResult UpdateStatus()
        {
            ShopLapModel model = new ShopLapModel();
            Order        order = model.Orders.Find(madonhang);

            order.status = "Đã nhận hàng và thanh toán";
            int lineChange = model.SaveChanges();

            if (lineChange != 0)
            {
                return(RedirectToAction("OrderManager", "HomeAd"));
            }
            else
            {
                return(Redirect(Request.UrlReferrer.ToString()));
            }
        }
 public CategoryDao()
 {
     shopLapModel = new ShopLapModel();
 }
 public OrderDetailDao()
 {
     model = new ShopLapModel();
 }
Beispiel #8
0
 public ProductsDao()
 {
     model = new ShopLapModel();
 }
Beispiel #9
0
        public ActionResult Create()
        {
            model = new ShopLapModel();

            return(View());
        }
 public ActionResult Create()
 {
     model           = new ShopLapModel();
     ViewBag.Dongmay = new SelectList(model.SubCategories.ToList().OrderBy(x => x.mahienthi), "mahienthi", "tendanhmuccon");
     return(View());
 }
 public UserDao()
 {
     model = new ShopLapModel();
 }
 public CustomerDao()
 {
     model = new ShopLapModel();
 }