add asset list
This commit is contained in:
		| @@ -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<AssetQueryClient>(); | ||||
|                         ir.AssetList = ac.GetAssetBasicInfoByUser(companyId, string.Empty, session.User.UID); | ||||
|                     } | ||||
|                     //if (hasJobsite) | ||||
|                     //if (hasAsset) | ||||
|                     //{ | ||||
|                     //    var ac = CreateClient<AssetQueryClient>(); | ||||
|                     //    ir.AssetList = ac.GetAssetBasicInfoByUser(companyId, string.Empty, session.User.UID); | ||||
|                     //} | ||||
|                     if (hasJobsite) | ||||
|                     { | ||||
|                         var jc = CreateClient<JobSiteProvider>(); | ||||
|                         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() | ||||
|         { | ||||
|             try | ||||
|   | ||||
							
								
								
									
										2
									
								
								Site
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								Site
									
									
									
									
									
								
							 Submodule Site updated: 23d7c999d9...8ed076ccd7
									
								
							
		Reference in New Issue
	
	Block a user