From 09aabc5fb34840da61559f76314ca86cc858a4ea Mon Sep 17 00:00:00 2001 From: Yiru Date: Fri, 15 Mar 2024 22:26:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3LAB001=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AMES/LabelParamController.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs index ec967a3b..d4bf6103 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs @@ -96,6 +96,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES result.Success = false; result.Msg = "變數名稱請輸入數字和英文大小寫字母。"; } + else + { + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } } else { @@ -132,7 +138,17 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES result.Success = false; result.Msg = "變數名稱請輸入數字和英文大小寫字母。"; } - } + + else + { + Helper helper = new Helper(_context); + labelParam.LABEL_FIELD_ID = helper.GetIDKey("LABEL_FIELD_ID").Result; + _context.LabelParam.Add(labelParam); + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } + } else { Helper helper = new Helper(_context);