/// <summary> /// 估价执行:零件清单Info /// </summary> /// <param name="dr">数据</param> public ValComponentInfo(DataRow dr) : this() { this.User.ID = SQLUtil.ConvertInt(dr["UserID"]); this.User.Name = SQLUtil.TrimNull(dr["UserName"]); this.InSystem = SQLUtil.ConvertBoolean(dr["InSystem"]); this.Equipment.ID = SQLUtil.ConvertInt(dr["EquipmentID"]); this.Equipment.Name = SQLUtil.TrimNull(dr["Name"]); this.Equipment.AssetCode = SQLUtil.TrimNull(dr["AssetCode"]); this.EquipmentType.ID = SQLUtil.ConvertInt(dr["EquipmentType"]); this.EquipmentType.Name = LookupManager.GetEquipmentTypeDesc(this.EquipmentType.ID); this.Equipment.FujiClass2.Name = SQLUtil.TrimNull(dr["FujiClass2Name"]); this.Component.ID = SQLUtil.ConvertInt(dr["ComponentID"]); this.Component.Name = this.Component.ID == 0 ? ComponentType.WholeMachine : SQLUtil.TrimNull(dr["ComponentName"]); this.Component.Type.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.Component.StdPrice = SQLUtil.ConvertDouble(dr["StdPrice"]); this.Component.SecondsPer = SQLUtil.ConvertDouble(dr["SecondsPer"]); this.Component.TotalSeconds = SQLUtil.ConvertInt(dr["TotalSeconds"]); this.Component.Usage = SQLUtil.ConvertInt(dr["ComponentUsage"]); this.Qty = SQLUtil.ConvertInt(dr["Qty"]); this.Usage = SQLUtil.ConvertInt(dr["Usage"]); this.Seconds = SQLUtil.ConvertDouble(dr["Seconds"]); this.UsedSeconds = SQLUtil.ConvertDouble(dr["UsedSeconds"]); this.IncludeContract = SQLUtil.ConvertBoolean(dr["IncludeContract"]); this.UsageRefere = SQLUtil.ConvertInt(dr["UsageRefere"]); if (dr.Table.Columns.Contains("UseageDate")) { this.UseageDate = SQLUtil.ConvertDateTime(dr["UseageDate"]); } }
/// <summary> /// 估价执行条件:设备清单Info /// </summary> /// <param name="dr"></param> public ValEquipmentInfo(DataRow dr) : this() { this.User.ID = SQLUtil.ConvertInt(dr["UserID"]); this.User.Name = SQLUtil.TrimNull(dr["UserName"]); this.Equipment.ID = SQLUtil.ConvertInt(dr["EquipmentID"]); this.Equipment.AssetCode = SQLUtil.TrimNull(dr["AssetCode"]); this.Equipment.Name = SQLUtil.TrimNull(dr["Name"]); this.Equipment.SerialCode = SQLUtil.TrimNull(dr["SerialCode"]); this.Equipment.Manufacturer.Name = SQLUtil.TrimNull(dr["Manufacturer"]); this.Equipment.FujiClass2.ID = SQLUtil.ConvertInt(dr["FujiClass2ID"]); this.Equipment.FujiClass2.Name = SQLUtil.TrimNull(dr["FujiClass2Name"]); this.Equipment.FujiClass2.FujiClass1.ID = SQLUtil.ConvertInt(dr["FujiClass1ID"]); this.Equipment.FujiClass2.FujiClass1.Name = SQLUtil.TrimNull(dr["FujiClass1Name"]); if (dr.Table.Columns.Contains("EquipmentTypeID")) { this.Equipment.FujiClass2.EquipmentType.ID = SQLUtil.ConvertInt(dr["EquipmentTypeID"]); this.Equipment.FujiClass2.EquipmentType.Name = LookupManager.GetEquipmentTypeDesc(this.Equipment.FujiClass2.EquipmentType.ID); } if (dr.Table.Columns.Contains("FullCoveragePtg")) { this.Equipment.FujiClass2.FullCoveragePtg = SQLUtil.ConvertDouble(dr["FullCoveragePtg"]); } if (dr.Table.Columns.Contains("TechCoveragePtg")) { this.Equipment.FujiClass2.TechCoveragePtg = SQLUtil.ConvertDouble(dr["TechCoveragePtg"]); } this.Equipment.Department.Name = SQLUtil.TrimNull(dr["Department"]); this.Equipment.PurchaseAmount = SQLUtil.ConvertDouble(dr["PurchaseAmount"]); this.Equipment.UseageDate = SQLUtil.ConvertDateTime(dr["UseageDate"]); this.CurrentScope.ID = SQLUtil.ConvertInt(dr["CurrentScopeID"]); this.CurrentScope.Name = ScopeTypes.GetScopeDesc(this.CurrentScope.ID); this.NextScope.ID = SQLUtil.ConvertInt(dr["NextScopeID"]); this.NextScope.Name = ScopeTypes.GetScopeDesc(this.NextScope.ID); this.EndDate = SQLUtil.ConvertDateTime(dr["EndDate"]); this.InSystem = SQLUtil.ConvertBoolean(dr["InSystem"]); this.PatrolHours = SQLUtil.ConvertDouble(dr["PatrolHours"]); this.MaintenanceHours = SQLUtil.ConvertDouble(dr["MaintenanceHours"]); this.RepairHours = SQLUtil.ConvertDouble(dr["RepairHours"]); }
/// <summary> /// 富士II类info /// </summary> /// <param name="dr">dr</param> public FujiClass2Info(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.Name = SQLUtil.TrimNull(dr["Name"]); this.Description = SQLUtil.TrimNull(dr["Description"]); this.FujiClass1.ID = SQLUtil.ConvertInt(dr["FujiClass1ID"]); if (dr.Table.Columns.Contains("FujiClass1Name")) { this.FujiClass1.Name = SQLUtil.TrimNull(dr["FujiClass1Name"]); } this.IncludeLabour = SQLUtil.ConvertBoolean(dr["IncludeLabour"]); this.PatrolTimes = SQLUtil.ConvertDouble(dr["PatrolTimes"]); this.PatrolHours = SQLUtil.ConvertDouble(dr["PatrolHours"]); this.MaintenanceTimes = SQLUtil.ConvertDouble(dr["MaintenanceTimes"]); this.MaintenanceHours = SQLUtil.ConvertDouble(dr["MaintenanceHours"]); this.RepairHours = SQLUtil.ConvertDouble(dr["RepairHours"]); this.IncludeContract = SQLUtil.ConvertBoolean(dr["IncludeContract"]); this.FullCoveragePtg = SQLUtil.ConvertDouble(dr["FullCoveragePtg"]); this.TechCoveragePtg = SQLUtil.ConvertDouble(dr["TechCoveragePtg"]); this.IncludeSpare = SQLUtil.ConvertBoolean(dr["IncludeSpare"]); this.SparePrice = SQLUtil.ConvertDouble(dr["SparePrice"]); this.SpareRentPtg = SQLUtil.ConvertDouble(dr["SpareRentPtg"]); this.IncludeRepair = SQLUtil.ConvertBoolean(dr["IncludeRepair"]); this.Usage = SQLUtil.ConvertInt(dr["Usage"]); this.EquipmentType.ID = SQLUtil.ConvertInt(dr["EquipmentType"]); this.EquipmentType.Name = LookupManager.GetEquipmentTypeDesc(this.EquipmentType.ID); this.RepairComponentCost = SQLUtil.ConvertDouble(dr["RepairComponentCost"]); this.Repair3partyRatio = SQLUtil.ConvertDouble(dr["Repair3partyRatio"]); this.Repair3partyCost = SQLUtil.ConvertDouble(dr["Repair3partyCost"]); this.RepairCostRatio = SQLUtil.ConvertDouble(dr["RepairCostRatio"]); this.MethodID = SQLUtil.ConvertEnum <Method>(dr["MethodID"]); this.AddDate = SQLUtil.ConvertDateTime(dr["AddDate"]); this.UpdateDate = SQLUtil.ConvertDateTime(dr["UpdateDate"]); }
/// <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); }