コード例 #1
0
        public ActionResult SaveAs(HttpPostedFileBase file, HttpPostedFileBase file1, string Good_name, string Good_price, string Good_Cate, string Good_nums, string Good_text)
        {
            //得到的名字是文件在本地机器的绝对路径
            string file2 = Save_img(file, "/Img/Good_photo");
            string file3 = Save_img(file1, "/Img/Good_intro");

            int price = Convert.ToInt32(Good_price);
            int nums  = Convert.ToInt32(Good_nums);
            //下面只是用来显示一些相关字符串做测试用
            int          Cate = Convert.ToInt32(Good_Cate);
            GoodsManager gm   = new GoodsManager();

            gm.Add_Goods(Good_name, price, nums, file2, file3, Cate, Good_text);
            return(RedirectToAction("Good_List"));
        }