/// <summary> /// 审核标签 /// </summary> /// <param name="Param"></param> /// <returns></returns> public string AuditCode(RequestAudit Param) { Param.AuditName = UserInfo().TrueName; SystemAudit Audit = Param.MapToEntity <SystemAudit>(); if (Insert <SystemAudit>(Audit)) { EnterpriseTagApply TagApply = Kily.Set <EnterpriseTagApply>().Where(t => t.IsDelete == false).Where(t => t.Id == Param.TableId).FirstOrDefault(); TagApply.AuditType = Param.AuditType; TagApply.IsPay = true; List <string> Fields = new List <string>() { "AuditType", "IsPay" }; if (UpdateField <EnterpriseTagApply>(TagApply, null, Fields)) { return(ServiceMessage.HANDLESUCCESS); } else { return(ServiceMessage.HANDLEFAIL); } } else { return(ServiceMessage.INSERTFAIL); } }
public ActionResult Audit(string machineName, string scannedDate, string macAddress) { if ((machineName == null || machineName == "") && (scannedDate == null || scannedDate == "" && (macAddress == null || macAddress == ""))) { SetDropdownList(machineName); SetScannedDate(machineName, scannedDate, macAddress); SetMacAddress(machineName, macAddress); return(RedirectToAction("Index")); } System.Web.HttpContext.Current.Session["ComputerName"] = machineName; System.Web.HttpContext.Current.Session["ScannedDate"] = scannedDate; System.Web.HttpContext.Current.Session["MacAddress"] = macAddress; ViewBag.Machine = machineName; SetDropdownList(machineName); SetScannedDate(machineName, scannedDate, macAddress); SetMacAddress(machineName, macAddress); var Info = db.Auditors.Join(db.SystemInfoes, a => a.ScannedDate, s => s.ScannedDate, (a, s) => new { Technician = a.Technician, Client = a.Client, Site = a.Site, Workstation = a.Workstation, OS = a.OS, MachineName = s.MachineName, ManagementGroup = s.ManagementGroup, DisplayGroup = s.DisplayGroup, PropertyName = s.PropertyName, PropertyValue = s.PropertyValue, ScannedDate = a.ScannedDate, MacAddress = s.MacAddress }).Where(a => a.MachineName == machineName && a.ScannedDate.Replace(" ", string.Empty) == scannedDate.Replace(" ", string.Empty) && a.MacAddress == macAddress).ToList(); var systemaudit = new SystemAuditViewModel(); foreach (var i in Info) { var pc = new SystemAudit(); pc.Technician = i.Technician; pc.Client = i.Client; pc.Site = i.Site; pc.Workstation = i.Workstation; pc.OS = i.OS; pc.MachineName = i.MachineName; pc.ManagementGroup = i.ManagementGroup; pc.DisplayGroup = i.DisplayGroup; pc.PropertyName = i.PropertyName; pc.PropertyValue = i.PropertyValue; pc.ScannedDate = i.ScannedDate; pc.MacAddress = i.MacAddress; systemaudit.SystemAudits.Add(pc); } return(View(systemaudit)); }
/// <summary> /// 审核厨师信息 /// </summary> /// <param name="Param"></param> /// <returns></returns> public string AuditCookInfo(RequestAudit Param) { CookInfo info = Kily.Set <CookInfo>().Where(t => t.Id == Param.TableId).FirstOrDefault(); info.AuditType = Param.AuditType; UpdateField(info, "AuditType"); SystemAudit audit = Param.MapToEntity <SystemAudit>(); return(Insert(audit) ? ServiceMessage.INSERTSUCCESS : ServiceMessage.INSERTFAIL); }
public static void InsertAudit(IUnitOfWork unitOfWork, string process, int user, string action, string detail) { SystemAudit audit = new SystemAudit { Date = DateTime.Now, Process = process, IdUser = user, IdAction = action, Detail = detail }; unitOfWork.SystemAudit.Insert(audit); }
public ActionResult Audit() { var computer = System.Web.HttpContext.Current.Session["ComputerName"] as String; var scanDate = System.Web.HttpContext.Current.Session["ScannedDate"] as String; var macAddress = System.Web.HttpContext.Current.Session["MacAddress"] as String; SetDropdownList(computer); SetScannedDate(computer, scanDate, macAddress); SetMacAddress(computer, macAddress); var systemaudit = new SystemAuditViewModel(); var Info = db.Auditors.Join(db.SystemInfoes, a => a.ScannedDate, s => s.ScannedDate, (a, s) => new { Technician = a.Technician, Client = a.Client, Site = a.Site, Workstation = a.Workstation, OS = a.OS, MachineName = s.MachineName, ManagementGroup = s.ManagementGroup, DisplayGroup = s.DisplayGroup, PropertyName = s.PropertyName, PropertyValue = s.PropertyValue, ScannedDate = a.ScannedDate, MacAddress = s.MacAddress }).ToList(); foreach (var i in Info) { var pc = new SystemAudit(); pc.Technician = i.Technician; pc.Client = i.Client; pc.Site = i.Site; pc.Workstation = i.Workstation; pc.OS = i.OS; pc.MachineName = i.MachineName; pc.ManagementGroup = i.ManagementGroup; pc.DisplayGroup = i.DisplayGroup; pc.PropertyName = i.PropertyName; pc.PropertyValue = i.PropertyValue; pc.ScannedDate = i.ScannedDate; pc.MacAddress = i.MacAddress; systemaudit.SystemAudits.Add(pc); } //var PcInfo = unit.SystemInfoes.Get().Where(m => m.MachineName == computer && // m.ScannedDate.Replace(" ", string.Empty) == scanDate.Replace(" ", string.Empty) && // m.MacAddress == macAddress); ViewBag.Header = string.Empty; return(View(systemaudit)); }
public IActionResult Post([FromBody] SystemAudit SystemAudit) { try { if (!ModelState.IsValid) { return(BadRequest()); } return(Ok(_unitOfWork.SystemAudit.Insert(SystemAudit))); } catch (Exception ex) { return(StatusCode(500, "Internal server error: " + ex.Message)); } }
public IActionResult Put([FromBody] SystemAudit SystemAudit) { try { if (ModelState.IsValid && _unitOfWork.SystemAudit.Update(SystemAudit)) { return(Ok(new { Message = "La auditoría se ha actualizado" })); } else { return(BadRequest()); } } catch (Exception ex) { return(StatusCode(500, "Internal server error: " + ex.Message)); } }
/// <summary> /// 审核认证 /// </summary> /// <param name="Param"></param> /// <returns></returns> public string AuditIdent(RequestAudit Param) { Param.AuditName = UserInfo().TrueName; SystemAudit Audit = Param.MapToEntity <SystemAudit>(); if (Insert <SystemAudit>(Audit)) { RepastIdent Ident = Kily.Set <RepastIdent>().Where(t => t.IsDelete == false).Where(t => t.Id == Param.TableId).FirstOrDefault(); Ident.AuditType = Param.AuditType; if (UpdateField <RepastIdent>(Ident, "AuditType")) { return(ServiceMessage.HANDLESUCCESS); } else { return(ServiceMessage.HANDLEFAIL); } } else { return(ServiceMessage.INSERTFAIL); } }