Browse Source

ResultStatus修改

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
650d2fad04
  1. 23
      src/Shentun.Peis.Domain/ResultStatuses/ResultStatusManager.cs

23
src/Shentun.Peis.Domain/ResultStatuses/ResultStatusManager.cs

@ -33,7 +33,7 @@ namespace Shentun.Peis.ResultStatuses
{
Check.NotNullOrWhiteSpace(entity.Id, nameof(entity.Id));
Check.NotNullOrWhiteSpace(entity.DisplayName, nameof(entity.DisplayName));
Verify(entity);
var existEntity = await _repository.FindAsync(o => o.Id == entity.Id);
if (existEntity != null)
{
@ -73,14 +73,7 @@ namespace Shentun.Peis.ResultStatuses
if (oldentity != null)
{
if (!DataHelper.IsColorNumber(entity.DataInputBackgroundColor))
throw new UserFriendlyException($"数据录入报告单颜色代码格式不正确");
if (!DataHelper.IsColorNumber(entity.DataInputFontColor))
throw new UserFriendlyException($"数据录入字体颜色代码格式不正确");
if (!DataHelper.IsColorNumber(entity.ReportBackgroundColor))
throw new UserFriendlyException($"报告单背景颜色代码格式不正确");
if (!DataHelper.IsColorNumber(entity.ReportFontColor))
throw new UserFriendlyException($"报告单字体颜色代码格式不正确");
Verify(entity);
oldentity.DataInputBackgroundColor = entity.DataInputBackgroundColor;
oldentity.DataInputFontColor = entity.DataInputFontColor;
@ -99,7 +92,17 @@ namespace Shentun.Peis.ResultStatuses
}
}
public void Verify(ResultStatus entity)
{
if (!DataHelper.IsColorNumber(entity.DataInputBackgroundColor))
throw new UserFriendlyException($"数据录入报告单颜色代码格式不正确");
if (!DataHelper.IsColorNumber(entity.DataInputFontColor))
throw new UserFriendlyException($"数据录入字体颜色代码格式不正确");
if (!DataHelper.IsColorNumber(entity.ReportBackgroundColor))
throw new UserFriendlyException($"报告单背景颜色代码格式不正确");
if (!DataHelper.IsColorNumber(entity.ReportFontColor))
throw new UserFriendlyException($"报告单字体颜色代码格式不正确");
}
/// <summary>
/// 修改排序 相邻之间
/// </summary>

Loading…
Cancel
Save