public async Task <bool> AddRefuseReasonToNoteAsync(int profileId, string type) { if (profileId <= 0 || string.IsNullOrWhiteSpace(type)) { return(ToResponse(false, Errors.invalid_data)); } var response = await _svMcredit.GetProfileById(profileId.ToString()); if (!response.success) { return(ToResponse <bool>(false, response.error)); } if (response.data.obj == null) { return(ToResponse(false, "Không tìm thấy hồ sơ")); } var profileInPortal = await _rpMCredit.GetTemProfileByMcIdAsync(response.data.obj.Id); if (!profileInPortal.success) { return(ToResponse(false, "Không tìm thấy hồ sơ trong portal")); } if (type == "refuse") { return(await AddRefuseToNote(profileInPortal.data.Id, response.data.obj)); } if (type == "reason") { return(await AddReasonToNote(profileInPortal.data.Id, response.data.obj)); } return(true); }
public async Task <JsonResult> AddRefuseReasonToNote(int profileId, string type) { if (profileId <= 0 || string.IsNullOrWhiteSpace(type)) { return(ToJsonResponse(false, "Dữ liệu không hợp lệ")); } var profile = await _svMCredit.GetProfileById(profileId.ToString(), GlobalData.User.IDUser); if (profile.status == "error") { return(ToJsonResponse(false, profile.message)); } if (profile.obj == null) { return(ToJsonResponse(false, "Không tìm thấy hồ sơ")); } var profileInPortal = await _rpMCredit.GetTemProfileByMcId(profile.obj.Id); if (profileInPortal == null) { return(ToJsonResponse(false, "Không tìm thấy hồ sơ trong portal")); } if (type == "refuse") { return(await AddRefuseToNote(profileInPortal.Id, profile.obj)); } if (type == "reason") { return(await AddReasonToNote(profileInPortal.Id, profile.obj)); } return(ToJsonResponse(true)); }