Exemple #1
0
        public ActionResult AddProduct(Product product, List <HttpPostedFileBase> images)
        {
            if (!ModelState.IsValid)
            {
                using (StreamWriter sw = new StreamWriter(@"D:\test.txt", true, System.Text.Encoding.Default))
                {
                }
                return(RedirectToAction("Index", "Home"));
            }

            ProductManage pm = new ProductManage();

            if (pm.Add(product, images))
            {
                return(RedirectToAction("Index", "Admin"));
            }
            else
            {
                return(RedirectToAction("Index", "Admin"));
            }
        }