From 6131316db2e61c717a6fbd1db774b41b60c933e9 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期三, 21 九月 2022 09:45:32 +0800
Subject: [PATCH] 优化查询
---
zhengcaioa/zhengcaioa/Controllers/ProjectController.cs | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
index e23b9a9..7f7a075 100644
--- a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
@@ -16,6 +16,7 @@
using zhengcaioa.Models;
using System.IdentityModel.Tokens.Jwt;
using CommonToolsCore;
+using System.Transactions;
namespace zhengcaioa.Controllers
{
@@ -299,8 +300,21 @@
}
data.Modifier = curentuser.Id;
data.Modifytime = DateTime.Now;
+ ResultEntity resultEntity = new ResultEntity();
+ resultEntity.Result = false;
+ using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
+ new TransactionOptions
+ {
+ IsolationLevel = IsolationLevel.ReadCommitted,
+ Timeout = TransactionManager.MaximumTimeout
+ }
+ ))
+ {
+ resultEntity = _projectService.saveLiaotian(data);
+ scope.Complete();
+ }
- ResultEntity resultEntity = _projectService.saveLiaotian(data);
+
return JsonConvert.SerializeObject(resultEntity);
}
@@ -371,6 +385,10 @@
ViewBag.Creater = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList();
ViewBag.flbx = _liaotianService.GetSYScode("system", "shifou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
ViewBag.ShiFouyReasonname = _liaotianService.GetSYScode("Project", "ShiFouyReasonname").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
+
+ ViewBag.Baomingtimebegin = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd");
+ ViewBag.Baomingtimeend = DateTime.Now.ToString("yyyy-MM-dd");
+
return View();
}
--
Gitblit v1.9.1