protected override void Execute(CodeActivityContext eContext) { // Setup var context = eContext.GetExtension <IWorkflowContext>(); var serviceFactory = eContext.GetExtension <IOrganizationServiceFactory>(); var service = serviceFactory.CreateOrganizationService(context.UserId); var codeString = TimeZoneCodeString.Get(eContext); int code; if (String.IsNullOrWhiteSpace(codeString) || !Int32.TryParse(codeString, out code)) { var settings = UserSettings.GetUserSettings(service, context.UserId); code = (int)settings.Attributes["timezonecode"]; } var req = new LocalTimeFromUtcTimeRequest { TimeZoneCode = code, UtcTime = UTCDateTime.Get(eContext) }; var resp = (LocalTimeFromUtcTimeResponse)service.Execute(req); if (resp == null) { return; } LocalDateTime.Set(eContext, resp.LocalTime); }
//-------------------------------------coordinate managment-------------------------------------------- public string GetNotificationData() { StringBuilder sb = new StringBuilder(); sb.Append(Latitude).Append(";"); //0 sb.Append(Longitude).Append(";"); //1 sb.Append(UTCDateTime.ToString("dd/MM/yyyy HH:mm:ss")).Append(";"); //2 sb.Append(Depth).Append(";"); //3 sb.Append(Magnitude).Append(";"); //4 sb.Append(Place.PlaceName).Append(";"); //5 sb.Append(Place.Country).Append(";"); //6 sb.Append(MagnitudeType.Type).Append(";"); //7 sb.Append(Source.SourceName); //8 return(sb.ToString()); }