Esempio n. 1
0
        /// <summary>
        /// 获取静态常量(因用于手机测试服务器地址,取消session检测)
        /// </summary>
        /// <returns>静态常量</returns>
        public JsonResult GetConstants()
        {
            ServiceResultModel <Dictionary <string, List <KeyValueInfo> > > result = new ServiceResultModel <Dictionary <string, List <KeyValueInfo> > >();

            try
            {
                //if (!CheckSessionID(userID, sessionID, result)) return MyJson(result, JsonRequestBehavior.AllowGet);
                Dictionary <string, List <KeyValueInfo> > dic = new Dictionary <string, List <KeyValueInfo> >();

                dic.Add("UserRole", LookupManager.GetRoles());
                dic.Add("AssetsLevel", EquipmentInfo.AssetLevels.GetAssetLevels());
                dic.Add("ContractScope", LookupManager.GetContractScope());
                dic.Add("SolutionStatus", LookupManager.GetSolutionResultStatus());
                dic.Add("ReportStatus", LookupManager.GetDispatchDocStatus());
                dic.Add("AccessorySourceType", LookupManager.GetAccessorySourceType());
                dic.Add("AccessoryFileType", ReportComponentInfo.FileTypes.GetFileName());
                dic.Add("RequestType", LookupManager.GetRequestTypes());
                dic.Add("RequestStatus", LookupManager.GetRequestStatus());
                dic.Add("DealType", LookupManager.GetDealType());
                dic.Add("PriorityID", LookupManager.GetUrgency());
                dic.Add("FaultRepair", LookupManager.GetFaultType());
                dic.Add("FaultMaintain", RequestInfo.MaintainType.GetMaintainType());
                dic.Add("FaultCheck", RequestInfo.InspectionType.GetInspectionType());
                dic.Add("MachineStatus", MachineStatuses.GetMachineStatuses());
                dic.Add("FaultBad", RequestInfo.AdverseEventType.GetAdverseEventType());
                dic.Add("ServiceProviders", DispatchReportInfo.ServiceProviders.GetServiceProviders());
                dic.Add("UrgencyID", LookupManager.GetUrgency());
                dic.Add("EquipmentStatus", LookupManager.GetEquipmentStatus());
                dic.Add("DispatchStatus", LookupManager.GetDispatchStatus());
                dic.Add("ResultStatusID", LookupManager.GetDispatchJournalResultStatus());
                dic.Add("JournalStatusID", LookupManager.GetDispatchDocStatus());
                dic.Add("SupplierType", LookupManager.GetSupplierType());
                dic.Add("UsageStatus", LookupManager.GetUsageStatus());
                dic.Add("PeriodType", LookupManager.GetPeriodType());
                dic.Add("ContractType", LookupManager.GetContractType());
                dic.Add("EquipmentLevel", EquipmentInfo.EquipmentLevels.GetEquipmentLevels());
                dic.Add("MandatoryTestStatus", EquipmentInfo.MandatoryTestStatuses.GetMandatoryTestStatuses());
                dic.Add("Source", RequestInfo.Sources.GetSource());
                dic.Add("ComponentStatus", LookupManager.GetComponentType());
                dic.Add("ConsumableStatus", LookupManager.GetConsumableType());
                dic.Add("InvComponentStatus", InvComponentInfo.ComponentStatus.GetComponentStatus());
                dic.Add("InvServiceStatus", InvServiceInfo.Statuses.GetStatuses());
                dic.Add("InvSpareStatus", InvSpareInfo.SpareStatus.GetSpareStatus());
                dic.Add("PurchaseOrderStatus", LookupManager.GetPurchaseOrderStatus());

                result.Data = dic;
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(MyJson(result, JsonRequestBehavior.AllowGet));
        }