public ContentResult GOption_API() { string action = GetParam("action"); string ids = GetParam("ids"); switch (action) { case "del": gradeBll.DelByIds(ids); break; case "save": { string name = GetParam("name"); if (string.IsNullOrEmpty(name)) { return(Content(Failed.ToString())); } if (Mid > 0) { M_Grade info = gradeBll.GetGradeOption(Mid); info.GradeName = name; gradeBll.UpdateDic(info); } else { M_Grade info = new M_Grade(); info.GradeName = name; info.ParentID = DataConverter.CLng(RequestEx["ParentID"]); info.Cate = CateID; info.Grade = DataConverter.CLng(GetParam("level")); gradeBll.AddGradeOption(info); } break; } } return(Content(Success.ToString())); }