public ActionResult AddFav(string ids, int type) { UserObj user = AppData.SessionUser; if (user == null) { return(Json(new { success = false, msg = "IS_NOT_LOGIN" })); } string[] aIds = ids.Split(','); UserBLL userBLL = new UserBLL(); for (int i = 0; i < aIds.Length; i++) { if (!string.IsNullOrEmpty(aIds[i])) { userBLL.AddFavorite(user.UserID, int.Parse(aIds[i]), type); } } return(Json(new { success = true })); }