|
@@ -167,13 +167,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
string selectSql = string.Format(@"select * from Grp_DecreasePayments where PriceName='{0}' and IsDel={1} and DiId={2}"
|
|
string selectSql = string.Format(@"select * from Grp_DecreasePayments where PriceName='{0}' and IsDel={1} and DiId={2}"
|
|
, dto.PriceName, 0, dto.DiId);
|
|
, dto.PriceName, 0, dto.DiId);
|
|
- var DecreasePayments = await _sqlSugar.SqlQueryable<Grp_DecreasePayments>(selectSql).FirstAsync();
|
|
+
|
|
- if (DecreasePayments != null)
|
|
+
|
|
- {
|
|
+
|
|
- return new JsonView() { Code = 400, Msg = "该数据已存在,请勿重复添加!" };
|
|
+
|
|
- }
|
|
+
|
|
- else
|
|
+
|
|
- {
|
|
+
|
|
id = await AddAsyncReturnId(grp_Decrease);
|
|
id = await AddAsyncReturnId(grp_Decrease);
|
|
if (id < 1)
|
|
if (id < 1)
|
|
{
|
|
{
|
|
@@ -289,7 +289,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
RollbackTran();
|
|
RollbackTran();
|
|
return new JsonView() { Code = 400, Msg = "添加失败!" };
|
|
return new JsonView() { Code = 400, Msg = "添加失败!" };
|
|
- }
|
|
+
|
|
}
|
|
}
|
|
else if (dto.Status == 2)
|
|
else if (dto.Status == 2)
|
|
{
|
|
{
|