diff --git a/SGGL/BLL/SysManage/SysConstSetService.cs b/SGGL/BLL/SysManage/SysConstSetService.cs index dab17eac..14dd44a5 100644 --- a/SGGL/BLL/SysManage/SysConstSetService.cs +++ b/SGGL/BLL/SysManage/SysConstSetService.cs @@ -78,6 +78,15 @@ else { Model.Sys_Set newSysSet5 = new Model.Sys_Set(); + var q = (from x in Funs.DB.Sys_Set orderby x.SetId descending select x).FirstOrDefault(); + if (q == null) + { + newSysSet5.SetId = 1; + } + else + { + newSysSet5.SetId = q.SetId + 1; + } if (!string.IsNullOrEmpty(token)) { newSysSet5.SetValue = token; @@ -101,6 +110,15 @@ else { Model.Sys_Set newSysSet5 = new Model.Sys_Set(); + var q = (from x in Funs.DB.Sys_Set orderby x.SetId descending select x).FirstOrDefault(); + if (q == null) + { + newSysSet5.SetId = 1; + } + else + { + newSysSet5.SetId = q.SetId + 1; + } if (!string.IsNullOrEmpty(ExpirationTime)) { newSysSet5.SetValue = ExpirationTime;