From cde8e39af247a41f8daeda0c3d9689c6a790aa7a Mon Sep 17 00:00:00 2001 From: Tsanie Lily Date: Thu, 30 Apr 2020 09:42:07 +0800 Subject: [PATCH] add asset list --- .../InspectionBasePage.cs | 55 ++++++++++++++----- Site | 2 +- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/IronIntelContractorSiteLib/InspectionBasePage.cs b/IronIntelContractorSiteLib/InspectionBasePage.cs index dcfb8ad..da0b44c 100644 --- a/IronIntelContractorSiteLib/InspectionBasePage.cs +++ b/IronIntelContractorSiteLib/InspectionBasePage.cs @@ -90,6 +90,9 @@ namespace IronIntel.Contractor.Site case "GetInspectionReportForEdit": result = GetInspectionReportForEdit(); break; + case "GetAssetBasicInfoForEdit": + result = GetAssetBasicInfoForEdit(); + break; } } } @@ -251,7 +254,7 @@ namespace IronIntel.Contractor.Site ir.Asset = aclient.GetAssetBasicInfoByID(companyId, ir.AssetId); } // list - bool hasAsset = false; + //bool hasAsset = false; bool hasEmail = false; bool hasJobsite = false; foreach (var p in report.Template.Pages) @@ -262,11 +265,12 @@ namespace IronIntel.Contractor.Site { if (q.QuestionType == QuestionTypes.DropDown) { - if (q.LookupSource == LookupSources.Assets) - { - hasAsset = true; - } - else if (q.LookupSource == LookupSources.Employee) + //if (q.LookupSource == LookupSources.Assets) + //{ + // hasAsset = true; + //} + //else + if (q.LookupSource == LookupSources.Employee) { hasEmail = true; } @@ -282,16 +286,16 @@ namespace IronIntel.Contractor.Site } } } - //if (hasEmail) + if (hasEmail) { ir.EmailList = aic.GetInspectEmailList(companyId, string.Empty); } - if (hasAsset) - { - var ac = CreateClient(); - ir.AssetList = ac.GetAssetBasicInfoByUser(companyId, string.Empty, session.User.UID); - } - //if (hasJobsite) + //if (hasAsset) + //{ + // var ac = CreateClient(); + // ir.AssetList = ac.GetAssetBasicInfoByUser(companyId, string.Empty, session.User.UID); + //} + if (hasJobsite) { var jc = CreateClient(); ir.JobSiteList = jc.GetJobSiteLimitItems(companyId, string.Empty); @@ -307,6 +311,31 @@ namespace IronIntel.Contractor.Site } } + private object GetAssetBasicInfoForEdit() + { + try + { + var session = GetCurrentLoginSession(); + if (session != null) + { + string clientdata = Request.Params["ClientData"]; + //string[] ps = JsonConvert.DeserializeObject(clientdata); + string companyId = SystemParams.CompanyID; + + var ac = CreateClient(); + var assets = ac.GetAssetBasicInfoByUser(companyId, string.Empty, session.User.UID); + + return assets; + } + else + return null; + } + catch (Exception ex) + { + return ex.Message; + } + } + private object GetInspectionReport() { try diff --git a/Site b/Site index 23d7c99..8ed076c 160000 --- a/Site +++ b/Site @@ -1 +1 @@ -Subproject commit 23d7c999d9beda312a7190dcca40c1f172af3840 +Subproject commit 8ed076ccd71d4b2dac98850f4ef8188401401f19