From 0235d2053a6132591604bf0a582ef6b0014f17d6 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期四, 06 一月 2022 14:23:03 +0800
Subject: [PATCH] 客户预付款
---
zhengcaioa/zhengcaioa/Controllers/HR/HrJibengongziController.cs | 75 +++++++++++++++++++++++++++++++++++++
1 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Controllers/HR/HrJibengongziController.cs b/zhengcaioa/zhengcaioa/Controllers/HR/HrJibengongziController.cs
index 184d084..e18ff3d 100644
--- a/zhengcaioa/zhengcaioa/Controllers/HR/HrJibengongziController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/HR/HrJibengongziController.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using System.Transactions;
using zhengcaioa.IService;
using zhengcaioa.Models;
@@ -153,5 +154,79 @@
ViewData["curentuser"] = curentuser;
return new JsonResult(_hrJibengongziService.ModifyStatus(Id, curentuser.Id));
}
+
+
+ public IActionResult EditShebao()
+ {
+ var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+ ViewData["curentuser"] = curentuser;
+ var shebaoDTO = _hrJibengongziService.GetListShebao().FirstOrDefault();
+
+
+ if (shebaoDTO == null)
+ {
+ shebaoDTO = new HrShebaoDTO();
+ shebaoDTO.Shebaodanwei = 0;
+ shebaoDTO.Shebaogeren = 0;
+ }
+
+
+
+
+ ViewData.Model = shebaoDTO;
+
+
+
+
+ return View();
+ }
+
+
+ /// <summary>
+ /// 淇濆瓨
+ /// </summary>
+ /// <param name="data">宀椾綅瀹炰綋绫诲璞�</param>
+ /// <returns></returns>
+ ///
+ [HttpPost]
+ public IActionResult SaveShebao(HrShebaoDTO data)
+ {
+
+ ResultEntity resultEntity = new ResultEntity();
+
+
+
+ using (TransactionScope scope = new TransactionScope())
+ {
+ var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+ ViewData["curentuser"] = curentuser;
+ data.RecStatus = "A";
+
+ var resultDTO = _hrJibengongziService.GetListShebao().FirstOrDefault();
+ if (resultDTO == null || string.IsNullOrEmpty(resultDTO.Id))
+ {
+ resultDTO = new HrShebaoDTO();
+ resultDTO.Shebaodanwei = data.Shebaodanwei;
+ resultDTO.Shebaogeren = data.Shebaogeren;
+ resultDTO.Creater = curentuser.Id;
+ resultDTO.Createtime = DateTime.Now;
+ }
+ else
+ {
+ resultDTO.Shebaodanwei = data.Shebaodanwei;
+ resultDTO.Shebaogeren = data.Shebaogeren;
+ }
+ resultDTO.Modifier = curentuser.Id;
+ resultDTO.Modifytime = DateTime.Now;
+
+ resultEntity = _hrJibengongziService.saveShebao(resultDTO);
+
+ scope.Complete();
+ }
+
+
+ return new JsonResult(resultEntity);
+ }
+
}
}
--
Gitblit v1.9.1