public ActionResult AddSubCategory(SubCategoryViewModel input) { SubCategoryViewModel csv = new SubCategoryViewModel(); csv.Sub_Category_ID = input.Sub_Category_ID; csv.Category_Name = input.Category_Name; csv.Category_ID = input.Category_ID; //csv.Category_Name = input.Category_Name; CategoryService cs = new CategoryService(); if (cs.AddSubCategory(csv)) { TempData["message"] = "新增成功"; return(RedirectToAction("Index", "dashboardCategory")); } else { TempData["message"] = "新增失敗"; return(RedirectToAction("Index", "dashboardCategory")); } }