/// <summary> /// 日志信息 /// </summary> /// <param name="newInfo">修改后的信息</param> /// <param name="user">修改者</param> /// <returns>日志信息</returns> public AuditHdrInfo ConvertAudit(FujiClass2Info newInfo, UserInfo user)//DataTable { AuditHdrInfo audit = new AuditHdrInfo(); audit.ObjectType.ID = ObjectTypes.FujiClass2; audit.ObjectID = this.ID; audit.Operation.ID = AuditHdrInfo.AuditOperations.Update; audit.TransUser = user; List <AuditDetailInfo> infos = audit.DetailInfo; if (this.FujiClass1.ID != newInfo.FujiClass1.ID) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2FujiClass1", OldValue = this.FujiClass1.Name, NewValue = newInfo.FujiClass1.Name }); } if (!this.Name.Equals(newInfo.Name)) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Name", OldValue = this.Name, NewValue = newInfo.Name }); } if (!this.Description.Equals(newInfo.Description)) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Description", OldValue = this.Description, NewValue = newInfo.Description }); } if (this.IncludeLabour != newInfo.IncludeLabour) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2IncludeLabour", OldValue = this.IncludeLabour ? "是" : "否", NewValue = newInfo.IncludeLabour ? "是" : "否" }); } if (this.PatrolTimes != newInfo.PatrolTimes) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2PatrolTimes", OldValue = this.PatrolTimes.ToString(), NewValue = newInfo.PatrolTimes.ToString() }); } if (this.PatrolHours != newInfo.PatrolHours) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2PatrolHours", OldValue = this.PatrolHours.ToString(), NewValue = newInfo.PatrolHours.ToString() }); } if (this.MaintenanceTimes != newInfo.MaintenanceTimes) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2MaintenanceTimes", OldValue = this.MaintenanceTimes.ToString(), NewValue = newInfo.MaintenanceTimes.ToString() }); } if (this.MaintenanceHours != newInfo.MaintenanceHours) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2MaintenanceHours", OldValue = this.MaintenanceHours.ToString(), NewValue = newInfo.MaintenanceHours.ToString() }); } if (this.RepairHours != newInfo.RepairHours) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2RepairHours", OldValue = this.RepairHours.ToString(), NewValue = newInfo.RepairHours.ToString() }); } if (this.IncludeContract != newInfo.IncludeContract) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2IncludeContract", OldValue = this.IncludeContract ? "是" : "否", NewValue = newInfo.IncludeContract ? "是" : "否" }); } if (this.FullCoveragePtg != newInfo.FullCoveragePtg) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2FullCoveragePtg", OldValue = this.FullCoveragePtg.ToString(), NewValue = newInfo.FullCoveragePtg.ToString() }); } if (this.TechCoveragePtg != newInfo.TechCoveragePtg) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2TechCoveragePtg", OldValue = this.TechCoveragePtg.ToString(), NewValue = newInfo.TechCoveragePtg.ToString() }); } if (this.IncludeSpare != newInfo.IncludeSpare) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2IncludeSpare", OldValue = this.IncludeSpare ? "是" : "否", NewValue = newInfo.IncludeSpare ? "是" : "否" }); } if (this.SparePrice != newInfo.SparePrice) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2SparePrice", OldValue = this.SparePrice.ToString(), NewValue = newInfo.SparePrice.ToString() }); } if (this.SpareRentPtg != newInfo.SpareRentPtg) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2SpareRentPtg", OldValue = this.SpareRentPtg.ToString(), NewValue = newInfo.SpareRentPtg.ToString() }); } if (this.IncludeRepair != newInfo.IncludeRepair) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2IncludeRepair", OldValue = this.IncludeRepair ? "是" : "否", NewValue = newInfo.IncludeRepair ? "是" : "否" }); } if (this.Usage != newInfo.Usage) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Usage", OldValue = this.Usage.ToString(), NewValue = newInfo.Usage.ToString() }); } if (this.EquipmentType.ID != newInfo.EquipmentType.ID) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2EquipmentType", OldValue = this.EquipmentType.Name, NewValue = LookupManager.GetEquipmentTypeDesc(newInfo.EquipmentType.ID) }); } if (this.RepairComponentCost != newInfo.RepairComponentCost) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2RepairComponentCost", OldValue = this.RepairComponentCost.ToString(), NewValue = newInfo.RepairComponentCost.ToString() }); } if (this.Repair3partyRatio != newInfo.Repair3partyRatio) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Repair3partyRatio", OldValue = this.Repair3partyRatio.ToString(), NewValue = newInfo.Repair3partyRatio.ToString() }); } if (this.Repair3partyCost != newInfo.Repair3partyCost) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Repair3partyCost", OldValue = this.Repair3partyCost.ToString(), NewValue = newInfo.Repair3partyCost.ToString() }); } if (this.RepairCostRatio != newInfo.RepairCostRatio) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2RepairCostRatio", OldValue = this.RepairCostRatio.ToString(), NewValue = newInfo.RepairCostRatio.ToString() }); } if (this.MethodID != newInfo.MethodID) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2MethodID", OldValue = this.MethodID.GetDescription(), NewValue = newInfo.MethodID.GetDescription() }); } return(audit); }
/// <summary> /// 耗材修改日志 /// </summary> /// <param name="newInfo">修改后的耗材信息</param> /// <param name="user">操作者</param> /// <returns>日志信息</returns> public AuditHdrInfo ConvertAudit(ConsumableInfo newInfo, UserInfo user) { AuditHdrInfo audit = new AuditHdrInfo(); audit.ObjectType.ID = ObjectTypes.Consumable; audit.ObjectID = this.ID; audit.Operation.ID = AuditHdrInfo.AuditOperations.Update; audit.TransUser = user; List <AuditDetailInfo> infos = audit.DetailInfo; if (this.FujiClass2.ID != newInfo.FujiClass2.ID) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableFujiClass2", OldValue = this.FujiClass2.Name, NewValue = newInfo.FujiClass2.Name }); } if (this.Name != SQLUtil.TrimNull(newInfo.Name)) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableName", OldValue = this.Name, NewValue = newInfo.Name }); } if (this.Description != SQLUtil.TrimNull(newInfo.Description)) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableDescription", OldValue = this.Description, NewValue = newInfo.Description }); } if (this.Type.ID != newInfo.Type.ID) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableType", OldValue = this.Type.Name, NewValue = newInfo.Type.Name }); } if (this.ReplaceTimes != newInfo.ReplaceTimes) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableReplaceTimes", OldValue = this.ReplaceTimes.ToString(), NewValue = newInfo.ReplaceTimes.ToString() }); } if (this.CostPer != newInfo.CostPer) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableCostPer", OldValue = this.CostPer.ToString(), NewValue = newInfo.CostPer.ToString() }); } if (this.StdPrice != newInfo.StdPrice) { infos.Add(new AuditDetailInfo() { FieldName = "CompomemtStdPrice", OldValue = this.StdPrice.ToString(), NewValue = newInfo.StdPrice.ToString() }); } if (this.IsIncluded != newInfo.IsIncluded) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableIsIncluded", OldValue = this.IsIncluded ? "是" : "否", NewValue = newInfo.IsIncluded ? "是" : "否" }); } if (this.IncludeContract != newInfo.IncludeContract) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableIncludeContract", OldValue = this.IncludeContract ? "是" : "否", NewValue = newInfo.IncludeContract ? "是" : "否", }); } if (this.IsActive != newInfo.IsActive) { infos.Add(new AuditDetailInfo() { FieldName = "ConsumableIsActive", OldValue = this.IsActive ? "是" : "否", NewValue = newInfo.IsActive ? "是" : "否" }); } return(audit); }
/// <summary> /// 更新日志 /// </summary> /// <param name="newInfo">修改后的零件信息</param> /// <param name="user">操作者</param> /// <returns>日志信息</returns> public AuditHdrInfo ConvertAudit(ComponentInfo newInfo, UserInfo user) { AuditHdrInfo audit = new AuditHdrInfo(); audit.ObjectType.ID = ObjectTypes.Component; audit.ObjectID = this.ID; audit.Operation.ID = AuditHdrInfo.AuditOperations.Update; audit.TransUser = user; List <AuditDetailInfo> infos = audit.DetailInfo; if (this.FujiClass2.ID != newInfo.FujiClass2.ID) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentFujiClass2", OldValue = this.FujiClass2.Name, NewValue = newInfo.FujiClass2.Name }); } if (this.Name != SQLUtil.TrimNull(newInfo.Name)) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentName", OldValue = this.Name, NewValue = newInfo.Name }); } if (this.Description != SQLUtil.TrimNull(newInfo.Description)) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentDescription", OldValue = this.Description, NewValue = newInfo.Description }); } if (this.Type.ID != newInfo.Type.ID) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentType", OldValue = this.Type.Name, NewValue = LookupManager.GetComponentTypeDesc(newInfo.Type.ID) }); } if (this.StdPrice != newInfo.StdPrice) { infos.Add(new AuditDetailInfo() { FieldName = "CompomemtStdPrice", OldValue = this.StdPrice.ToString(), NewValue = newInfo.StdPrice.ToString() }); } if (this.Usage != newInfo.Usage) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentUsage", OldValue = this.Usage.ToString(), NewValue = newInfo.Usage.ToString() }); } if (this.Method != newInfo.Method) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentMethodID", OldValue = this.Method.GetDescription(), NewValue = newInfo.Method.GetDescription() }); } if (this.TotalSeconds != newInfo.TotalSeconds) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentTotalSeconds", OldValue = this.TotalSeconds.ToString(), NewValue = newInfo.TotalSeconds.ToString() }); } if (this.SecondsPer != newInfo.SecondsPer) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentSecondsPer", OldValue = this.SecondsPer.ToString(), NewValue = newInfo.SecondsPer.ToString() }); } if (this.IsIncluded != newInfo.IsIncluded) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentIsIncluded", OldValue = this.IsIncluded ? "是" : "否", NewValue = newInfo.IsIncluded ? "是" : "否" }); } if (this.IncludeContract != newInfo.IncludeContract) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentIncludeContract", OldValue = this.IncludeContract ? "是" : "否", NewValue = newInfo.IncludeContract ? "是" : "否", }); } if (this.IsActive != newInfo.IsActive) { infos.Add(new AuditDetailInfo() { FieldName = "ComponentIsActive", OldValue = this.IsActive ? "是" : "否", NewValue = newInfo.IsActive ? "是" : "否" }); } return(audit); }
/// <summary> /// 日志信息 /// </summary> /// <param name="user">修改者</param> /// <param name="newInfo">修改后的关联信息</param> /// <returns>日志信息</returns> public AuditHdrInfo ConvertAudit(UserInfo user, FujiClassLink newInfo = null) { bool isUpdate = newInfo != null; AuditHdrInfo audit = new AuditHdrInfo(); audit.ObjectType.ID = ObjectTypes.FujiClass2; audit.ObjectID = this.FujiClass2.ID; audit.Operation.ID = isUpdate ? AuditHdrInfo.AuditOperations.Update : AuditHdrInfo.AuditOperations.Add; audit.TransUser = user; List <AuditDetailInfo> infos = audit.DetailInfo; if (isUpdate) { if (this.EquipmentType1.Code.Equals(newInfo.EquipmentType1.Code)) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Equipment1", OldValue = this.EquipmentType1.Code, NewValue = newInfo.EquipmentType1.Code }); } if (this.EquipmentType2.Code.Equals(newInfo.EquipmentType2.Code)) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Equipment2", OldValue = this.EquipmentType2.Code, NewValue = newInfo.EquipmentType2.Code }); } if (this.FujiClass2.FujiClass1.ID != newInfo.FujiClass2.FujiClass1.ID) { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2FujiClass1", OldValue = this.FujiClass2.FujiClass1.Name, NewValue = newInfo.FujiClass2.FujiClass1.Name }); } } else { infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Equipment1", OldValue = "", NewValue = this.EquipmentType1.Description }); infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Equipment2", OldValue = "", NewValue = this.EquipmentType2.Description }); infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2FujiClass1", OldValue = "", NewValue = this.FujiClass2.FujiClass1.Name }); infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Name", OldValue = "", NewValue = this.FujiClass2.Name }); infos.Add(new AuditDetailInfo() { FieldName = "FujiClass2Description", OldValue = "", NewValue = this.FujiClass2.Description }); } return(audit); }