From f03b5c7ea42074b0aa6f6836301f20deefb64813 Mon Sep 17 00:00:00 2001
From: hwh <332078369@qq.com>
Date: 星期一, 03 六月 2024 11:42:47 +0800
Subject: [PATCH] 1

---
 Wms_09/WMS.BLL/SysServer/PrintTemplateServer.cs |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Wms_09/WMS.BLL/SysServer/PrintTemplateServer.cs b/Wms_09/WMS.BLL/SysServer/PrintTemplateServer.cs
index a69b49b..7cf7f17 100644
--- a/Wms_09/WMS.BLL/SysServer/PrintTemplateServer.cs
+++ b/Wms_09/WMS.BLL/SysServer/PrintTemplateServer.cs
@@ -29,6 +29,10 @@
         /// <exception cref="NotImplementedException"></exception>
         public async Task AddPrintTemplate(SysPrintTemplate model, int userid)
         {
+            if (model.Status == "1")
+            {
+                await Db.Updateable<SysPrintTemplate>().SetColumns(s => s.Status == "0").Where(s => s.Type == model.Type && model.Status == "1").ExecuteCommandAsync();
+            }
             model.CreateTime = DateTime.Now;
             model.CreateUser = userid;
             await Db.Insertable(model).ExecuteCommandAsync();
@@ -51,6 +55,10 @@
         /// <exception cref="NotImplementedException"></exception>
         public async Task EditPrintTemplate(SysPrintTemplate model, int userid)
         {
+            if (model.Status == "1")
+            {
+                await Db.Updateable<SysPrintTemplate>().SetColumns(s => s.Status == "0").Where(s => s.Type == model.Type && model.Status == "1").ExecuteCommandAsync();
+            }
             model.UpdateTime = DateTime.Now;
             model.UpdateUser = userid;
             await Db.Updateable(model).UpdateColumns(it => new { it.Name, it.Type, it.Status, it.PositionJson, it.UpdateTime, it.UpdateUser }).ExecuteCommandAsync();

--
Gitblit v1.8.0