private async void ReportAction()
{
IsSending = true;
if (string.IsNullOrEmpty(_reason))
{
ServiceLocator.NotifictionService.ShowMessageBox(AppResourcesHelper.Get("Main_ReportErrorCaption"),
AppResourcesHelper.Get("Main_ReportMissingData"), MissingReportDataCallback, MessageBoxOptions.Ok);
}
else
{
JSONStatusResponse statusResponse = await ServiceLocator.WebCommunicationService.ReportAsInappropriateAsync(_selectedOnlineProgram.ProjectId, _reason, ServiceLocator.CultureService.GetCulture().TwoLetterISOLanguageName);
switch (statusResponse.statusCode)
{
case StatusCodes.ServerResponseOk:
ServiceLocator.NotifictionService.ShowMessageBox(AppResourcesHelper.Get("Main_ReportProgram"),
AppResourcesHelper.Get("Main_ReportContribution"), ReportSuccessfullCallback, MessageBoxOptions.Ok);
GoBackAction();
break;
case StatusCodes.HTTPRequestFailed:
ServiceLocator.NotifictionService.ShowMessageBox(AppResourcesHelper.Get("Main_ReportErrorCaption"),
AppResourcesHelper.Get("Main_NoInternetConnection"), MissingReportDataCallback, MessageBoxOptions.Ok);
break;
default:
string messageString = string.IsNullOrEmpty(statusResponse.answer) ? string.Format(AppResourcesHelper.Get("Main_UploadProgramUndefinedError"), statusResponse.statusCode.ToString()) :
string.Format(AppResourcesHelper.Get("Main_ReportError"), statusResponse.answer);
ServiceLocator.NotifictionService.ShowMessageBox(AppResourcesHelper.Get("Main_ReportErrorCaption"),
messageString, MissingReportDataCallback, MessageBoxOptions.Ok);
break;
}
}
IsSending = false;
}