Esempio n. 1
0
        /// <summary>
        /// 获取作业报告报表的部分字段描述信息
        /// </summary>
        /// <param name="dr">报表所有字段信息</param>
        /// <param name="fieldsInRpt">选取的报表字段</param>
        /// <returns>报表信息</returns>
        public DataRow GetDispatchReportDesc(DataRow dr, List <string> fieldsInRpt)
        {
            if (SQLUtil.ConvertInt(dr["ReportID"]) != 0)
            {
                if (fieldsInRpt.Contains("ReportTypeDesc"))
                {
                    dr["ReportTypeDesc"] = LookupManager.GetDispatchReportType(SQLUtil.ConvertInt(dr["TypeID"])).Name;
                }
                if (fieldsInRpt.Contains("ReportStatusDesc"))
                {
                    dr["ReportStatusDesc"] = LookupManager.GetDispatchDocStatusDesc(SQLUtil.ConvertInt(dr["DispatchReportStatusID"]));
                }
                if (fieldsInRpt.Contains("ServiceProviderDesc"))
                {
                    dr["ServiceProviderDesc"] = DispatchReportInfo.ServiceProviders.GetDescByID(SQLUtil.ConvertInt(dr["ServiceProvider"]));
                }
                if (fieldsInRpt.Contains("ReportEquipmentStatusDesc"))
                {
                    dr["ReportEquipmentStatusDesc"] = LookupManager.GetEquipmentStatusDesc(SQLUtil.ConvertInt(dr["reportEquipmentStatus"]));
                }
                if (fieldsInRpt.Contains("ServiceScopeDesc"))
                {
                    dr["ServiceScopeDesc"] = SQLUtil.ConvertBoolean(dr["ServiceScope"]) ? "是" : "否";
                }
                if (fieldsInRpt.Contains("SolutionResultStatusDesc"))
                {
                    dr["SolutionResultStatusDesc"] = LookupManager.GetSolutionResultStatusDesc(SQLUtil.ConvertInt(dr["SolutionResultStatusID"]));
                }
                if (fieldsInRpt.Contains("ReportIsRecallDesc"))
                {
                    dr["ReportIsRecallDesc"] = SQLUtil.ConvertBoolean(dr["ReportIsRecall"]) ? "是" : "否";
                }


                if (fieldsInRpt.Contains("IsPrivateDesc"))
                {
                    dr["IsPrivateDesc"] = SQLUtil.ConvertBoolean(dr["IsPrivate"]) ? "是" : "否";
                }
            }
            return(dr);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取设备报表的部分字段描述信息
        /// </summary>
        /// <param name="dr">报表所有字段信息</param>
        /// <param name="fieldsInRpt">选取的报表字段</param>
        /// <returns>报表信息</returns>
        public DataRow GetEquipmentDesc(DataRow dr, List <string> fieldsInRpt)
        {
            if (SQLUtil.ConvertInt(dr["EquipmentID"]) != 0)
            {
                if (fieldsInRpt.Contains("EquipmentLevelDesc"))
                {
                    dr["EquipmentLevelDesc"] = (dr["EquipmentLevel"] == null) ? "" : EquipmentInfo.EquipmentLevels.GetEquipmentLevelDesc(SQLUtil.ConvertInt(dr["EquipmentLevel"]));
                }
                if (fieldsInRpt.Contains("ServiceScopeDesc"))
                {
                    dr["ServiceScopeDesc"] = SQLUtil.ConvertBoolean(dr["ServiceScope"]) ? "是" : "否";
                }
                if (fieldsInRpt.Contains("EquipmentClass1Name"))
                {
                    dr["EquipmentClass1Name"] = (SQLUtil.TrimNull(dr["EquipmentClass1"]) == "00" || SQLUtil.TrimNull(dr["EquipmentClass1"]) == null) ? "" : LookupManager.GetEquipmentClassDesc(SQLUtil.TrimNull(dr["EquipmentClass1"]), 1);
                }
                if (fieldsInRpt.Contains("EquipmentClass2Name"))
                {
                    dr["EquipmentClass2Name"] = (SQLUtil.TrimNull(dr["EquipmentClass2"]) == "00") ? "" : LookupManager.GetEquipmentClassDesc(SQLUtil.TrimNull(dr["EquipmentClass2"]), 2, SQLUtil.TrimNull(dr["EquipmentClass1"]));
                }
                if (fieldsInRpt.Contains("EquipmentClass3Name"))
                {
                    dr["EquipmentClass3Name"] = (SQLUtil.TrimNull(dr["EquipmentClass3"]) == "00") ? "" : LookupManager.GetEquipmentClassDesc(SQLUtil.TrimNull(dr["EquipmentClass3"]), 3, SQLUtil.TrimNull(dr["EquipmentClass1"]) + SQLUtil.TrimNull(dr["EquipmentClass2"]));
                }
                if (fieldsInRpt.Contains("DepartmentName"))
                {
                    dr["DepartmentName"] = LookupManager.GetDepartmentDesc(SQLUtil.ConvertInt(dr["DepartmentID"]));
                }
                if (fieldsInRpt.Contains("UsageStatusDesc"))
                {
                    dr["UsageStatusDesc"] = LookupManager.GetUsageStatusDesc(SQLUtil.ConvertInt(dr["UsageStatusID"]));
                }
                if (fieldsInRpt.Contains("EquipmentStatusDesc"))
                {
                    dr["EquipmentStatusDesc"] = LookupManager.GetEquipmentStatusDesc(SQLUtil.ConvertInt(dr["EquipmentStatusID"]));
                }
                if (fieldsInRpt.Contains("MandatoryTestStatusDesc"))
                {
                    dr["MandatoryTestStatusDesc"] = EquipmentInfo.MandatoryTestStatuses.GetMandatoryTestStatusDesc(SQLUtil.ConvertInt(dr["MandatoryTestStatus"]));
                }
                if (fieldsInRpt.Contains("MaintenanceTypeDesc"))
                {
                    dr["MaintenanceTypeDesc"] = LookupManager.GetPeriodTypeDesc(SQLUtil.ConvertInt(dr["MaintenanceTypeID"]));
                }
                if (fieldsInRpt.Contains("PatrolTypeDesc"))
                {
                    dr["PatrolTypeDesc"] = LookupManager.GetPeriodTypeDesc(SQLUtil.ConvertInt(dr["PatrolTypeID"]));
                }
                if (fieldsInRpt.Contains("CorrectionTypeDesc"))
                {
                    dr["CorrectionTypeDesc"] = LookupManager.GetPeriodTypeDesc(SQLUtil.ConvertInt(dr["CorrectionTypeID"]));
                }
                if (fieldsInRpt.Contains("CreateUserName"))
                {
                    dr["CreateUserName"] = (SQLUtil.ConvertInt(dr["CreateUserID"]) == 0) ? "" : this.userDao.GetUser(SQLUtil.ConvertInt(dr["CreateUserID"])).Name;
                }
                if (fieldsInRpt.Contains("WarrantyStatus"))
                {
                    dr["WarrantyStatus"] = SQLUtil.ConvertInt(dr["WarrantyStatusID"]) == 0 ? "保外" : "保内";
                }
            }

            return(dr);
        }