public ActionResult Index(RoomViewModel roomViewModel) { if (roomViewModel.RoomId == 0) { if (_roomLogic.AddRoom(roomViewModel) != null) { return(Json(new { success = true, type = "add", message = "Room Added successfull" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, message = "Failed to Add Room" }, JsonRequestBehavior.AllowGet)); } } else { if (_roomLogic.EditRoom(roomViewModel)) { return(Json(new { success = true, type = "update", message = "Room Updated successfull" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, message = "Failed to update room" }, JsonRequestBehavior.AllowGet)); } } }