public JsonResult GetChildrenCount(string typeName, int?id, bool plus) { if (typeName == "root") { return(Json((plus ? 1 : -1) * TreeLoader.CalculateDescendants(BSUIR), JsonRequestBehavior.AllowGet)); } return(Json((plus ? 1 : -1) * TreeLoader.GetNumberOfDescendants(typeName, (int)id, rep), JsonRequestBehavior.AllowGet)); }