public JsonResult AddDeviceOfDevice(string dvChild, int dvParent, int TypeChild, int TypeParent, int Type_TypeCom) { var lstId = dvChild.Split(','); for (int i = 0; i < lstId.Length; i++) { if (!lstId[i].Equals("")) { data.AddDeviceOfDevice(dvParent, Convert.ToInt32(lstId[i]), TypeChild, TypeParent, Type_TypeCom); } } bool result = true; return(Json(result, JsonRequestBehavior.AllowGet)); }