Explorar o código

添加时判断是否存在

wangh hai 1 ano
pai
achega
6321e3e4dc

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs

@@ -28,7 +28,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 {
                     string selectSql = string.Format(@"select * from Res_LocalGuideData where UnitArea='{0}' and UnitName='{1}' and Contact='{2}' and ContactTel='{3}'"
                                                        , dto.UnitArea, dto.UnitName, dto.Contact, dto.ContactTel);
-                    var LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(selectSql).FirstAsync();
+                    var LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(selectSql).FirstAsync();//查询是否存在
                     if (LocalGuideData != null)
                     {
                          return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };