Example #1
0
        /// <summary>
        /// 保存科室信息
        /// </summary>
        /// <param name="info">科室信息</param>
        /// <returns>科室id</returns>
        public int SaveDepartment(DepartmentInfo info)
        {
            if (info.ID >= 0)
            {
                DepartmentInfo existingInfo = this.departmentDao.GetDepartmentByID(info.ID);
                if (existingInfo.Seq > info.Seq)
                {
                    this.departmentDao.UpdateDepartmentSeq(info.Seq, existingInfo.Seq, 1);
                }
                else if (existingInfo.Seq < info.Seq)
                {
                    this.departmentDao.UpdateDepartmentSeq(existingInfo.Seq, info.Seq, -1);
                }

                this.departmentDao.UpdateDepartment(info);
            }
            else
            {
                this.departmentDao.UpdateDepartmentSeq(info.Seq, Int16.MaxValue, 1);

                info.ID = this.departmentDao.AddDepartment(info);
            }

            LookupManager.RecacheDepartments();

            return(info.ID);
        }
Example #2
0
        /// <summary>
        /// 获取派工单报表的部分字段描述信息
        /// </summary>
        /// <param name="dr">报表所有字段信息</param>
        /// <param name="fieldsInRpt">选取的报表字段</param>
        /// <returns>报表信息</returns>
        public DataRow GetDispatchDesc(DataRow dr, List <string> fieldsInRpt)
        {
            if (SQLUtil.ConvertInt(dr["DisID"]) != 0)
            {
                if (fieldsInRpt.Contains("DispatchTypeDesc"))
                {
                    dr["DispatchTypeDesc"] = LookupManager.GetRequestTypeDesc(SQLUtil.ConvertInt(dr["DispatchRequestType"]));
                }
                if (fieldsInRpt.Contains("UrgencyDesc"))
                {
                    dr["UrgencyDesc"] = LookupManager.GetUrgencyDesc(SQLUtil.ConvertInt(dr["UrgencyID"]));
                }
                if (fieldsInRpt.Contains("MachineStatusDesc"))
                {
                    dr["MachineStatusDesc"] = MachineStatuses.GetMachineStatusesDesc(SQLUtil.ConvertInt(dr["EquipmentStatus"]));
                }
                if (fieldsInRpt.Contains("EngineerName"))
                {
                    dr["EngineerName"] = (SQLUtil.ConvertInt(dr["EngineerID"]) == 0) ? "" : (this.userDao.GetUser(SQLUtil.ConvertInt(dr["EngineerID"])) == null ? "" : this.userDao.GetUser(SQLUtil.ConvertInt(dr["EngineerID"])).Name);
                }
                if (fieldsInRpt.Contains("DispatchStatusDesc"))
                {
                    dr["DispatchStatusDesc"] = LookupManager.GetDispatchStatusDesc(SQLUtil.ConvertInt(dr["DispatchStatusID"]));
                }
            }

            return(dr);
        }
Example #3
0
        /// <summary>
        /// 获取合同报表的部分字段描述信息
        /// </summary>
        /// <param name="dr">报表所有字段信息</param>
        /// <param name="fieldsInRpt">选取的报表字段</param>
        /// <returns>报表信息</returns>
        public DataRow GetContractDesc(DataRow dr, List <string> fieldsInRpt)
        {
            if (fieldsInRpt.Contains("TypeDesc"))
            {
                dr["TypeDesc"] = LookupManager.GetContractTypeDesc(SQLUtil.ConvertInt(dr["TypeID"]));
            }
            if (fieldsInRpt.Contains("ScopeDesc"))
            {
                dr["ScopeDesc"] = LookupManager.GetContractScopeDesc(SQLUtil.ConvertInt(dr["ScopeID"]));
            }

            return(dr);
        }
Example #4
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);
        }
Example #5
0
        /// <summary>
        /// 获取下载附件时的文件名
        /// </summary>
        /// <param name="info">附件信息</param>
        /// <returns>格式化后的附件名</returns>
        public string GetDownloadFileName(UploadFileInfo info)
        {
            string name = info.GetDisplayFileName();

            if (name == "")
            {
                return(info.FileName);
            }

            if (ObjectTypes.Equipment.Equals(info.ObjectTypeId))
            {
                EquipmentInfo equipmentInfo = this.equipmentDao.GetEquipmentByID(info.ObjectID);
                name = string.Format("{0}_{1}", name, equipmentInfo.AssetCode);
            }
            else
            {
                name = string.Format("{0}_{1}", LookupManager.GetObjectOID(info.ObjectTypeId, info.ObjectID), name);
            }

            return(name + new FileInfo(info.FileName).Extension);
        }
