private JsonResult saveProfilePicture(ProfilePicture profilePicture, string command) { Response response = new Response(); ProfilePictureDataHandler profilePictureDataHandler = new ProfilePictureDataHandler(config); //main code return(Json(response)); }
public JsonResult deleteProfilePicture(int userId) { Response response = new Response(); ProfilePictureDataHandler profilePictureDataHandler = new ProfilePictureDataHandler(config); response.status = profilePictureDataHandler.deleteProfilePicture(userId); return(Json(response)); }
private JsonResult saveProfilePicture(ProfilePicture profilePicture, string command) { Response response = new Response(); ProfilePictureDataHandler profilePictureDataHandler = new ProfilePictureDataHandler(config); profilePictureDataHandler.userId = profilePicture.userId; profilePictureDataHandler.profilePicture = profilePicture.profilePicture; if (command.Equals("create")) { response.status = profilePictureDataHandler.createProfilePicture(); } if (command.Equals("update")) { response.status = profilePictureDataHandler.updateProfilePicture(); } return(Json(response)); }
public JsonResult getProfilePicture(int userId) { Response response = new Response(); ProfilePictureDataHandler profilePictureDataHandler = new ProfilePictureDataHandler(config); try { ProfilePicture profilePicture = profilePictureDataHandler.getProfilePicture(userId); response.data = JsonConvert.SerializeObject(profilePicture); response.status = true; } catch (Exception ex) { response.status = false; response.message = ex.Message; } return(Json(response)); }