add asset list
This commit is contained in:
		| @@ -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
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								Site
									
									
									
									
									
								
							 Submodule Site updated: 23d7c999d9...8ed076ccd7
									
								
							
		Reference in New Issue
	
	Block a user