Example #6
0
        /// <summary>
        /// 获取合同报表的部分字段描述信息
        /// </summary>
        /// <param name="dr">报表所有字段信息</param>
        /// <param name="fieldsInRpt">选取的报表字段</param>
        /// <returns>报表信息</returns>
        public DataRow GetContractDesc(DataRow dr, List <string> fieldsInRpt)
        {
            if (fieldsInRpt.Contains("TypeDesc"))
            {
                dr["TypeDesc"] = LookupManager.GetContractTypeDesc(SQLUtil.ConvertInt(dr["TypeID"]));
            }
            if (fieldsInRpt.Contains("ScopeDesc"))
            {
                dr["ScopeDesc"] = LookupManager.GetContractScopeDesc(SQLUtil.ConvertInt(dr["ScopeID"]));
            }
            if (fieldsInRpt.Contains("SupplierType"))
            {
                dr["SupplierType"] = LookupManager.GetSupplierTypeDesc(SQLUtil.ConvertInt(dr["SupplierTypeID"]));
            }
            if (fieldsInRpt.Contains("SupplierStatus"))
            {
                dr["SupplierStatus"] = SQLUtil.ConvertBoolean(dr["SupplierStatusID"]) ? "启用" : "停用";
            }

            return(dr);
        }
Example #7
0
        /// <summary>
        /// 获取服务凭证报表的部分字段描述信息
        /// </summary>
        /// <param name="dr">报表所有字段信息</param>
        /// <param name="fieldsInRpt">选取的报表字段</param>
        /// <returns>报表信息</returns>
        public DataRow GetDispatchJournalDesc(DataRow dr, List <string> fieldsInRpt)
        {
            if (SQLUtil.ConvertInt(dr["JournalID"]) != 0)
            {
                if (fieldsInRpt.Contains("ResultStatusDesc"))
                {
                    dr["ResultStatusDesc"] = LookupManager.GetDispatchJournalResultStatusDesc(SQLUtil.ConvertInt(dr["ResultStatusID"]));
                }
                if (fieldsInRpt.Contains("SignedDesc"))
                {
                    dr["SignedDesc"] = (SQLUtil.ConvertInt(dr["JournalID"]) > 0) ? (SQLUtil.ConvertBoolean(dr["Signed"]) ? "是" : "否") : "";
                }
                if (fieldsInRpt.Contains("JournalStatusDesc"))
                {
                    dr["JournalStatusDesc"] = LookupManager.GetDispatchDocStatusDesc(SQLUtil.ConvertInt(dr["DispatchJournalStatusID"]));
                }
            }


            return(dr);
        }
Example #8
0
        /// <summary>
        /// 获取请求报表的部分字段描述信息
        /// </summary>
        /// <param name="dr">报表所有字段信息</param>
        /// <param name="fieldsInRpt">选取的报表字段</param>
        /// <returns>报表信息</returns>
        public DataRow GetRequestDesc(DataRow dr, List <string> fieldsInRpt)
        {
            if (SQLUtil.ConvertInt(dr["RequestID"]) != 0)
            {
                if (fieldsInRpt.Contains("RequestTypeDesc"))
                {
                    dr["RequestTypeDesc"] = LookupManager.GetRequestTypeDesc(SQLUtil.ConvertInt(dr["RequestType"]));
                }
                if (fieldsInRpt.Contains("SourceDesc"))
                {
                    dr["SourceDesc"] = RequestInfo.Sources.GetSourceDesc(SQLUtil.ConvertInt(dr["Source"]));
                }
                if (fieldsInRpt.Contains("FaultTypeDesc"))
                {
                    dr["FaultTypeDesc"] = RequestInfo.GetDescFaultType(SQLUtil.ConvertInt(dr["RequestType"]), SQLUtil.ConvertInt(dr["FaultTypeID"]));
                }
                if (fieldsInRpt.Contains("RequestStatusID"))
                {
                    dr["RequestStatusID"] = LookupManager.GetRequestStatusDesc(SQLUtil.ConvertInt(dr["StatusID"]));
                }
                if (fieldsInRpt.Contains("DealTypeDesc"))
                {
                    dr["DealTypeDesc"] = LookupManager.GetDealTypeDesc(SQLUtil.ConvertInt(dr["DealTypeID"]));
                }
                if (fieldsInRpt.Contains("PriorityDesc"))
                {
                    dr["PriorityDesc"] = LookupManager.GetUrgencyDesc(SQLUtil.ConvertInt(dr["PriorityID"]));
                }
                if (fieldsInRpt.Contains("IsRecallDesc"))
                {
                    dr["IsRecallDesc"] = SQLUtil.ConvertBoolean(dr["RequestIsRecall"]) ? "是" : "否";
                }
            }

            return(dr);
        }
Example #9
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);
        }