save method, sync
This commit is contained in:
		| @@ -93,6 +93,9 @@ namespace IronIntel.Contractor.Site | |||||||
|                         case "GetAssetBasicInfoForEdit": |                         case "GetAssetBasicInfoForEdit": | ||||||
|                             result = GetAssetBasicInfoForEdit(); |                             result = GetAssetBasicInfoForEdit(); | ||||||
|                             break; |                             break; | ||||||
|  |                         case "UpdateInspectionReport": | ||||||
|  |                             result = UpdateInspectionReport(); | ||||||
|  |                             break; | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| @@ -336,6 +339,50 @@ namespace IronIntel.Contractor.Site | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         private object UpdateInspectionReport() | ||||||
|  |         { | ||||||
|  |             try | ||||||
|  |             { | ||||||
|  |                 var session = GetCurrentLoginSession(); | ||||||
|  |                 if (session != null) | ||||||
|  |                 { | ||||||
|  |                     string clientdata = Request.Params["ClientData"]; | ||||||
|  |                     var report = JsonConvert.DeserializeObject<InspectReportInfo>(clientdata); | ||||||
|  |                     bool isTeam = report.Target == TemplateTargets.Person; | ||||||
|  |  | ||||||
|  |                     string companyId = SystemParams.CompanyID; | ||||||
|  |                     foreach (var a in report.Answers) | ||||||
|  |                     { | ||||||
|  |                         if (string.IsNullOrEmpty(a.Id)) | ||||||
|  |                         { | ||||||
|  |                             a.Id = Guid.NewGuid().ToString(); | ||||||
|  |                         } | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     // TODO: media | ||||||
|  |  | ||||||
|  |                     if (isTeam) | ||||||
|  |                     { | ||||||
|  |                         var tc = CreateClient<TeamIntelligenceClient>(); | ||||||
|  |                         tc.UpdateTeamInspect(companyId, report, session.User.UID); | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         var ac = CreateClient<AssetInspectClient>(); | ||||||
|  |                         ac.UpdateAssetInspect(companyId, report, session.User.UID); | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                     return true; | ||||||
|  |                 } | ||||||
|  |                 else | ||||||
|  |                     return null; | ||||||
|  |             } | ||||||
|  |             catch (Exception ex) | ||||||
|  |             { | ||||||
|  |                 return ex.Message; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|         private object GetInspectionReport() |         private object GetInspectionReport() | ||||||
|         { |         { | ||||||
|             try |             try | ||||||
| @@ -1160,7 +1207,7 @@ namespace IronIntel.Contractor.Site | |||||||
|     { |     { | ||||||
|         public AssetBasicInfo Asset { get; set; } |         public AssetBasicInfo Asset { get; set; } | ||||||
|         public string CommitTimeStr { get { return CommitTime == DateTime.MinValue ? "" : CommitTime.ToString(("M/d/yyyy h:mm tt")); } } |         public string CommitTimeStr { get { return CommitTime == DateTime.MinValue ? "" : CommitTime.ToString(("M/d/yyyy h:mm tt")); } } | ||||||
|         public string CommitTimeLocalStr { get { return CommitTimeLocal == default ? "" : CommitTimeLocal.ToString(("M/d/yyyy h:mm tt")); } } |         public string CommitTimeLocalStr { get { return CommitTimeLocal == DateTime.MinValue ? "" : CommitTimeLocal.ToString(("M/d/yyyy h:mm tt")); } } | ||||||
|         public List<IdentifiedQuestionItem> IdentifiedQuestions { get; set; } |         public List<IdentifiedQuestionItem> IdentifiedQuestions { get; set; } | ||||||
|     } |     } | ||||||
|     class IdentifiedQuestionItem : Question |     class IdentifiedQuestionItem : Question | ||||||
| @@ -1171,7 +1218,7 @@ namespace IronIntel.Contractor.Site | |||||||
|     { |     { | ||||||
|         public AssetBasicInfo Asset { get; set; } |         public AssetBasicInfo Asset { get; set; } | ||||||
|         public string CommitTimeStr { get { return CommitTime == DateTime.MinValue ? "" : CommitTime.ToString(("M/d/yyyy h:mm tt")); } } |         public string CommitTimeStr { get { return CommitTime == DateTime.MinValue ? "" : CommitTime.ToString(("M/d/yyyy h:mm tt")); } } | ||||||
|         public string CommitTimeLocalStr { get { return CommitTimeLocal == default ? "" : CommitTimeLocal.ToString(("M/d/yyyy h:mm tt")); } } |         public string CommitTimeLocalStr { get { return CommitTimeLocal == DateTime.MinValue ? "" : CommitTimeLocal.ToString(("M/d/yyyy h:mm tt")); } } | ||||||
|         public UserEmailInfo[] EmailList { get; set; } |         public UserEmailInfo[] EmailList { get; set; } | ||||||
|         public AssetBasicInfo[] AssetList { get; set; } |         public AssetBasicInfo[] AssetList { get; set; } | ||||||
|         public JobSiteLimitItem[] JobSiteList { get; set; } |         public JobSiteLimitItem[] JobSiteList { get; set; } | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										2
									
								
								Site
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								Site
									
									
									
									
									
								
							 Submodule Site updated: 8ed076ccd7...9df75cc0b7
									
								
							
		Reference in New Issue
	
	Block a user