/// <summary> /// 获取作业报告信息 /// </summary> /// <param name="dr">The dr.</param> public DispatchReportInfo(DataRow dr) : this() { this.ID = SQLUtil.ConvertInt(dr["ID"]); this.Dispatch.ID = SQLUtil.ConvertInt(dr["DispatchID"]); this.Type.ID = SQLUtil.ConvertInt(dr["TypeID"]); this.Type = LookupManager.GetDispatchReportType(this.Type.ID); this.FaultCode = SQLUtil.TrimNull(dr["FaultCode"]); this.FaultDesc = SQLUtil.TrimNull(dr["FaultDesc"]); this.SolutionCauseAnalysis = SQLUtil.TrimNull(dr["SolutionCauseAnalysis"]); this.SolutionWay = SQLUtil.TrimNull(dr["SolutionWay"]); this.IsPrivate = SQLUtil.ConvertBoolean(dr["IsPrivate"]); this.ServiceProvider.ID = SQLUtil.ConvertInt(dr["ServiceProvider"]); this.ServiceProvider.Name = ServiceProviders.GetDescByID(this.ServiceProvider.ID); this.SolutionResultStatus.ID = SQLUtil.ConvertInt(dr["SolutionResultStatusID"]); this.SolutionResultStatus.Name = LookupManager.GetSolutionResultStatusDesc(this.SolutionResultStatus.ID); this.SolutionUnsolvedComments = SQLUtil.TrimNull(dr["SolutionUnsolvedComments"]); this.DelayReason = SQLUtil.TrimNull(dr["DelayReason"]); this.Comments = SQLUtil.TrimNull(dr["Comments"]); this.FujiComments = SQLUtil.TrimNull(dr["FujiComments"]); this.Status.ID = SQLUtil.ConvertInt(dr["StatusID"]); this.Status.Name = LookupManager.GetDispatchDocStatusDesc(this.Status.ID); this.PurchaseAmount = SQLUtil.ConvertDouble(dr["PurchaseAmount"]); this.ServiceScope = SQLUtil.ConvertBoolean(dr["ServiceScope"]); this.ServiceScope = SQLUtil.ConvertBoolean(dr["ServiceScope"]); this.Result = SQLUtil.TrimNull(dr["Result"]); this.IsRecall = SQLUtil.ConvertBoolean(dr["IsRecall"]); this.AcceptanceDate = SQLUtil.ConvertDateTime(dr["AcceptanceDate"]); this.EquipmentStatus.ID = SQLUtil.ConvertInt(dr["EquipmentStatus"]); this.EquipmentStatus.Name = MachineStatuses.GetMachineStatusesDesc(this.EquipmentStatus.ID); }
/// <summary> /// 根据派工类型获取作业报告类型信息 /// </summary> /// <param name="requestTypeId">派工类型编号</param> /// <returns>作业报告类型信息</returns> public static KeyValueInfo GetDispatchReportType(int requestTypeId) { int reportTypeId; switch (requestTypeId) { case RequestInfo.RequestTypes.Repair: reportTypeId = DispatchReportTypes.Repair; break; case RequestInfo.RequestTypes.Maintain: reportTypeId = DispatchReportTypes.Maintenance; break; case RequestInfo.RequestTypes.Inspection: reportTypeId = DispatchReportTypes.MandatoryInspection; break; case RequestInfo.RequestTypes.OnSiteInspection: reportTypeId = DispatchReportTypes.RegularParol; break; case RequestInfo.RequestTypes.Correcting: reportTypeId = DispatchReportTypes.Correcting; break; case RequestInfo.RequestTypes.AddEquipment: reportTypeId = DispatchReportTypes.AddEquipment; break; case RequestInfo.RequestTypes.AdverseEvent: reportTypeId = DispatchReportTypes.AdverseEvent; break; case RequestInfo.RequestTypes.Accetance: reportTypeId = DispatchReportTypes.Accetance; break; default: reportTypeId = DispatchReportTypes.Common; break; } return(LookupManager.GetDispatchReportType(reportTypeId)); }
/// <summary> /// 根据派工类型编号获取可选作业报告类型信息 /// </summary> /// <param name="requestTypeId">派工类型编号</param> /// <returns>可选作业报告类型信息</returns> public static List <KeyValueInfo> GetDispatchReportTypes(int requestTypeId) { List <KeyValueInfo> reportTypes = new List <KeyValueInfo>(); reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.Common)); switch (requestTypeId) { case RequestInfo.RequestTypes.Repair: reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.Repair)); break; case RequestInfo.RequestTypes.Maintain: reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.Maintenance)); break; case RequestInfo.RequestTypes.Inspection: reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.MandatoryInspection)); break; case RequestInfo.RequestTypes.OnSiteInspection: reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.RegularParol)); break; case RequestInfo.RequestTypes.Correcting: reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.Correcting)); break; case RequestInfo.RequestTypes.AddEquipment: reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.AddEquipment)); break; case RequestInfo.RequestTypes.AdverseEvent: reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.AdverseEvent)); break; case RequestInfo.RequestTypes.Accetance: reportTypes.Add(LookupManager.GetDispatchReportType(DispatchReportTypes.Accetance)); break; } return(reportTypes); }