add asset list

This commit is contained in:
Tsanie Lily 2020-04-30 09:42:07 +08:00
parent 6242642238
commit cde8e39af2
2 changed files with 43 additions and 14 deletions

View File

@ -90,6 +90,9 @@ namespace IronIntel.Contractor.Site
case "GetInspectionReportForEdit": case "GetInspectionReportForEdit":
result = GetInspectionReportForEdit(); result = GetInspectionReportForEdit();
break; break;
case "GetAssetBasicInfoForEdit":
result = GetAssetBasicInfoForEdit();
break;
} }
} }
} }
@ -251,7 +254,7 @@ namespace IronIntel.Contractor.Site
ir.Asset = aclient.GetAssetBasicInfoByID(companyId, ir.AssetId); ir.Asset = aclient.GetAssetBasicInfoByID(companyId, ir.AssetId);
} }
// list // list
bool hasAsset = false; //bool hasAsset = false;
bool hasEmail = false; bool hasEmail = false;
bool hasJobsite = false; bool hasJobsite = false;
foreach (var p in report.Template.Pages) foreach (var p in report.Template.Pages)
@ -262,11 +265,12 @@ namespace IronIntel.Contractor.Site
{ {
if (q.QuestionType == QuestionTypes.DropDown) if (q.QuestionType == QuestionTypes.DropDown)
{ {
if (q.LookupSource == LookupSources.Assets) //if (q.LookupSource == LookupSources.Assets)
{ //{
hasAsset = true; // hasAsset = true;
} //}
else if (q.LookupSource == LookupSources.Employee) //else
if (q.LookupSource == LookupSources.Employee)
{ {
hasEmail = true; hasEmail = true;
} }
@ -282,16 +286,16 @@ namespace IronIntel.Contractor.Site
} }
} }
} }
//if (hasEmail) if (hasEmail)
{ {
ir.EmailList = aic.GetInspectEmailList(companyId, string.Empty); ir.EmailList = aic.GetInspectEmailList(companyId, string.Empty);
} }
if (hasAsset) //if (hasAsset)
{ //{
var ac = CreateClient<AssetQueryClient>(); // var ac = CreateClient<AssetQueryClient>();
ir.AssetList = ac.GetAssetBasicInfoByUser(companyId, string.Empty, session.User.UID); // ir.AssetList = ac.GetAssetBasicInfoByUser(companyId, string.Empty, session.User.UID);
} //}
//if (hasJobsite) if (hasJobsite)
{ {
var jc = CreateClient<JobSiteProvider>(); var jc = CreateClient<JobSiteProvider>();
ir.JobSiteList = jc.GetJobSiteLimitItems(companyId, string.Empty); 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<string[]>(clientdata);
string companyId = SystemParams.CompanyID;
var ac = CreateClient<AssetQueryClient>();
var assets = ac.GetAssetBasicInfoByUser(companyId, string.Empty, session.User.UID);
return assets;
}
else
return null;
}
catch (Exception ex)
{
return ex.Message;
}
}
private object GetInspectionReport() private object GetInspectionReport()
{ {
try try

2
Site

@ -1 +1 @@
Subproject commit 23d7c999d9beda312a7190dcca40c1f172af3840 Subproject commit 8ed076ccd71d4b2dac98850f4ef8188401401f19