...
This commit is contained in:
@@ -98,48 +98,48 @@ namespace Back.Services
|
||||
// })
|
||||
// .FirstOrDefaultAsync();
|
||||
//}
|
||||
//public async Task<Customer?> AddORUpdateCustomer(Customer item)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// SysLog log = new SysLog()
|
||||
// {
|
||||
// TraceIdentifierID = _httpContextAccessor.HttpContext.TraceIdentifier,
|
||||
// Datetime = DateTime.Now.ConvertMiladiToShamsi(),
|
||||
// Method = $"{_httpContextAccessor.HttpContext.Request.Method}/{this.GetType().FullName}/AddORUpdateCustomer",
|
||||
// Value ="*"+ JsonConvert.SerializeObject(item),
|
||||
// Route = _httpContextAccessor.HttpContext.Request.Path,
|
||||
// Type = "User"
|
||||
// };
|
||||
// _contextMongodb.InsertItem(log);
|
||||
public async Task<bool> AddCustomer(Customer item)
|
||||
{
|
||||
try
|
||||
{
|
||||
//SysLog log = new SysLog()
|
||||
//{
|
||||
// TraceIdentifierID = _httpContextAccessor.HttpContext.TraceIdentifier,
|
||||
// Datetime = DateTime.Now.ConvertMiladiToShamsi(),
|
||||
// Method = $"{_httpContextAccessor.HttpContext.Request.Method}/{this.GetType().FullName}/AddORUpdateCustomer",
|
||||
// Value = "*" + JsonConvert.SerializeObject(item),
|
||||
// Route = _httpContextAccessor.HttpContext.Request.Path,
|
||||
// Type = "User"
|
||||
//};
|
||||
//_contextMongodb.InsertItem(log);
|
||||
|
||||
// if (item.ID == null || item.ID == 0)
|
||||
// {
|
||||
// var ret = await _repositores.ADD(item);
|
||||
// _checkPermission.ExtensionofAccess(item.CompanyID, 5, "-1");
|
||||
// return item;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return await _repositores.UPDATE(item);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// SysLog log = new SysLog()
|
||||
// {
|
||||
// TraceIdentifierID = _httpContextAccessor.HttpContext.TraceIdentifier,
|
||||
// Datetime = DateTime.Now.ConvertMiladiToShamsi(),
|
||||
// Method = $"{_httpContextAccessor.HttpContext.Request.Method}/{this.GetType().FullName}/AddORUpdateCustomer",
|
||||
// Value = ex.Message,
|
||||
// Route = _httpContextAccessor.HttpContext.Request.Path,
|
||||
// Type = "catch"
|
||||
// };
|
||||
// _contextMongodb.InsertItem(log);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
//}
|
||||
if (item.ID == null || item.ID == 0)
|
||||
{
|
||||
var ret = await _repoCus.AddBoolResultAsync(item);
|
||||
await _checkPermission.ExtensionofAccess(item.CompanyID, 5, "-1");
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
return await _repoCus.UpdateAsync(item);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//SysLog log = new SysLog()
|
||||
//{
|
||||
// TraceIdentifierID = _httpContextAccessor.HttpContext.TraceIdentifier,
|
||||
// Datetime = DateTime.Now.ConvertMiladiToShamsi(),
|
||||
// Method = $"{_httpContextAccessor.HttpContext.Request.Method}/{this.GetType().FullName}/AddORUpdateCustomer",
|
||||
// Value = ex.Message,
|
||||
// Route = _httpContextAccessor.HttpContext.Request.Path,
|
||||
// Type = "catch"
|
||||
//};
|
||||
//_contextMongodb.InsertItem(log);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
//public async Task<bool> DeleteCustomer(Customer item)
|
||||
//{
|
||||
|
||||
@@ -172,10 +172,10 @@ namespace Back.Services
|
||||
// };
|
||||
// _contextMongodb.InsertItem(log);
|
||||
// return false;
|
||||
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user