public ActionResult AddCategory(string name, string displayOrder) { int tempDisplayOrder = 0; if (!string.IsNullOrEmpty(name) && Int32.TryParse(displayOrder, out tempDisplayOrder)) { DemandCategory demandCategory = new DemandCategory(); demandCategory.Name = name; demandCategory.DisplayOrder = tempDisplayOrder; demandCategory.IsActive = true; demandManager.AddCategory(demandCategory); } return Redirect("/admin/demand/category"); }
/// <summary> /// 添加供求类别 /// </summary> public bool AddCategory(DemandCategory demandCategory) { bool result = false; try { if (demandCategory != null) { result = demandCategoryRepository.AddEntitySave(demandCategory); } } catch (Exception e) { LogService.Log("添加供求类别失败", e.ToString()); } return result; }