| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using System.Transactions; |
| | | using zhengcaioa.IService; |
| | |
| | | } |
| | | ViewBag.shenfenzheng = resultshenfenzheng; |
| | | |
| | | |
| | | ResultDataEntity<SysAttachmentDTO> resultshenfenzhengbeimian = new ResultDataEntity<SysAttachmentDTO>(); |
| | | if (!string.IsNullOrEmpty(id)) |
| | | { |
| | |
| | | resultshenfenzhengbeimian = _sysAttachmentService.SearchByPaging(searchEntity); |
| | | } |
| | | ViewBag.shenfenzhengbeimian = resultshenfenzhengbeimian; |
| | | |
| | | |
| | | |
| | | ResultDataEntity<SysAttachmentDTO> resultsxuelizheng = new ResultDataEntity<SysAttachmentDTO>(); |
| | | if (!string.IsNullOrEmpty(id)) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [CheckLogin] |
| | | public string Get(string id = null) |
| | | { |
| | |
| | | ViewData["curentuser"] = curentuser; |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | using (TransactionScope scope = new TransactionScope()) |
| | | |
| | | string s = @"^([A-Fa-f0-9]{2}[-,:]){5}[A-Fa-f0-9]{2}$"; |
| | | Regex rStr = new Regex(s); |
| | | if (rStr.IsMatch(userdata.IpMac)) |
| | | { |
| | | |
| | | userdata.RecStatus = "A"; |
| | | if (String.IsNullOrEmpty(userdata.Id)) |
| | | using (TransactionScope scope = new TransactionScope()) |
| | | { |
| | | userdata.Creater = curentuser.Id; |
| | | userdata.Createtime = DateTime.Now; |
| | | } |
| | | userdata.Modifier = curentuser.Id; |
| | | userdata.Modifytime = DateTime.Now; |
| | | |
| | | resultEntity = _userService.savePltUser(userdata); |
| | | if (resultEntity.Result == false) |
| | | { |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | string[] JiatingchengyuanId = userdata.JiatingchengyuanId; |
| | | string[] Name = userdata.Name; |
| | | string[] Guanxi = userdata.Guanxi; |
| | | string[] Gongzuodanwei = userdata.Gongzuodanwei; |
| | | |
| | | |
| | | for (int i = 0; i < JiatingchengyuanId.Length; i++) |
| | | { |
| | | PltJiatingchengyuanDTO pltJiatingchengyuanDTO = new PltJiatingchengyuanDTO(); |
| | | pltJiatingchengyuanDTO.Id = JiatingchengyuanId[i] == null ? "" : JiatingchengyuanId[i].Trim(); |
| | | pltJiatingchengyuanDTO.UserId = userdata.Id; |
| | | pltJiatingchengyuanDTO.Name = Name[i] == null ? "" : Name[i].Trim(); |
| | | pltJiatingchengyuanDTO.Guanxi = Guanxi[i] == null ? "" : Guanxi[i].Trim(); |
| | | pltJiatingchengyuanDTO.Gongzuodanwei = Gongzuodanwei[i] == null ? "" : Gongzuodanwei[i].Trim(); |
| | | pltJiatingchengyuanDTO.RecStatus = "A"; |
| | | if (String.IsNullOrEmpty(JiatingchengyuanId[i])) |
| | | userdata.RecStatus = "A"; |
| | | if (String.IsNullOrEmpty(userdata.Id)) |
| | | { |
| | | pltJiatingchengyuanDTO.Creater = curentuser.Id; |
| | | pltJiatingchengyuanDTO.Createtime = DateTime.Now; |
| | | userdata.Creater = curentuser.Id; |
| | | userdata.Createtime = DateTime.Now; |
| | | } |
| | | pltJiatingchengyuanDTO.Modifier = curentuser.Id; |
| | | pltJiatingchengyuanDTO.Modifytime = DateTime.Now; |
| | | resultEntity = _pltJiatingchengyuanService.save(pltJiatingchengyuanDTO); |
| | | userdata.Modifier = curentuser.Id; |
| | | userdata.Modifytime = DateTime.Now; |
| | | |
| | | resultEntity = _userService.savePltUser(userdata); |
| | | if (resultEntity.Result == false) |
| | | { |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | } |
| | | string[] JiatingchengyuanId = userdata.JiatingchengyuanId; |
| | | string[] Name = userdata.Name; |
| | | string[] Guanxi = userdata.Guanxi; |
| | | string[] Gongzuodanwei = userdata.Gongzuodanwei; |
| | | |
| | | string[] Filepaths = userdata.Filepath; |
| | | |
| | | if (Filepaths != null && Filepaths.Length > 0) |
| | | { |
| | | for (int i = 0; i < Filepaths.Length; i++) |
| | | for (int i = 0; i < JiatingchengyuanId.Length; i++) |
| | | { |
| | | if (string.IsNullOrEmpty(userdata.attachmentid[i])) |
| | | PltJiatingchengyuanDTO pltJiatingchengyuanDTO = new PltJiatingchengyuanDTO(); |
| | | pltJiatingchengyuanDTO.Id = JiatingchengyuanId[i] == null ? "" : JiatingchengyuanId[i].Trim(); |
| | | pltJiatingchengyuanDTO.UserId = userdata.Id; |
| | | pltJiatingchengyuanDTO.Name = Name[i] == null ? "" : Name[i].Trim(); |
| | | pltJiatingchengyuanDTO.Guanxi = Guanxi[i] == null ? "" : Guanxi[i].Trim(); |
| | | pltJiatingchengyuanDTO.Gongzuodanwei = Gongzuodanwei[i] == null ? "" : Gongzuodanwei[i].Trim(); |
| | | pltJiatingchengyuanDTO.RecStatus = "A"; |
| | | if (String.IsNullOrEmpty(JiatingchengyuanId[i])) |
| | | { |
| | | SysAttachmentDTO sysAttachmentDTO = new SysAttachmentDTO(); |
| | | //sysAttachmentDTO.Id = |
| | | sysAttachmentDTO.AttObj = userdata.AttObj[i]; |
| | | sysAttachmentDTO.AttObjid = userdata.Id; |
| | | sysAttachmentDTO.Filefullname = userdata.Filefullname[i]; |
| | | sysAttachmentDTO.Filepath = userdata.Filepath[i]; |
| | | sysAttachmentDTO.Creater = curentuser.Id; |
| | | sysAttachmentDTO.Modifier = curentuser.Id; |
| | | sysAttachmentDTO.Createtime = DateTime.Now; |
| | | sysAttachmentDTO.Modifytime = sysAttachmentDTO.Createtime; |
| | | |
| | | resultEntity = _sysAttachmentService.save(sysAttachmentDTO); |
| | | if (resultEntity.Result == false) |
| | | { |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | pltJiatingchengyuanDTO.Creater = curentuser.Id; |
| | | pltJiatingchengyuanDTO.Createtime = DateTime.Now; |
| | | } |
| | | |
| | | pltJiatingchengyuanDTO.Modifier = curentuser.Id; |
| | | pltJiatingchengyuanDTO.Modifytime = DateTime.Now; |
| | | resultEntity = _pltJiatingchengyuanService.save(pltJiatingchengyuanDTO); |
| | | if (resultEntity.Result == false) |
| | | { |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | } |
| | | |
| | | string[] Filepaths = userdata.Filepath; |
| | | |
| | | if (Filepaths != null && Filepaths.Length > 0) |
| | | { |
| | | for (int i = 0; i < Filepaths.Length; i++) |
| | | { |
| | | if (string.IsNullOrEmpty(userdata.attachmentid[i])) |
| | | { |
| | | SysAttachmentDTO sysAttachmentDTO = new SysAttachmentDTO(); |
| | | //sysAttachmentDTO.Id = |
| | | sysAttachmentDTO.AttObj = userdata.AttObj[i]; |
| | | sysAttachmentDTO.AttObjid = userdata.Id; |
| | | sysAttachmentDTO.Filefullname = userdata.Filefullname[i]; |
| | | sysAttachmentDTO.Filepath = userdata.Filepath[i]; |
| | | sysAttachmentDTO.Creater = curentuser.Id; |
| | | sysAttachmentDTO.Modifier = curentuser.Id; |
| | | sysAttachmentDTO.Createtime = DateTime.Now; |
| | | sysAttachmentDTO.Modifytime = sysAttachmentDTO.Createtime; |
| | | |
| | | resultEntity = _sysAttachmentService.save(sysAttachmentDTO); |
| | | if (resultEntity.Result == false) |
| | | { |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | scope.Complete(); |
| | | } |
| | | scope.Complete(); |
| | | } |
| | | |
| | | else |
| | | { |
| | | resultEntity.Message = "MAC地址格式错误"; |
| | | } |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | #endregion |