Employee upload picture buge fixed
This commit is contained in:
@@ -10,6 +10,8 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Diagnostics;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Json;
|
||||
using System.Transactions;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
{
|
||||
@@ -294,6 +296,13 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
IsSuccedded = false,
|
||||
Message = "هنوز عملیاتی انجام نشده است"
|
||||
};
|
||||
var result2 = new OperationResult()
|
||||
{
|
||||
IsSuccedded = false,
|
||||
Message = "هنوز عملیاتی انجام نشده است"
|
||||
};
|
||||
using var transaction = new TransactionScope();
|
||||
|
||||
if (rollCallEmployee == null)
|
||||
{
|
||||
var createCommand = new CreateRollCallEmployee()
|
||||
@@ -304,7 +313,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
HasUploadedImage = "true",
|
||||
};
|
||||
result = _rollCallEmployeeApplication.Create(createCommand);
|
||||
_rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus()
|
||||
result2=_rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus()
|
||||
{ RollCallEmployeeId = result.SendId });
|
||||
}
|
||||
else
|
||||
@@ -312,8 +321,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
result = _rollCallEmployeeApplication.UploadedImage(employeeId, workshopId);
|
||||
}
|
||||
|
||||
if (result.IsSuccedded)
|
||||
if (result.IsSuccedded && result2.IsSuccedded)
|
||||
{
|
||||
transaction.Complete();
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = result.IsSuccedded,
|
||||
@@ -323,11 +333,18 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = result.IsSuccedded,
|
||||
Message = result.Message,
|
||||
});
|
||||
if(result.IsSuccedded==false)
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = result.IsSuccedded,
|
||||
Message = result.Message,
|
||||
});
|
||||
else
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = result2.IsSuccedded,
|
||||
Message = result2.Message
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user