| using System; |
| using System; |
| using System.CodeDom.Compiler; |
| using System.CodeDom.Compiler; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| using System.ComponentModel; |
| using System.ComponentModel; |
| using System.Diagnostics; |
| using System.Diagnostics; |
| using System.Globalization; |
| using System.Globalization; |
| using System.IO; |
| using System.IO; |
| using System.Linq; |
| using System.Linq; |
| using System.Net; |
| using System.Net; |
| using System.Net.Mail; |
| using System.Net.Mail; |
| using System.Reflection; |
| using System.Reflection; |
| using System.Runtime.CompilerServices; |
| using System.Runtime.CompilerServices; |
| using System.Text; |
| using System.Text; |
| using System.Text.Json; |
| using System.Text.Json; |
| using System.Text.RegularExpressions; |
| using System.Text.RegularExpressions; |
| using System.Threading; |
| using System.Threading; |
| using System.Threading.Tasks; |
| using System.Threading.Tasks; |
| using System.Web.Script.Serialization; |
| using System.Web.Script.Serialization; |
| using System.Windows; |
| using System.Windows; |
| using System.Windows.Controls; |
| using System.Windows.Controls; |
| using System.Windows.Data; |
| using System.Windows.Data; |
| using System.Windows.Interop; |
| using System.Windows.Interop; |
| using System.Windows.Markup; |
| using System.Windows.Markup; |
| using System.Windows.Media; |
| using System.Windows.Media; |
| using System.Windows.Navigation; |
| using System.Windows.Navigation; |
| using System.Windows.Threading; |
| using System.Windows.Threading; |
| using HtmlAgilityPack; |
| using HtmlAgilityPack; |
| using Microsoft.CSharp.RuntimeBinder; |
| using Microsoft.CSharp.RuntimeBinder; |
| using Microsoft.SharePoint.Client; |
| using Microsoft.SharePoint.Client; |
| using mshtml; |
| using mshtml; |
. | using Newtonsoft.Json; |
| |
| using ZionRobot.Helpers; |
| using ZionRobot.Helpers; |
| using ZionRobot.Models.AASP; |
| using ZionRobot.Models.AASP; |
| using ZionRobot.Models.Items; |
| using ZionRobot.Models.Items; |
| using ZionRobot.Models.Search; |
| using ZionRobot.Models.Search; |
| using ZionRobot.Models.Source; |
| using ZionRobot.Models.Source; |
| using ZionRobot.Models.ZFlow; |
| using ZionRobot.Models.ZFlow; |
| using ZionRobot.Persistence; |
| using ZionRobot.Persistence; |
| using ZionRobot.ZionExchangeManagement; |
| using ZionRobot.ZionExchangeManagement; |
| using ZionVault.Binder.OCR; |
| using ZionVault.Binder.OCR; |
| using ZionVault.WebService; |
| using ZionVault.WebService; |
| |
| |
| namespace ZionRobot.Handlers |
| namespace ZionRobot.Handlers |
| { |
| { |
| // Token: 0x0200004B RID: 75 |
| // Token: 0x0200003B RID: 59 |
| public partial class Browser : Window |
| public partial class Browser : Window |
| { |
| { |
| // Token: 0x1700016E RID: 366 |
| // Token: 0x170000E5 RID: 229 |
| // (get) Token: 0x06000362 RID: 866 RVA: 0x0000AB44 File Offset: 0x00008D44 |
| // (get) Token: 0x0600023A RID: 570 RVA: 0x00008D40 File Offset: 0x00006F40 |
| public static Browser Instance |
| public static Browser Instance |
| { |
| { |
| get |
| get |
| { |
| { |
| bool flag = Browser.instance == null; |
| bool flag = Browser.instance == null; |
| if (flag) |
| if (flag) |
| { |
| { |
| Browser.instance = new Browser(); |
| Browser.instance = new Browser(); |
| } |
| } |
| return Browser.instance; |
| return Browser.instance; |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x1700016F RID: 367 |
| // Token: 0x170000E6 RID: 230 |
| // (get) Token: 0x06000363 RID: 867 RVA: 0x0000AB71 File Offset: 0x00008D71 |
| // (get) Token: 0x0600023B RID: 571 RVA: 0x00008D6D File Offset: 0x00006F6D |
| public Thread Main |
| public Thread Main |
| { |
| { |
| get |
| get |
| { |
| { |
| return this.main; |
| return this.main; |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x17000170 RID: 368 |
| // Token: 0x170000E7 RID: 231 |
| // (get) Token: 0x06000364 RID: 868 RVA: 0x0000AB79 File Offset: 0x00008D79 |
| // (get) Token: 0x0600023C RID: 572 RVA: 0x00008D75 File Offset: 0x00006F75 |
| public bool Terminate |
| public bool Terminate |
| { |
| { |
| get |
| get |
| { |
| { |
| return this.terminate; |
| return this.terminate; |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x17000171 RID: 369 |
| // Token: 0x170000E8 RID: 232 |
| // (get) Token: 0x06000365 RID: 869 RVA: 0x0000AB81 File Offset: 0x00008D81 |
| // (get) Token: 0x0600023D RID: 573 RVA: 0x00008D7D File Offset: 0x00006F7D |
| // (set) Token: 0x06000366 RID: 870 RVA: 0x0000AB89 File Offset: 0x00008D89 |
| // (set) Token: 0x0600023E RID: 574 RVA: 0x00008D85 File Offset: 0x00006F85 |
| public Origin Source |
| public Origin Source |
| { |
| { |
| get |
| get |
| { |
| { |
| return this.source; |
| return this.source; |
| } |
| } |
| set |
| set |
| { |
| { |
| this.source = value; |
| this.source = value; |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x17000172 RID: 370 |
| // Token: 0x170000E9 RID: 233 |
| // (get) Token: 0x06000367 RID: 871 RVA: 0x0000AB92 File Offset: 0x00008D92 |
| // (get) Token: 0x0600023F RID: 575 RVA: 0x00008D8E File Offset: 0x00006F8E |
| // (set) Token: 0x06000368 RID: 872 RVA: 0x0000AB9A File Offset: 0x00008D9A |
| // (set) Token: 0x06000240 RID: 576 RVA: 0x00008D96 File Offset: 0x00006F96 |
| public Dictionary<string, string> DictionaryValues |
| public Dictionary<string, string> DictionaryValues |
| { |
| { |
| get |
| get |
| { |
| { |
| return this.dictionaryValues; |
| return this.dictionaryValues; |
| } |
| } |
| set |
| set |
| { |
| { |
| this.dictionaryValues = value; |
| this.dictionaryValues = value; |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x17000173 RID: 371 |
| // Token: 0x170000EA RID: 234 |
| // (get) Token: 0x06000369 RID: 873 RVA: 0x0000ABA3 File Offset: 0x00008DA3 |
| // (get) Token: 0x06000241 RID: 577 RVA: 0x00008D9F File Offset: 0x00006F9F |
| // (set) Token: 0x0600036A RID: 874 RVA: 0x0000ABAB File Offset: 0x00008DAB |
| // (set) Token: 0x06000242 RID: 578 RVA: 0x00008DA7 File Offset: 0x00006FA7 |
| public List<List<Element>> SearchElements |
| public List<List<Element>> SearchElements |
| { |
| { |
| get |
| get |
| { |
| { |
| return this.searchElements; |
| return this.searchElements; |
| } |
| } |
| set |
| set |
| { |
| { |
| this.searchElements = value; |
| this.searchElements = value; |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x0600036B RID: 875 RVA: 0x0000ABB4 File Offset: 0x00008DB4 |
| // Token: 0x06000243 RID: 579 RVA: 0x00008DB0 File Offset: 0x00006FB0 |
| public Browser() |
| public Browser() |
| { |
| { |
| this.InitializeComponent(); |
| this.InitializeComponent(); |
| base.Closing += this.Browser_Closing; |
| base.Closing += this.Browser_Closing; |
| DockPanel parent = this._holder; |
| DockPanel parent = this._holder; |
| WebBrowser replacement = new WebBrowser(); |
| WebBrowser replacement = new WebBrowser(); |
| replacement.Name = "browser"; |
| replacement.Name = "browser"; |
| parent.Children.Clear(); |
| parent.Children.Clear(); |
| parent.Children.Add(replacement); |
| parent.Children.Add(replacement); |
| this.browser = null; |
| this.browser = null; |
| this.browser = replacement; |
| this.browser = replacement; |
| this.browser.VerticalAlignment = VerticalAlignment.Stretch; |
| this.browser.VerticalAlignment = VerticalAlignment.Stretch; |
| this.browser.HorizontalAlignment = HorizontalAlignment.Stretch; |
| this.browser.HorizontalAlignment = HorizontalAlignment.Stretch; |
| this.browser.Navigating += this.Browser_Navigating; |
| this.browser.Navigating += this.Browser_Navigating; |
| this.browser.LoadCompleted += this.Browser_LoadComplete; |
| this.browser.LoadCompleted += this.Browser_LoadComplete; |
| this.browser.Unloaded += this.Browser_Unloaded; |
| this.browser.Unloaded += this.Browser_Unloaded; |
| this.HideScriptErrors(this.browser, true); |
| this.HideScriptErrors(this.browser, true); |
| this.dictionaryValues = new Dictionary<string, string>(); |
| this.dictionaryValues = new Dictionary<string, string>(); |
| this.searchElements = new List<List<Element>>(); |
| this.searchElements = new List<List<Element>>(); |
| } |
| } |
| |
| |
| // Token: 0x0600036C RID: 876 RVA: 0x0000ACB8 File Offset: 0x00008EB8 |
| // Token: 0x06000244 RID: 580 RVA: 0x00008EB4 File Offset: 0x000070B4 |
| private void Browser_Unloaded(object sender, RoutedEventArgs e) |
| private void Browser_Unloaded(object sender, RoutedEventArgs e) |
| { |
| { |
| this.browser.ContextMenu = null; |
| this.browser.ContextMenu = null; |
| this.browser.DataContext = null; |
| this.browser.DataContext = null; |
| this.browser.Resources = null; |
| this.browser.Resources = null; |
| this.browser.Source = null; |
| this.browser.Source = null; |
| this.browser.Navigating -= this.Browser_Navigating; |
| this.browser.Navigating -= this.Browser_Navigating; |
| this.browser.LoadCompleted -= this.Browser_LoadComplete; |
| this.browser.LoadCompleted -= this.Browser_LoadComplete; |
| this.browser.Unloaded -= this.Browser_Unloaded; |
| this.browser.Unloaded -= this.Browser_Unloaded; |
| this.browser.Dispose(); |
| this.browser.Dispose(); |
| } |
| } |
| |
| |
| // Token: 0x0600036D RID: 877 RVA: 0x0000AD50 File Offset: 0x00008F50 |
| // Token: 0x06000245 RID: 581 RVA: 0x00008F4C File Offset: 0x0000714C |
| private void Browser_Closing(object sender, CancelEventArgs e) |
| private void Browser_Closing(object sender, CancelEventArgs e) |
| { |
| { |
| this.terminate = true; |
| this.terminate = true; |
| this.Dispose(); |
| this.Dispose(); |
| this.main = null; |
| this.main = null; |
| this.source = null; |
| this.source = null; |
| this.dictionaryValues.Clear(); |
| this.dictionaryValues.Clear(); |
| this.dictionaryValues = null; |
| this.dictionaryValues = null; |
| this.searchElements.Clear(); |
| this.searchElements.Clear(); |
| this.searchElements = null; |
| this.searchElements = null; |
| Browser.instance = null; |
| Browser.instance = null; |
| GC.SuppressFinalize(this); |
| GC.SuppressFinalize(this); |
| GC.Collect(); |
| GC.Collect(); |
| GC.WaitForPendingFinalizers(); |
| GC.WaitForPendingFinalizers(); |
| GC.Collect(); |
| GC.Collect(); |
| } |
| } |
| |
| |
| // Token: 0x0600036E RID: 878 RVA: 0x0000ADC0 File Offset: 0x00008FC0 |
| // Token: 0x06000246 RID: 582 RVA: 0x00008FBC File Offset: 0x000071BC |
| public void Dispose() |
| public void Dispose() |
| { |
| { |
| this.main.Abort(); |
| this.main.Abort(); |
| BindingOperations.ClearAllBindings(this.browser); |
| BindingOperations.ClearAllBindings(this.browser); |
| Window w = Browser.getWindowElement(this.browser); |
| Window w = Browser.getWindowElement(this.browser); |
| FieldInfo field = typeof(Window).GetField("_swh", BindingFlags.Instance | BindingFlags.NonPublic); |
| FieldInfo field = typeof(Window).GetField("_swh", BindingFlags.Instance | BindingFlags.NonPublic); |
| object valueSWH = field.GetValue(this); |
| object valueSWH = field.GetValue(this); |
| object valueSourceWindow = valueSWH.GetType().GetField("_sourceWindow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(valueSWH); |
| object valueSourceWindow = valueSWH.GetType().GetField("_sourceWindow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(valueSWH); |
| object valueKeyboardInput = valueSourceWindow.GetType().GetField("_keyboardInputSinkChildren", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(valueSourceWindow); |
| object valueKeyboardInput = valueSourceWindow.GetType().GetField("_keyboardInputSinkChildren", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(valueSourceWindow); |
| IEnumerable<IKeyboardInputSite> inputSites = valueKeyboardInput as IEnumerable<IKeyboardInputSite>; |
| IEnumerable<IKeyboardInputSite> inputSites = valueKeyboardInput as IEnumerable<IKeyboardInputSite>; |
| bool flag = inputSites == null; |
| bool flag = inputSites == null; |
| if (!flag) |
| if (!flag) |
| { |
| { |
| IKeyboardInputSite currentSite = inputSites.FirstOrDefault((IKeyboardInputSite s) => s.Sink == this.browser); |
| IKeyboardInputSite currentSite = inputSites.FirstOrDefault((IKeyboardInputSite s) => s.Sink == this.browser); |
| bool flag2 = currentSite != null; |
| bool flag2 = currentSite != null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| currentSite.Unregister(); |
| currentSite.Unregister(); |
| } |
| } |
| this._holder.Children.Remove(this.browser); |
| this._holder.Children.Remove(this.browser); |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x0600036F RID: 879 RVA: 0x0000AE9C File Offset: 0x0000909C |
| // Token: 0x06000247 RID: 583 RVA: 0x00009098 File Offset: 0x00007298 |
| private static Window getWindowElement(DependencyObject element) |
| private static Window getWindowElement(DependencyObject element) |
| { |
| { |
| while (element != null && !(element is Window)) |
| while (element != null && !(element is Window)) |
| { |
| { |
| element = VisualTreeHelper.GetParent(element); |
| element = VisualTreeHelper.GetParent(element); |
| } |
| } |
| return element as Window; |
| return element as Window; |
| } |
| } |
| |
| |
| // Token: 0x06000370 RID: 880 RVA: 0x0000AED6 File Offset: 0x000090D6 |
| // Token: 0x06000248 RID: 584 RVA: 0x000090D2 File Offset: 0x000072D2 |
| private void Browser_Navigating(object sender, NavigatingCancelEventArgs e) |
| private void Browser_Navigating(object sender, NavigatingCancelEventArgs e) |
| { |
| { |
| this.wait = true; |
| this.wait = true; |
| Console.WriteLine(e.Uri); |
| Console.WriteLine(e.Uri); |
| } |
| } |
| |
| |
| // Token: 0x06000371 RID: 881 RVA: 0x0000AEEC File Offset: 0x000090EC |
| // Token: 0x06000249 RID: 585 RVA: 0x000090E8 File Offset: 0x000072E8 |
| private void Browser_LoadComplete(object sender, NavigationEventArgs e) |
| private void Browser_LoadComplete(object sender, NavigationEventArgs e) |
| { |
| { |
| this.wait = false; |
| this.wait = false; |
| } |
| } |
| |
| |
| // Token: 0x06000372 RID: 882 RVA: 0x0000AEF8 File Offset: 0x000090F8 |
| // Token: 0x0600024A RID: 586 RVA: 0x000090F4 File Offset: 0x000072F4 |
| private void Browser_LayoutUpdated(object sender, EventArgs e) |
| private void Browser_LayoutUpdated(object sender, EventArgs e) |
| { |
| { |
| HTMLDocument doc = (HTMLDocument)this.browser.Document; |
| HTMLDocument doc = (HTMLDocument)this.browser.Document; |
| this.browser.LayoutUpdated -= this.Browser_LayoutUpdated; |
| this.browser.LayoutUpdated -= this.Browser_LayoutUpdated; |
| } |
| } |
| |
| |
| // Token: 0x06000373 RID: 883 RVA: 0x0000AF34 File Offset: 0x00009134 |
| // Token: 0x0600024B RID: 587 RVA: 0x00009130 File Offset: 0x00007330 |
| private void HideScriptErrors(WebBrowser wb, bool hide) |
| private void HideScriptErrors(WebBrowser wb, bool hide) |
| { |
| { |
| FieldInfo fiComWebBrowser = typeof(WebBrowser).GetField("_axIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic); |
| FieldInfo fiComWebBrowser = typeof(WebBrowser).GetField("_axIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic); |
| bool flag = fiComWebBrowser == null; |
| bool flag = fiComWebBrowser == null; |
| if (!flag) |
| if (!flag) |
| { |
| { |
| object objComWebBrowser = fiComWebBrowser.GetValue(wb); |
| object objComWebBrowser = fiComWebBrowser.GetValue(wb); |
| bool flag2 = objComWebBrowser == null; |
| bool flag2 = objComWebBrowser == null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| wb.Loaded += delegate(object o, RoutedEventArgs s) |
| wb.Loaded += delegate(object o, RoutedEventArgs s) |
| { |
| { |
| this.HideScriptErrors(wb, hide); |
| this.HideScriptErrors(wb, hide); |
| }; |
| }; |
| } |
| } |
| else |
| else |
| { |
| { |
| objComWebBrowser.GetType().InvokeMember("Silent", BindingFlags.SetProperty, null, objComWebBrowser, new object[] |
| objComWebBrowser.GetType().InvokeMember("Silent", BindingFlags.SetProperty, null, objComWebBrowser, new object[] |
| { |
| { |
| hide |
| hide |
| }); |
| }); |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x06000374 RID: 884 RVA: 0x0000AFE0 File Offset: 0x000091E0 |
| // Token: 0x0600024C RID: 588 RVA: 0x000091DC File Offset: 0x000073DC |
| private void Wait() |
| private void Wait() |
| { |
| { |
| while (this.wait) |
| while (this.wait) |
| { |
| { |
| Thread.Sleep(1000); |
| Thread.Sleep(1000); |
| } |
| } |
| } |
| } |
| |
| |
| // Token: 0x06000375 RID: 885 RVA: 0x0000B008 File Offset: 0x00009208 |
| // Token: 0x0600024D RID: 589 RVA: 0x00009204 File Offset: 0x00007404 |
| public void CreateLawsuit(Lawsuit lawsuit) |
| public void CreateLawsuit(Lawsuit lawsuit) |
| { |
| { |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| Action<KeyValuePair<string, string>> <>9__3; |
| Action<KeyValuePair<string, string>> <>9__3; |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| where be.Name == "CreateLawsuit" |
| where be.Name == "CreateLawsuit" |
| select be).FirstOrDefault<BlockElement>().Actions; |
| select be).FirstOrDefault<BlockElement>().Actions; |
| List<KeyValuePair<string, string>> list = lawsuit.Fields.ToList<KeyValuePair<string, string>>(); |
| List<KeyValuePair<string, string>> list = lawsuit.Fields.ToList<KeyValuePair<string, string>>(); |
| Action<KeyValuePair<string, string>> action2; |
| Action<KeyValuePair<string, string>> action2; |
| if ((action2 = <>9__3) == null) |
| if ((action2 = <>9__3) == null) |
| { |
| { |
| action2 = (<>9__3 = delegate(KeyValuePair<string, string> f) |
| action2 = (<>9__3 = delegate(KeyValuePair<string, string> f) |
| { |
| { |
| string value = f.Value; |
| string value = f.Value; |
| DateTime date; |
| DateTime date; |
| this.dictionaryValues.Add(f.Key, DateTime.TryParse(f.Value, out date) ? Shift.formatDate(f.Value, "dd/MM/yyyy", "pt-BR") : f.Value); |
| this.dictionaryValues.Add(f.Key, DateTime.TryParse(f.Value, out date) ? Shift.formatDate(f.Value, "dd/MM/yyyy", "pt-BR") : f.Value); |
| }); |
| }); |
| } |
| } |
| list.ForEach(action2); |
| list.ForEach(action2); |
| this.dictionaryValues.Add("Adverse_name", lawsuit.Adverse.Name.ToString()); |
| this.dictionaryValues.Add("Adverse_name", lawsuit.Adverse.Name.ToString()); |
. | |
| this.dictionaryValues.Add("Adverse_juridical_person", lawsuit.Adverse.Juridical_person.ToString()); |
| this.dictionaryValues.Add("Accountable", lawsuit.Accountable); |
| this.dictionaryValues.Add("Accountable", lawsuit.Accountable); |
. | this.dictionaryValues.Add("Physical", lawsuit.Physical.ToString()); |
| this.dictionaryValues.Add("Folder_number", lawsuit.Folder_number); |
| this.dictionaryValues.Add("Folder_number", lawsuit.FolderNumber); |
| this.dictionaryValues.Add("Opening_date", Shift.formatDate(lawsuit.Opening_date.ToString(), "dd/MM/yyyy", "pt-BR")); |
| this.dictionaryValues.Add("Opening_date", Shift.formatDate(lawsuit.OpeningDate.ToString(), "dd/MM/yyyy", "pt-BR")); |
| this.dictionaryValues.Add("Distribution_date", Shift.formatDate(lawsuit.Distribution_date.ToString(), "dd/MM/yyyy", "pt-BR")); |
| this.dictionaryValues.Add("Distribution_date", Shift.formatDate(lawsuit.DistributionDate.ToString(), "dd/MM/yyyy", "pt-BR")); |
| |
| this.dictionaryValues.Add("Client", lawsuit.Client); |
| this.dictionaryValues.Add("Client", lawsuit.Client); |
. | this.dictionaryValues.Add("Field_of_law", lawsuit.FieldOfLaw); |
| this.dictionaryValues.Add("Field_of_law", lawsuit.Field_of_law); |
| this.dictionaryValues.Add("Subject", lawsuit.Subject); |
| this.dictionaryValues.Add("Subject", lawsuit.Subject); |
. | bool juridical_person = lawsuit.Adverse.Juridical_person; |
| |
| if (juridical_person) |
| |
| { |
| |
| this.dictionaryValues.Add("Adverse_juridical_person", lawsuit.Adverse.Juridical_person.ToString()); |
| |
| } |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| { |
| { |
| Task<bool> task = this.executeAction(action); |
| Task<bool> task = this.executeAction(action); |
| task.Wait(); |
| task.Wait(); |
| bool execute = task.Result; |
| bool execute = task.Result; |
| } |
| } |
| bool flag = this.dictionaryValues.ContainsKey("Lawsuit_link"); |
| bool flag = this.dictionaryValues.ContainsKey("Lawsuit_link"); |
| if (flag) |
| if (flag) |
| { |
| { |
| lawsuit.Link = this.dictionaryValues["Lawsuit_link"]; |
| lawsuit.Link = this.dictionaryValues["Lawsuit_link"]; |
| lawsuit.UpdateUrl(); |
| lawsuit.UpdateUrl(); |
| lawsuit.UpdateSycn(2); |
| lawsuit.UpdateSycn(2); |
| } |
| } |
| else |
| else |
| { |
| { |
| lawsuit.UpdateSycn(5); |
| lawsuit.UpdateSycn(5); |
| } |
| } |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x06000376 RID: 886 RVA: 0x0000B06C File Offset: 0x0000926C |
| // Token: 0x0600024E RID: 590 RVA: 0x00009268 File Offset: 0x00007468 |
. | public void UpdateLawsuit(Lawsuit lawsuit) |
| |
| { |
| |
| Application.Current.Dispatcher.Invoke(delegate() |
| |
| { |
| |
| this.Visibility = Visibility.Visible; |
| |
| this.ShowInTaskbar = true; |
| |
| this.Show(); |
| |
| this.terminate = false; |
| |
| }); |
| |
| Action<KeyValuePair<string, string>> <>9__3; |
| |
| this.main = new Thread(delegate() |
| |
| { |
| |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| |
| where be.Name == "UpdateLawsuit" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| List<KeyValuePair<string, string>> list = lawsuit.Fields.ToList<KeyValuePair<string, string>>(); |
| |
| Action<KeyValuePair<string, string>> action2; |
| |
| if ((action2 = <>9__3) == null) |
| |
| { |
| |
| action2 = (<>9__3 = delegate(KeyValuePair<string, string> f) |
| |
| { |
| |
| string value = f.Value; |
| |
| DateTime date; |
| |
| this.dictionaryValues.Add(f.Key, DateTime.TryParse(f.Value, out date) ? Shift.formatDate(f.Value, "dd/MM/yyyy", "pt-BR") : f.Value); |
| |
| }); |
| |
| } |
| |
| list.ForEach(action2); |
| |
| Dictionary<string, string> dictionary = this.dictionaryValues; |
| |
| string key = "Adverse_name"; |
| |
| Adverse adverse = lawsuit.Adverse; |
| |
| string text; |
| |
| if (adverse == null) |
| |
| { |
| |
| text = null; |
| |
| } |
| |
| else |
| |
| { |
| |
| string name = adverse.Name; |
| |
| text = ((name != null) ? name.ToString() : null); |
| |
| } |
| |
| dictionary.Add(key, text ?? ""); |
| |
| this.dictionaryValues.Add("Accountable", lawsuit.Accountable); |
| |
| this.dictionaryValues.Add("Physical", lawsuit.Physical.ToString()); |
| |
| this.dictionaryValues.Add("Folder_number", lawsuit.FolderNumber); |
| |
| this.dictionaryValues.Add("Opening_date", lawsuit.OpeningDate); |
| |
| this.dictionaryValues.Add("Distribution_date", lawsuit.DistributionDate); |
| |
| this.dictionaryValues.Add("Client", lawsuit.Client); |
| |
| this.dictionaryValues.Add("Field_of_law", lawsuit.FieldOfLaw); |
| |
| this.dictionaryValues.Add("Subject", lawsuit.Subject); |
| |
| bool juridical_person = lawsuit.Adverse.Juridical_person; |
| |
| if (juridical_person) |
| |
| { |
| |
| this.dictionaryValues.Add("Adverse_juridical_person", lawsuit.Adverse.Juridical_person.ToString()); |
| |
| } |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| lawsuit.UpdateSycn(2); |
| |
| }); |
| |
| this.Main.Start(); |
| |
| } |
| |
| |
| |
| // Token: 0x06000377 RID: 887 RVA: 0x0000B0D0 File Offset: 0x000092D0 |
| |
| public void CreateLawsuitPhase(LawsuitPhase lawsuitPhase) |
| |
| { |
| |
| Application.Current.Dispatcher.Invoke(delegate() |
| |
| { |
| |
| this.Visibility = Visibility.Visible; |
| |
| this.ShowInTaskbar = true; |
| |
| this.Show(); |
| |
| this.terminate = false; |
| |
| }); |
| |
| Action<KeyValuePair<string, string>> <>9__3; |
| |
| Func<Orgao, bool> <>9__4; |
| |
| this.main = new Thread(delegate() |
| |
| { |
| |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| |
| where be.Name == "CreateLawsuitPhase" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| List<KeyValuePair<string, string>> list = lawsuitPhase.Fields.ToList<KeyValuePair<string, string>>(); |
| |
| Action<KeyValuePair<string, string>> action2; |
| |
| if ((action2 = <>9__3) == null) |
| |
| { |
| |
| action2 = (<>9__3 = delegate(KeyValuePair<string, string> f) |
| |
| { |
| |
| string value = f.Value; |
| |
| DateTime date; |
| |
| this.dictionaryValues.Add(f.Key, DateTime.TryParse(f.Value, out date) ? Shift.formatDate(f.Value, "dd/MM/yyyy", "pt-BR") : f.Value); |
| |
| }); |
| |
| } |
| |
| list.ForEach(action2); |
| |
| string path = Environment.CurrentDirectory; |
| |
| StringReader sr = new StringReader(string.Join("/", new string[] |
| |
| { |
| |
| path, |
| |
| "Persistence/orgao.json" |
| |
| })); |
| |
| string json = System.IO.File.ReadAllText(path + "\\Persistence\\orgao.json"); |
| |
| List<Orgao> orgaos = JsonConvert.DeserializeObject<List<Orgao>>(json); |
| |
| this.dictionaryValues.Add("ParentLink", lawsuitPhase.ParentLink); |
| |
| this.dictionaryValues.Add("Number", lawsuitPhase.Number); |
| |
| this.dictionaryValues.Add("Type", lawsuitPhase.Type); |
| |
| this.dictionaryValues.Add("Accountable", lawsuitPhase.Accountable); |
| |
| this.dictionaryValues.Add("OpeningDate", Shift.formatDate(lawsuitPhase.OpeningDate.ToString(), "dd/MM/yyyy", "pt-BR")); |
| |
| Dictionary<string, string> dictionary = this.dictionaryValues; |
| |
| string key = "Current"; |
| |
| bool flag = lawsuitPhase.Current; |
| |
| dictionary.Add(key, flag.ToString()); |
| |
| IEnumerable<Orgao> enumerable = orgaos; |
| |
| Func<Orgao, bool> predicate; |
| |
| if ((predicate = <>9__4) == null) |
| |
| { |
| |
| predicate = (<>9__4 = ((Orgao o) => o.Abreviacao + " - " + o.Nome == this.dictionaryValues["Órgão_Judicial"])); |
| |
| } |
| |
| Orgao orgao = enumerable.Where(predicate).FirstOrDefault<Orgao>(); |
| |
| bool flag2 = orgao != null; |
| |
| if (flag2) |
| |
| { |
| |
| this.dictionaryValues.Remove("Órgão_Judicial"); |
| |
| this.dictionaryValues.Add("Órgão_Judicial", orgao.Id.ToString()); |
| |
| } |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| bool flag3 = this.dictionaryValues.ContainsKey("LawsuitPhaseLink"); |
| |
| if (flag3) |
| |
| { |
| |
| lawsuitPhase.Link = this.dictionaryValues["LawsuitPhaseLink"]; |
| |
| lawsuitPhase.UpdateUrl(); |
| |
| lawsuitPhase.UpdateSycn(2); |
| |
| } |
| |
| else |
| |
| { |
| |
| lawsuitPhase.UpdateSycn(5); |
| |
| } |
| |
| }); |
| |
| this.Main.Start(); |
| |
| } |
| |
| |
| |
| // Token: 0x06000378 RID: 888 RVA: 0x0000B134 File Offset: 0x00009334 |
| |
| public void CreateLawsuitPhaseProgress(LawsuitPhaseProgress lawsuitPhaseProgress) |
| |
| { |
| |
| Application.Current.Dispatcher.Invoke(delegate() |
| |
| { |
| |
| this.Visibility = Visibility.Visible; |
| |
| this.ShowInTaskbar = true; |
| |
| this.Show(); |
| |
| this.terminate = false; |
| |
| }); |
| |
| Action<KeyValuePair<string, string>> <>9__3; |
| |
| this.main = new Thread(delegate() |
| |
| { |
| |
| bool flag = lawsuitPhaseProgress.Fields.Count<KeyValuePair<string, string>>() < 5; |
| |
| if (flag) |
| |
| { |
| |
| lawsuitPhaseProgress.UpdateSycn(5); |
| |
| } |
| |
| else |
| |
| { |
| |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| |
| where be.Name == "CreateLawsuitPhaseProgress" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| List<KeyValuePair<string, string>> list = lawsuitPhaseProgress.Fields.ToList<KeyValuePair<string, string>>(); |
| |
| Action<KeyValuePair<string, string>> action2; |
| |
| if ((action2 = <>9__3) == null) |
| |
| { |
| |
| action2 = (<>9__3 = delegate(KeyValuePair<string, string> f) |
| |
| { |
| |
| string value = f.Value; |
| |
| DateTime date; |
| |
| this.dictionaryValues.Add(f.Key, DateTime.TryParse(f.Value, out date) ? Shift.formatDate(f.Value, "dd/MM/yyyy", "pt-BR") : f.Value); |
| |
| }); |
| |
| } |
| |
| list.ForEach(action2); |
| |
| string path = Environment.CurrentDirectory; |
| |
| StringReader sr = new StringReader(string.Join("/", new string[] |
| |
| { |
| |
| path, |
| |
| "Persistence/orgao.json" |
| |
| })); |
| |
| string json = System.IO.File.ReadAllText(path + "\\Persistence\\orgao.json"); |
| |
| List<Orgao> orgaos = JsonConvert.DeserializeObject<List<Orgao>>(json); |
| |
| this.dictionaryValues.Add("ParentLink", lawsuitPhaseProgress.ParentLink); |
| |
| this.dictionaryValues.Add("Number", lawsuitPhaseProgress.Number); |
| |
| this.dictionaryValues.Add("Type", lawsuitPhaseProgress.Type); |
| |
| this.dictionaryValues.Add("Accountable", lawsuitPhaseProgress.Accountable); |
| |
| this.dictionaryValues.Add("OpeningDate", Shift.formatDate(lawsuitPhaseProgress.Date.ToString(), "dd/MM/yyyy", "pt-BR")); |
| |
| Dictionary<string, string> dictionary = this.dictionaryValues; |
| |
| string key = "Current"; |
| |
| bool flag2 = lawsuitPhaseProgress.Current; |
| |
| dictionary.Add(key, flag2.ToString()); |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| bool flag3 = this.dictionaryValues.ContainsKey("LawsuitPhaseProgressLink"); |
| |
| if (flag3) |
| |
| { |
| |
| lawsuitPhaseProgress.Link = this.dictionaryValues["LawsuitPhaseProgressLink"]; |
| |
| lawsuitPhaseProgress.UpdateUrl(); |
| |
| lawsuitPhaseProgress.UpdateSycn(2); |
| |
| } |
| |
| else |
| |
| { |
| |
| lawsuitPhaseProgress.UpdateSycn(5); |
| |
| } |
| |
| } |
| |
| }); |
| |
| this.Main.Start(); |
| |
| } |
| |
| |
| |
| // Token: 0x06000379 RID: 889 RVA: 0x0000B198 File Offset: 0x00009398 |
| |
| private string translateAnaliseDeRisco(string value) |
| |
| { |
| |
| string result = string.Empty; |
| |
| string text = value.ToUpper(); |
| |
| string a = text; |
| |
| if (!(a == "REMOTA")) |
| |
| { |
| |
| if (!(a == "POSSÍVEL")) |
| |
| { |
| |
| if (a == "PROVÁVEL") |
| |
| { |
| |
| result = "3"; |
| |
| } |
| |
| } |
| |
| else |
| |
| { |
| |
| result = "2"; |
| |
| } |
| |
| } |
| |
| else |
| |
| { |
| |
| result = "1"; |
| |
| } |
| |
| return result; |
| |
| } |
| |
| |
| |
| // Token: 0x0600037A RID: 890 RVA: 0x0000B1FC File Offset: 0x000093FC |
| |
| private string valueHelper(KeyValuePair<string, string> pair) |
| |
| { |
| |
| string value = Regex.Replace(pair.Value.Trim(), "\r\n", ""); |
| |
| bool flag = pair.Key.ToLower().Contains("valor"); |
| |
| if (flag) |
| |
| { |
| |
| value = this.currencyHelper(value); |
| |
| } |
| |
| bool flag2 = pair.Key.ToLower() == "análise_de_risco"; |
| |
| if (flag2) |
| |
| { |
| |
| value = this.translateAnaliseDeRisco(pair.Value); |
| |
| } |
| |
| return value; |
| |
| } |
| |
| |
| |
| // Token: 0x0600037B RID: 891 RVA: 0x0000B27C File Offset: 0x0000947C |
| |
| private string currencyHelper(string value) |
| |
| { |
| |
| decimal result; |
| |
| bool flag = string.IsNullOrEmpty(value) || !decimal.TryParse(value, out result); |
| |
| string result2; |
| |
| if (flag) |
| |
| { |
| |
| result2 = value; |
| |
| } |
| |
| else |
| |
| { |
| |
| CultureInfo culture = CultureInfo.CreateSpecificCulture("pt-BR"); |
| |
| value = value.Replace(".", ""); |
| |
| value = decimal.Parse(value).ToString("C", culture); |
| |
| value = value.Replace("R$ ", ""); |
| |
| result2 = value; |
| |
| } |
| |
| return result2; |
| |
| } |
| |
| |
| |
| // Token: 0x0600037C RID: 892 RVA: 0x0000B2F4 File Offset: 0x000094F4 |
| |
| public void CreateWithLocal(string file, BlockElement mainActionBlock) |
| |
| { |
| |
| Application.Current.Dispatcher.Invoke(delegate() |
| |
| { |
| |
| this.Visibility = Visibility.Visible; |
| |
| this.ShowInTaskbar = true; |
| |
| this.Show(); |
| |
| this.terminate = false; |
| |
| }); |
| |
| this.main = new Thread(delegate() |
| |
| { |
| |
| string content = System.IO.File.ReadAllText(file); |
| |
| JavaScriptSerializer json_serializer = new JavaScriptSerializer(); |
| |
| Dictionary<string, string> dicProgress = json_serializer.Deserialize<Dictionary<string, string>>(content); |
| |
| foreach (KeyValuePair<string, string> prog in dicProgress) |
| |
| { |
| |
| this.dictionaryValues.Add(prog.Key.Replace(' ', '_'), this.valueHelper(prog)); |
| |
| } |
| |
| this.dictionaryValues.Remove("Data"); |
| |
| this.dictionaryValues.Add("Data", "22/12/2021"); |
| |
| foreach (ZionRobot.Models.Source.Action action in mainActionBlock.Actions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| }); |
| |
| this.Main.Start(); |
| |
| } |
| |
| |
| |
| // Token: 0x0600037D RID: 893 RVA: 0x0000B35C File Offset: 0x0000955C |
| |
| public void CreateLawsuitPhaseProgressLocal(string file) |
| |
| { |
| |
| Application.Current.Dispatcher.Invoke(delegate() |
| |
| { |
| |
| this.Visibility = Visibility.Visible; |
| |
| this.ShowInTaskbar = true; |
| |
| this.Show(); |
| |
| this.terminate = false; |
| |
| }); |
| |
| this.main = new Thread(delegate() |
| |
| { |
| |
| List<ZionRobot.Models.Source.Action> CreateLawsuitPhaseProgressActions = (from be in this.Source.BlockElements |
| |
| where be.Name == "CreateLawsuitPhaseProgressLocal" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| string content = System.IO.File.ReadAllText(file); |
| |
| JavaScriptSerializer json_serializer = new JavaScriptSerializer(); |
| |
| Dictionary<string, string> dicProgress = json_serializer.Deserialize<Dictionary<string, string>>(content); |
| |
| foreach (KeyValuePair<string, string> prog in dicProgress) |
| |
| { |
| |
| this.dictionaryValues.Add(prog.Key.Replace(' ', '_'), prog.Value); |
| |
| } |
| |
| foreach (ZionRobot.Models.Source.Action action in CreateLawsuitPhaseProgressActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| }); |
| |
| this.Main.Start(); |
| |
| } |
| |
| |
| |
| // Token: 0x0600037E RID: 894 RVA: 0x0000B3C0 File Offset: 0x000095C0 |
| |
| public void CreateLawsuitDeposit(string file, BlockElement mainActionBlock) |
| |
| { |
| |
| Application.Current.Dispatcher.Invoke(delegate() |
| |
| { |
| |
| this.Visibility = Visibility.Visible; |
| |
| this.ShowInTaskbar = true; |
| |
| this.Show(); |
| |
| this.terminate = false; |
| |
| }); |
| |
| this.main = new Thread(delegate() |
| |
| { |
| |
| string content = System.IO.File.ReadAllText(file); |
| |
| JavaScriptSerializer json_serializer = new JavaScriptSerializer(); |
| |
| Dictionary<string, string> dicProgress = json_serializer.Deserialize<Dictionary<string, string>>(content); |
| |
| foreach (KeyValuePair<string, string> prog in dicProgress) |
| |
| { |
| |
| this.dictionaryValues.Add(prog.Key.Replace(' ', '_'), this.valueHelper(prog)); |
| |
| } |
| |
| foreach (ZionRobot.Models.Source.Action action in mainActionBlock.Actions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| }); |
| |
| this.Main.Start(); |
| |
| } |
| |
| |
| |
| // Token: 0x0600037F RID: 895 RVA: 0x0000B428 File Offset: 0x00009628 |
| |
| public void CreateLawsuitDemand(LawsuitDemand lawsuitDemand) |
| |
| { |
| |
| Application.Current.Dispatcher.Invoke(delegate() |
| |
| { |
| |
| this.Visibility = Visibility.Visible; |
| |
| this.ShowInTaskbar = true; |
| |
| this.Show(); |
| |
| this.terminate = false; |
| |
| }); |
| |
| Action<KeyValuePair<string, string>> <>9__3; |
| |
| this.main = new Thread(delegate() |
| |
| { |
| |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| |
| where be.Name == "CreateLawsuitDemand" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| List<KeyValuePair<string, string>> list = lawsuitDemand.Fields.ToList<KeyValuePair<string, string>>(); |
| |
| Action<KeyValuePair<string, string>> action2; |
| |
| if ((action2 = <>9__3) == null) |
| |
| { |
| |
| action2 = (<>9__3 = delegate(KeyValuePair<string, string> f) |
| |
| { |
| |
| string value = f.Value; |
| |
| bool flag2 = f.Key == "Análise_de_Risco"; |
| |
| if (flag2) |
| |
| { |
| |
| string value2 = f.Value; |
| |
| string a = value2; |
| |
| if (!(a == "Remota")) |
| |
| { |
| |
| if (!(a == "Possível")) |
| |
| { |
| |
| if (a == "Provável") |
| |
| { |
| |
| value = "3"; |
| |
| } |
| |
| } |
| |
| else |
| |
| { |
| |
| value = "2"; |
| |
| } |
| |
| } |
| |
| else |
| |
| { |
| |
| value = "1"; |
| |
| } |
| |
| } |
| |
| bool flag3 = f.Key == "Causa_de_Pedir"; |
| |
| if (flag3) |
| |
| { |
| |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| |
| htmlDoc.LoadHtml(f.Value); |
| |
| value = htmlDoc.DocumentNode.InnerText; |
| |
| } |
| |
| DateTime date; |
| |
| this.dictionaryValues.Add(f.Key, DateTime.TryParse(f.Value, out date) ? Shift.formatDate(f.Value, "dd/MM/yyyy", "pt-BR") : value); |
| |
| }); |
| |
| } |
| |
| list.ForEach(action2); |
| |
| this.dictionaryValues.Add("ParentLink", lawsuitDemand.ParentLink); |
| |
| this.dictionaryValues.Add("Accountable", lawsuitDemand.Accountable); |
| |
| this.dictionaryValues.Add("OpeningDate", Shift.formatDate(lawsuitDemand.OpeningDate.ToString(), "dd/MM/yyyy", "pt-BR")); |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| bool flag = this.dictionaryValues.ContainsKey("LawsuitDemandLink"); |
| |
| if (flag) |
| |
| { |
| |
| lawsuitDemand.Link = this.dictionaryValues["LawsuitDemandLink"]; |
| |
| lawsuitDemand.UpdateUrl(); |
| |
| lawsuitDemand.UpdateSycn(2); |
| |
| } |
| |
| else |
| |
| { |
| |
| lawsuitDemand.UpdateSycn(5); |
| |
| } |
| |
| }); |
| |
| this.Main.Start(); |
| |
| } |
| |
| |
| |
| // Token: 0x06000380 RID: 896 RVA: 0x0000B48C File Offset: 0x0000968C |
| |
| public void ExecuteAndSave(string path) |
| public void ExecuteAndSave(string path) |
| { |
| { |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
| foreach (ActionsElement actionElement in this.Source.ActionsElements) |
| foreach (ActionsElement actionElement in this.Source.ActionsElements) |
| { |
| { |
| foreach (ZionRobot.Models.Source.Action action in actionElement.Actions) |
| foreach (ZionRobot.Models.Source.Action action in actionElement.Actions) |
| { |
| { |
| this.executeAction(action).Wait(); |
| this.executeAction(action).Wait(); |
| } |
| } |
| } |
| } |
| this.SaveData(path); |
| this.SaveData(path); |
| }); |
| }); |
| this.main.Start(); |
| this.main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x06000381 RID: 897 RVA: 0x0000B4F0 File Offset: 0x000096F0 |
| // Token: 0x0600024F RID: 591 RVA: 0x000092CC File Offset: 0x000074CC |
| private void SaveData(string path) |
| private void SaveData(string path) |
| { |
| { |
. | int i = 1; |
| |
| this.searchElements.ForEach(delegate(List<Element> data) |
| this.searchElements.ForEach(delegate(List<Element> data) |
| { |
| { |
. | int i = i; |
| |
| i++; |
| |
| string allElementsTxt = string.Join(" ", (from d in data |
| string allElementsTxt = string.Join(" ", (from d in data |
| where d.GoTo == "SearchLog" |
| where d.GoTo == "SearchLog" |
| select d into e |
| select d into e |
| select e.Value).ToArray<string>()); |
| select e.Value).ToArray<string>()); |
| bool flag = !this.hasLog(allElementsTxt); |
| bool flag = !this.hasLog(allElementsTxt); |
| if (flag) |
| if (flag) |
| { |
| { |
| DateTime datenow = DateTime.Now; |
| DateTime datenow = DateTime.Now; |
| string fileName = string.Format("Publicação-{0}-{1}", this.source.OutputFolder, datenow.ToString("yyyyMMdd-HHmmssffff")); |
| string fileName = string.Format("Publicação-{0}-{1}", this.source.OutputFolder, datenow.ToString("yyyyMMdd-HHmmssffff")); |
| Document doc = new Document(); |
| Document doc = new Document(); |
| doc.Pages.Add(new ZionVault.Binder.OCR.Page(string.Join(Environment.NewLine, (from d in data |
| doc.Pages.Add(new ZionVault.Binder.OCR.Page(string.Join(Environment.NewLine, (from d in data |
| where d.GoTo == "Meta" |
| where d.GoTo == "Meta" |
| select d into e |
| select d into e |
| select e.Value).ToArray<string>()))); |
| select e.Value).ToArray<string>()))); |
| Directory.CreateDirectory(path); |
| Directory.CreateDirectory(path); |
| string fileFullPath = Naming.GetFileFullPath(path, fileName, ".ocr"); |
| string fileFullPath = Naming.GetFileFullPath(path, fileName, ".ocr"); |
| doc.Save(fileFullPath, false, false); |
| doc.Save(fileFullPath, false, false); |
| CultureInfo culture = new CultureInfo("pt-BR"); |
| CultureInfo culture = new CultureInfo("pt-BR"); |
| Logs.SearchLog.SearchResults.Add(string.Concat(new string[] |
| Logs.SearchLog.SearchResults.Add(string.Concat(new string[] |
| { |
| { |
| datenow.ToString("G", culture), |
| datenow.ToString("G", culture), |
| "||", |
| "||", |
| this.source.Title, |
| this.source.Title, |
| "||", |
| "||", |
| fileFullPath, |
| fileFullPath, |
| "||", |
| "||", |
| allElementsTxt |
| allElementsTxt |
| })); |
| })); |
| Logs.SearchLog.Save(); |
| Logs.SearchLog.Save(); |
| } |
| } |
| }); |
| }); |
| } |
| } |
| |
| |
| // Token: 0x06000382 RID: 898 RVA: 0x0000B534 File Offset: 0x00009734 |
| // Token: 0x06000250 RID: 592 RVA: 0x00009308 File Offset: 0x00007508 |
| public void ExecuteAndMove(ZionRobot.Models.Items.File file, string outputPath) |
| public void ExecuteAndMove(ZionRobot.Models.Items.File file, string outputPath) |
| { |
| { |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
| foreach (ActionsElement actionElement in this.Source.ActionsElements) |
| foreach (ActionsElement actionElement in this.Source.ActionsElements) |
| { |
| { |
| foreach (ZionRobot.Models.Source.Action action in actionElement.Actions) |
| foreach (ZionRobot.Models.Source.Action action in actionElement.Actions) |
| { |
| { |
| Task<bool> task = this.executeAction(action); |
| Task<bool> task = this.executeAction(action); |
| task.Wait(); |
| task.Wait(); |
| bool execute = task.Result; |
| bool execute = task.Result; |
| } |
| } |
| } |
| } |
| Activity activity = new Activity(); |
| Activity activity = new Activity(); |
| activity.Date = this.dictionaryValues["ActivityDate"]; |
| activity.Date = this.dictionaryValues["ActivityDate"]; |
| activity.DateFinal = this.dictionaryValues["ActivityDate"]; |
| activity.DateFinal = this.dictionaryValues["ActivityDate"]; |
| activity.TypeId = 152; |
| activity.TypeId = 152; |
| activity.Subject = "Verificar"; |
| activity.Subject = "Verificar"; |
| activity.Client = this.dictionaryValues["Cliente"]; |
| activity.Client = this.dictionaryValues["Cliente"]; |
| activity.Sponsor = this.dictionaryValues["userName"]; |
| activity.Sponsor = this.dictionaryValues["userName"]; |
| activity.Fields.Add("1", activity.Sponsor); |
| activity.Fields.Add("1", activity.Sponsor); |
| activity.Fields.Add("2", activity.Client); |
| activity.Fields.Add("2", activity.Client); |
| activity.Fields.Add("3", this.dictionaryValues["Número da pasta"]); |
| activity.Fields.Add("3", this.dictionaryValues["Número da pasta"]); |
| activity.Fields.Add("4", this.dictionaryValues["URL da atividade"]); |
| activity.Fields.Add("4", this.dictionaryValues["URL da atividade"]); |
| activity.Fields.Add("5", (this.dictionaryValues.FirstOrDefault((KeyValuePair<string, string> x) => x.Key == "ProcessUrl").Key != null) ? this.dictionaryValues["ProcessUrl"] : ""); |
| activity.Fields.Add("5", (this.dictionaryValues.FirstOrDefault((KeyValuePair<string, string> x) => x.Key == "ProcessUrl").Key != null) ? this.dictionaryValues["ProcessUrl"] : ""); |
| activity.Fields.Add("6", (this.dictionaryValues.FirstOrDefault((KeyValuePair<string, string> x) => x.Key == "SharpointUrl").Key != null) ? this.dictionaryValues["SharpointUrl"] : ""); |
| activity.Fields.Add("6", (this.dictionaryValues.FirstOrDefault((KeyValuePair<string, string> x) => x.Key == "SharpointUrl").Key != null) ? this.dictionaryValues["SharpointUrl"] : ""); |
| activity.Fields.Add("7", Shift.formatDate(this.dictionaryValues["Data da publicação"], "yyyy-MM-dd HH:mm:ss", "pt-BR")); |
| activity.Fields.Add("7", Shift.formatDate(this.dictionaryValues["Data da publicação"], "yyyy-MM-dd HH:mm:ss", "pt-BR")); |
. | activity.Fields.Add("9", this.dictionaryValues["SearchElements.Fields.Conteudo"]); |
| activity.Fields.Add("9", this.dictionaryValues["SearchElements.Fields.ConteudoCompleto"]); |
| activity.Fields.Add("10", (this.dictionaryValues.FirstOrDefault((KeyValuePair<string, string> x) => x.Key == "Parecer").Key != null) ? this.dictionaryValues["Parecere"] : ""); |
| activity.Fields.Add("10", (this.dictionaryValues.FirstOrDefault((KeyValuePair<string, string> x) => x.Key == "Parecer").Key != null) ? this.dictionaryValues["Parecere"] : ""); |
| try |
| try |
| { |
| { |
| activity.createActivity(); |
| activity.createActivity(); |
| } |
| } |
| catch (Exception ex) |
| catch (Exception ex) |
| { |
| { |
| } |
| } |
| finally |
| finally |
| { |
| { |
| file.METAObject.Status = "INTEGRATED"; |
| file.METAObject.Status = "INTEGRATED"; |
| file.METAObject.Save(file.META, false, false); |
| file.METAObject.Save(file.META, false, false); |
| file.Status = "INTEGRATED"; |
| file.Status = "INTEGRATED"; |
| } |
| } |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x06000383 RID: 899 RVA: 0x0000B598 File Offset: 0x00009798 |
| // Token: 0x06000251 RID: 593 RVA: 0x0000936C File Offset: 0x0000756C |
. | public void ExecuteDemo() |
| |
| { |
| |
| Application.Current.Dispatcher.Invoke(delegate() |
| |
| { |
| |
| base.Visibility = Visibility.Visible; |
| |
| base.ShowInTaskbar = true; |
| |
| base.Show(); |
| |
| this.terminate = false; |
| |
| }); |
| |
| this.main = new Thread(delegate() |
| |
| { |
| |
| foreach (ActionsElement actionElement in this.Source.ActionsElements) |
| |
| { |
| |
| foreach (ZionRobot.Models.Source.Action action in actionElement.Actions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| } |
| |
| }); |
| |
| this.Main.Start(); |
| |
| } |
| |
| |
| |
| // Token: 0x06000384 RID: 900 RVA: 0x0000B5E8 File Offset: 0x000097E8 |
| |
| public void SyncActivity(Activity activity) |
| public void SyncActivity(Activity activity) |
| { |
| { |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
| bool execute = true; |
| bool execute = true; |
| this.DictionaryValues.Add("ActivityUrl", activity.DataJuri); |
| this.DictionaryValues.Add("ActivityUrl", activity.DataJuri); |
| this.DictionaryValues.Add("Responsável", activity.Sponsor); |
| this.DictionaryValues.Add("Responsável", activity.Sponsor); |
| this.DictionaryValues.Add("EmailResponsável", activity.SponsorEmail); |
| this.DictionaryValues.Add("EmailResponsável", activity.SponsorEmail); |
| this.DictionaryValues.Add("Cliente", activity.Client); |
| this.DictionaryValues.Add("Cliente", activity.Client); |
| this.DictionaryValues.Add("NumeroPasta", activity.ProcessNumber); |
| this.DictionaryValues.Add("NumeroPasta", activity.ProcessNumber); |
| this.DictionaryValues.Add("Data", Shift.formatDate(activity.Date, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("Data", Shift.formatDate(activity.Date, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("DataFatal", Shift.formatDate(activity.DateFinal, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("DataFatal", Shift.formatDate(activity.DateFinal, "dd/MM/yyyy", "pt-BR")); |
| foreach (ActionsElement actionElement in this.Source.ActionsElements) |
| foreach (ActionsElement actionElement in this.Source.ActionsElements) |
| { |
| { |
| foreach (ZionRobot.Models.Source.Action action in actionElement.Actions) |
| foreach (ZionRobot.Models.Source.Action action in actionElement.Actions) |
| { |
| { |
| Task<bool> task = this.executeAction(action); |
| Task<bool> task = this.executeAction(action); |
| task.Wait(); |
| task.Wait(); |
| execute = task.Result; |
| execute = task.Result; |
| } |
| } |
| } |
| } |
| bool flag = activity.Parecer != null && activity.TypeId == 1; |
| bool flag = activity.Parecer != null && activity.TypeId == 1; |
| if (flag) |
| if (flag) |
| { |
| { |
| this.DictionaryValues.Add("ActivityParecer", activity.Parecer); |
| this.DictionaryValues.Add("ActivityParecer", activity.Parecer); |
| List<ZionRobot.Models.Source.Action> createParecerActions = (from be in this.Source.BlockElements |
| List<ZionRobot.Models.Source.Action> createParecerActions = (from be in this.Source.BlockElements |
| where be.Name == "CreateParecer" |
| where be.Name == "CreateParecer" |
| select be).FirstOrDefault<BlockElement>().Actions; |
| select be).FirstOrDefault<BlockElement>().Actions; |
| bool flag2 = createParecerActions != null; |
| bool flag2 = createParecerActions != null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| foreach (ZionRobot.Models.Source.Action action2 in createParecerActions) |
| foreach (ZionRobot.Models.Source.Action action2 in createParecerActions) |
| { |
| { |
| Task<bool> task2 = this.executeAction(action2); |
| Task<bool> task2 = this.executeAction(action2); |
| task2.Wait(); |
| task2.Wait(); |
| execute = task2.Result; |
| execute = task2.Result; |
| } |
| } |
| } |
| } |
| } |
| } |
| List<ZionRobot.Models.Source.Action> createCommentActions = (from be in this.Source.BlockElements |
| List<ZionRobot.Models.Source.Action> createCommentActions = (from be in this.Source.BlockElements |
| where be.Name == "CreateComment" |
| where be.Name == "CreateComment" |
| select be).FirstOrDefault<BlockElement>().Actions; |
| select be).FirstOrDefault<BlockElement>().Actions; |
| bool flag3 = createCommentActions != null; |
| bool flag3 = createCommentActions != null; |
| if (flag3) |
| if (flag3) |
| { |
| { |
| (from c in activity.Comments |
| (from c in activity.Comments |
| orderby c.CreatedAt |
| orderby c.CreatedAt |
| select c).ToList<Comment>().ForEach(delegate(Comment comment) |
| select c).ToList<Comment>().ForEach(delegate(Comment comment) |
| { |
| { |
| this.DictionaryValues.Add("CommentResponser", comment.CreatedByName); |
| this.DictionaryValues.Add("CommentResponser", comment.CreatedByName); |
| this.DictionaryValues.Add("CommentSubject", comment.Subject); |
| this.DictionaryValues.Add("CommentSubject", comment.Subject); |
| this.DictionaryValues.Add("CommentValue", comment.Value); |
| this.DictionaryValues.Add("CommentValue", comment.Value); |
| foreach (ZionRobot.Models.Source.Action action4 in createCommentActions) |
| foreach (ZionRobot.Models.Source.Action action4 in createCommentActions) |
| { |
| { |
| Task<bool> task4 = this.executeAction(action4); |
| Task<bool> task4 = this.executeAction(action4); |
| task4.Wait(); |
| task4.Wait(); |
| execute = task4.Result; |
| execute = task4.Result; |
| } |
| } |
| this.DictionaryValues.Remove("CommentResponser"); |
| this.DictionaryValues.Remove("CommentResponser"); |
| this.DictionaryValues.Remove("CommentSubject"); |
| this.DictionaryValues.Remove("CommentSubject"); |
| this.DictionaryValues.Remove("CommentValue"); |
| this.DictionaryValues.Remove("CommentValue"); |
| }); |
| }); |
| } |
| } |
| List<ZionRobot.Models.Source.Action> createDeadlineActions = (from be in this.Source.BlockElements |
| List<ZionRobot.Models.Source.Action> createDeadlineActions = (from be in this.Source.BlockElements |
| where be.Name == "CreateDeadline" |
| where be.Name == "CreateDeadline" |
| select be).FirstOrDefault<BlockElement>().Actions; |
| select be).FirstOrDefault<BlockElement>().Actions; |
| activity.Deadlines.ForEach(delegate(Deadline deadline) |
| activity.Deadlines.ForEach(delegate(Deadline deadline) |
| { |
| { |
| bool flag5 = createDeadlineActions != null; |
| bool flag5 = createDeadlineActions != null; |
| if (flag5) |
| if (flag5) |
| { |
| { |
| this.DictionaryValues.Add("DeadlineResponser", deadline.SponserName); |
| this.DictionaryValues.Add("DeadlineResponser", deadline.SponserName); |
| this.DictionaryValues.Add("DeadlineResponserEmail", deadline.SponserEmail); |
| this.DictionaryValues.Add("DeadlineResponserEmail", deadline.SponserEmail); |
| this.DictionaryValues.Add("DeadlineSubject", deadline.Subject); |
| this.DictionaryValues.Add("DeadlineSubject", deadline.Subject); |
| this.DictionaryValues.Add("DeadlineDate", Shift.formatDate(deadline.Pre, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("DeadlineDate", Shift.formatDate(deadline.Pre, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("DeadlineFinal", Shift.formatDate(deadline.Value, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("DeadlineFinal", Shift.formatDate(deadline.Value, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("SearchElements.Fields.Tipo", "Publicação"); |
| this.DictionaryValues.Add("SearchElements.Fields.Tipo", "Publicação"); |
| foreach (ZionRobot.Models.Source.Action action4 in createDeadlineActions) |
| foreach (ZionRobot.Models.Source.Action action4 in createDeadlineActions) |
| { |
| { |
| Task<bool> task4 = this.executeAction(action4); |
| Task<bool> task4 = this.executeAction(action4); |
| task4.Wait(); |
| task4.Wait(); |
| execute = task4.Result; |
| execute = task4.Result; |
| } |
| } |
| Activity subActivity = new Activity(); |
| Activity subActivity = new Activity(); |
| subActivity.EntityId = activity.EntityId; |
| subActivity.EntityId = activity.EntityId; |
| subActivity.ParentId = new int?(activity.Id); |
| subActivity.ParentId = new int?(activity.Id); |
| subActivity.Date = this.dictionaryValues["DeadlineDate"]; |
| subActivity.Date = this.dictionaryValues["DeadlineDate"]; |
| subActivity.DateFinal = this.dictionaryValues["DeadlineFinal"]; |
| subActivity.DateFinal = this.dictionaryValues["DeadlineFinal"]; |
| subActivity.TypeId = 4; |
| subActivity.TypeId = 4; |
| subActivity.Subject = this.dictionaryValues["DeadlineSubject"]; |
| subActivity.Subject = this.dictionaryValues["DeadlineSubject"]; |
| subActivity.Client = this.dictionaryValues["Cliente"]; |
| subActivity.Client = this.dictionaryValues["Cliente"]; |
| subActivity.Sponsor = this.dictionaryValues["DeadlineResponser"]; |
| subActivity.Sponsor = this.dictionaryValues["DeadlineResponser"]; |
| subActivity.Fields.Add("1", subActivity.Client); |
| subActivity.Fields.Add("1", subActivity.Client); |
| subActivity.Fields.Add("2", subActivity.Sponsor); |
| subActivity.Fields.Add("2", subActivity.Sponsor); |
| subActivity.Fields.Add("3", (!string.IsNullOrEmpty(activity.ProcessNumber)) ? activity.ProcessNumber : ""); |
| subActivity.Fields.Add("3", (!string.IsNullOrEmpty(activity.ProcessNumber)) ? activity.ProcessNumber : ""); |
| subActivity.Fields.Add("4", this.dictionaryValues["URL da atividade"]); |
| subActivity.Fields.Add("4", this.dictionaryValues["URL da atividade"]); |
| subActivity.Fields.Add("5", (activity.ProcessURL != null) ? activity.ProcessURL : ""); |
| subActivity.Fields.Add("5", (activity.ProcessURL != null) ? activity.ProcessURL : ""); |
| subActivity.Fields.Add("6", (activity.Sharepoint != null) ? activity.Sharepoint : ""); |
| subActivity.Fields.Add("6", (activity.Sharepoint != null) ? activity.Sharepoint : ""); |
| subActivity.createActivity(); |
| subActivity.createActivity(); |
| this.DictionaryValues.Remove("DeadlineResponser"); |
| this.DictionaryValues.Remove("DeadlineResponser"); |
| this.DictionaryValues.Remove("DeadlineResponserEmail"); |
| this.DictionaryValues.Remove("DeadlineResponserEmail"); |
| this.DictionaryValues.Remove("DeadlineSubject"); |
| this.DictionaryValues.Remove("DeadlineSubject"); |
| this.DictionaryValues.Remove("DeadlineDate"); |
| this.DictionaryValues.Remove("DeadlineDate"); |
| this.DictionaryValues.Remove("DeadlineFinal"); |
| this.DictionaryValues.Remove("DeadlineFinal"); |
| this.DictionaryValues.Remove("SearchElements.Fields.Tipo"); |
| this.DictionaryValues.Remove("SearchElements.Fields.Tipo"); |
| this.DictionaryValues.Remove("Número da pasta"); |
| this.DictionaryValues.Remove("Número da pasta"); |
| this.DictionaryValues.Remove("URL da atividade"); |
| this.DictionaryValues.Remove("URL da atividade"); |
| this.DictionaryValues.Remove("1"); |
| this.DictionaryValues.Remove("1"); |
| this.DictionaryValues.Remove("2"); |
| this.DictionaryValues.Remove("2"); |
| this.DictionaryValues.Remove("3"); |
| this.DictionaryValues.Remove("3"); |
| this.DictionaryValues.Remove("4"); |
| this.DictionaryValues.Remove("4"); |
| this.DictionaryValues.Remove("5"); |
| this.DictionaryValues.Remove("5"); |
| this.DictionaryValues.Remove("6"); |
| this.DictionaryValues.Remove("6"); |
| } |
| } |
| }); |
| }); |
| List<ZionRobot.Models.Source.Action> doneActivityActions = (from be in this.Source.BlockElements |
| List<ZionRobot.Models.Source.Action> doneActivityActions = (from be in this.Source.BlockElements |
| where be.Name == "DoneActivity" |
| where be.Name == "DoneActivity" |
| select be).FirstOrDefault<BlockElement>().Actions; |
| select be).FirstOrDefault<BlockElement>().Actions; |
| bool flag4 = doneActivityActions != null; |
| bool flag4 = doneActivityActions != null; |
| if (flag4) |
| if (flag4) |
| { |
| { |
| foreach (ZionRobot.Models.Source.Action action3 in doneActivityActions) |
| foreach (ZionRobot.Models.Source.Action action3 in doneActivityActions) |
| { |
| { |
| Task<bool> task3 = this.executeAction(action3); |
| Task<bool> task3 = this.executeAction(action3); |
| task3.Wait(); |
| task3.Wait(); |
| execute = task3.Result; |
| execute = task3.Result; |
| } |
| } |
| } |
| } |
| activity.DoneActivity(); |
| activity.DoneActivity(); |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x06000385 RID: 901 RVA: 0x0000B64C File Offset: 0x0000984C |
| // Token: 0x06000252 RID: 594 RVA: 0x000093D0 File Offset: 0x000075D0 |
| public void OldUploadAttachments(Activity activity) |
| public void OldUploadAttachments(Activity activity) |
| { |
| { |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
| string clientFolder = (activity.ClientCode != null) ? (activity.ClientCode + " " + activity.Client) : activity.Client; |
| string clientFolder = (activity.ClientCode != null) ? (activity.ClientCode + " " + activity.Client) : activity.Client; |
| string numberFolder = "Consultas/" + clientFolder + "/" + activity.ProcessNumber; |
| string numberFolder = "Consultas/" + clientFolder + "/" + activity.ProcessNumber; |
| string attachmentsFolder = (activity.Action == "Sharepoint") ? "Anexos Recebidos" : "Anexos Enviados"; |
| string attachmentsFolder = (activity.Action == "Sharepoint") ? "Anexos Recebidos" : "Anexos Enviados"; |
| string subDir = (activity.Attachments.Count<ZionRobot.Models.ZFlow.Attachment>() == 0) ? numberFolder : (numberFolder + "/" + attachmentsFolder); |
| string subDir = (activity.Attachments.Count<ZionRobot.Models.ZFlow.Attachment>() == 0) ? numberFolder : (numberFolder + "/" + attachmentsFolder); |
| ZionSharePointManager manager = new ZionSharePointManager(SoaresPiconSharePoint.UserName, SoaresPiconSharePoint.Password); |
| ZionSharePointManager manager = new ZionSharePointManager(SoaresPiconSharePoint.UserName, SoaresPiconSharePoint.Password); |
| manager.ConnectToSharePointOnline(SoaresPiconSharePoint.ConsultaUrl); |
| manager.ConnectToSharePointOnline(SoaresPiconSharePoint.ConsultaUrl); |
| List collection = manager.GetCollection("Documentos"); |
| List collection = manager.GetCollection("Documentos"); |
| Microsoft.SharePoint.Client.Folder folder = manager.GetFolder(collection, subDir.Trim(new char[] |
| Microsoft.SharePoint.Client.Folder folder = manager.GetFolder(collection, subDir.Trim(new char[] |
| { |
| { |
| '/' |
| '/' |
| })); |
| })); |
| bool flag = folder.Name != subDir.Split(new char[] |
| bool flag = folder.Name != subDir.Split(new char[] |
| { |
| { |
| '/' |
| '/' |
| }).Last<string>() || !folder.Name.StartsWith(subDir.Split(new char[] |
| }).Last<string>() || !folder.Name.StartsWith(subDir.Split(new char[] |
| { |
| { |
| '/' |
| '/' |
| }).Last<string>()); |
| }).Last<string>()); |
| if (flag) |
| if (flag) |
| { |
| { |
| folder = manager.BuildFolder(collection, subDir); |
| folder = manager.BuildFolder(collection, subDir); |
| } |
| } |
| Microsoft.SharePoint.Client.File file; |
| Microsoft.SharePoint.Client.File file; |
| foreach (ZionRobot.Models.ZFlow.Attachment attach in activity.Attachments) |
| foreach (ZionRobot.Models.ZFlow.Attachment attach in activity.Attachments) |
| { |
| { |
| file = manager.UploadFile(folder, attach.Name, attach.Content); |
| file = manager.UploadFile(folder, attach.Name, attach.Content); |
| bool flag2 = file == null; |
| bool flag2 = file == null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| activity.UpdateActivitySycn(3); |
| activity.UpdateActivitySycn(3); |
| return; |
| return; |
| } |
| } |
| attach.Link = new Uri(SoaresPiconSharePoint.SiteUrl + file.ServerRelativeUrl); |
| attach.Link = new Uri(SoaresPiconSharePoint.SiteUrl + file.ServerRelativeUrl); |
| attach.UpdateLinkOnZion(); |
| attach.UpdateLinkOnZion(); |
| } |
| } |
| bool flag3 = folder.Name != numberFolder.Split(new char[] |
| bool flag3 = folder.Name != numberFolder.Split(new char[] |
| { |
| { |
| '/' |
| '/' |
| }).Last<string>() || !folder.Name.StartsWith(numberFolder.Split(new char[] |
| }).Last<string>() || !folder.Name.StartsWith(numberFolder.Split(new char[] |
| { |
| { |
| '/' |
| '/' |
| }).Last<string>()); |
| }).Last<string>()); |
| if (flag3) |
| if (flag3) |
| { |
| { |
| folder = manager.GetFolder(collection, numberFolder); |
| folder = manager.GetFolder(collection, numberFolder); |
| } |
| } |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| htmlDoc.LoadHtml(activity.EmailContent); |
| htmlDoc.LoadHtml(activity.EmailContent); |
| string result = htmlDoc.DocumentNode.SelectSingleNode("//body").InnerText; |
| string result = htmlDoc.DocumentNode.SelectSingleNode("//body").InnerText; |
| byte[] emailContent = Encoding.UTF8.GetBytes(result); |
| byte[] emailContent = Encoding.UTF8.GetBytes(result); |
| file = manager.UploadFile(folder, activity.EmailSubject + ".txt", Convert.ToBase64String(emailContent)); |
| file = manager.UploadFile(folder, activity.EmailSubject + ".txt", Convert.ToBase64String(emailContent)); |
| activity.Sharepoint = new Uri(SoaresPiconSharePoint.SiteUrl + "/" + folder.ServerRelativeUrl).AbsoluteUri; |
| activity.Sharepoint = new Uri(SoaresPiconSharePoint.SiteUrl + "/" + folder.ServerRelativeUrl).AbsoluteUri; |
| activity.UpdateActivityFieldValue("Link do Sharepoint", activity.Sharepoint); |
| activity.UpdateActivityFieldValue("Link do Sharepoint", activity.Sharepoint); |
| activity.UpdateActivitySycn(2); |
| activity.UpdateActivitySycn(2); |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x06000386 RID: 902 RVA: 0x0000B6B0 File Offset: 0x000098B0 |
| // Token: 0x06000253 RID: 595 RVA: 0x00009434 File Offset: 0x00007634 |
| public void UploadAttachments(Activity activity) |
| public void UploadAttachments(Activity activity) |
| { |
| { |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
. | try |
| string clientFolder = (activity.ClientCode != null) ? (activity.ClientCode + " " + activity.Client) : activity.Client; |
| |
| string numberFolder = "Consultas/" + clientFolder + "/" + activity.ProcessNumber; |
| |
| string emailContent = null; |
| |
| bool flag = string.IsNullOrEmpty(activity.EmailReplyContent); |
| |
| string attachmentsFolder; |
| |
| if (flag) |
| { |
| { |
. | string clientFolder = (activity.ClientCode != null && activity.ClientCode != string.Empty) ? (activity.ClientCode + " " + activity.Client) : activity.Client; |
| attachmentsFolder = "Anexos Recebidos"; |
| string numberFolder = "Consultas/" + clientFolder + "/" + activity.ProcessNumber; |
| emailContent = activity.EmailContent; |
| string emailContent = null; |
| } |
| string emailSubject = null; |
| else |
| bool flag = string.IsNullOrEmpty(activity.EmailReplyContent); |
| { |
| string attachmentsFolder; |
| attachmentsFolder = "Anexos Enviados"; |
| if (flag) |
| emailContent = activity.EmailReplyContent; |
| { |
| } |
| attachmentsFolder = "Anexos Recebidos"; |
| string subDir = (activity.Attachments.Count<ZionRobot.Models.ZFlow.Attachment>() == 0) ? numberFolder : (numberFolder + "/" + attachmentsFolder); |
| emailContent = activity.EmailContent; |
| ZionSharePointManager manager = new ZionSharePointManager(SoaresPiconSharePoint.UserName, SoaresPiconSharePoint.Password); |
| emailSubject = activity.EmailSubject; |
| manager.ConnectToSharePointOnline(SoaresPiconSharePoint.ConsultaUrl); |
| } |
| List collection = manager.GetCollection("Documentos"); |
| else |
| Microsoft.SharePoint.Client.Folder folder = manager.GetFolder(collection, subDir.Trim(new char[] |
| { |
| { |
| attachmentsFolder = "Anexos Enviados"; |
| '/' |
| emailContent = activity.EmailReplyContent; |
| })); |
| emailSubject = activity.EmailSubject; |
| bool flag2 = folder.Name != subDir.Split(new char[] |
| } |
| { |
| string subDir = (activity.Attachments.Count<ZionRobot.Models.ZFlow.Attachment>() == 0) ? numberFolder : (numberFolder + "/" + attachmentsFolder); |
| '/' |
| ZionSharePointManager manager = new ZionSharePointManager(SoaresPiconSharePoint.UserName, SoaresPiconSharePoint.Password); |
| }).Last<string>() || !folder.Name.StartsWith(subDir.Split(new char[] |
| manager.ConnectToSharePointOnline(SoaresPiconSharePoint.ConsultaUrl); |
| { |
| List collection = manager.GetCollection("Documentos"); |
| '/' |
| Microsoft.SharePoint.Client.Folder folder = manager.GetFolder(collection, subDir.Trim(new char[] |
| }).Last<string>()); |
| { |
| if (flag2) |
| '/' |
| { |
| })); |
| folder = manager.BuildFolder(collection, subDir); |
| bool flag2 = folder.Name != subDir.Split(new char[] |
| } |
| { |
| foreach (ZionRobot.Models.ZFlow.Attachment attach in activity.Attachments) |
| '/' |
| { |
| }).Last<string>() || !folder.Name.StartsWith(subDir.Split(new char[] |
| Microsoft.SharePoint.Client.File file = manager.UploadFile(folder, attach.Name, attach.Content); |
| { |
| bool flag3 = file == null; |
| '/' |
| if (flag3) |
| }).Last<string>()); |
| |
| if (flag2) |
| |
| { |
| { |
. | folder = manager.BuildFolder(collection, subDir); |
| activity.UpdateActivitySycn(3); |
| |
| return; |
| } |
| } |
. | foreach (ZionRobot.Models.ZFlow.Attachment attach in activity.Attachments) |
| attach.Link = new Uri(SoaresPiconSharePoint.SiteUrl + file.ServerRelativeUrl); |
| { |
| attach.UpdateLinkOnZion(); |
| Microsoft.SharePoint.Client.File file = manager.UploadFile(folder, attach.Name, attach.Content); |
| } |
| bool flag3 = file == null; |
| bool flag4 = folder.Name != numberFolder.Split(new char[] |
| if (flag3) |
| { |
| |
| '/' |
| |
| }).Last<string>() || !folder.Name.StartsWith(numberFolder.Split(new char[] |
| |
| { |
| |
| '/' |
| |
| }).Last<string>()); |
| |
| if (flag4) |
| |
| { |
| |
| folder = manager.GetFolder(collection, numberFolder); |
| |
| } |
| |
| activity.Sharepoint = new Uri(SoaresPiconSharePoint.SiteUrl + "/" + folder.ServerRelativeUrl).AbsoluteUri; |
| |
| activity.UpdateActivityFieldValue("Link do Sharepoint", activity.Sharepoint); |
| |
| bool flag5 = string.IsNullOrEmpty(emailContent); |
| |
| if (flag5) |
| |
| { |
| |
| activity.UpdateActivitySycn(2); |
| |
| } |
| |
| else |
| |
| { |
| |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| |
| htmlDoc.LoadHtml(emailContent); |
| |
| string result = htmlDoc.DocumentNode.InnerHtml; |
| |
| string to = activity.EmailTo ?? "consultas@soarespicon.adv.br"; |
| |
| string from = "consultas@soarespicon.adv.br"; |
| |
| string subject = activity.EmailSubject; |
| |
| string body = result; |
| |
| string tempDir = "C:\\Temp\\Email"; |
| |
| using (SmtpClient client = new SmtpClient()) |
| |
| { |
| |
| MailMessage msg = new MailMessage(from, to, subject, body); |
| |
| msg.IsBodyHtml = true; |
| |
| msg.BodyEncoding = Encoding.UTF8; |
| |
| client.UseDefaultCredentials = true; |
| |
| client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory; |
| |
| client.PickupDirectoryLocation = tempDir; |
| |
| try |
| { |
| { |
. | activity.UpdateActivitySycn(3); |
| client.Send(msg); |
| return; |
| } |
| |
| catch (Exception ex) |
| |
| { |
| |
| Environment.Exit(-1); |
| } |
| } |
. | attach.Link = new Uri(SoaresPiconSharePoint.SiteUrl + file.ServerRelativeUrl); |
| |
| } |
| |
| bool flag4 = folder.Name != numberFolder.Split(new char[] |
| |
| { |
| |
| '/' |
| |
| }).Last<string>() || !folder.Name.StartsWith(numberFolder.Split(new char[] |
| |
| { |
| |
| '/' |
| |
| }).Last<string>()); |
| |
| if (flag4) |
| |
| { |
| |
| folder = manager.GetFolder(collection, numberFolder); |
| |
| } |
| } |
. | activity.Sharepoint = new Uri(SoaresPiconSharePoint.SiteUrl + "/" + folder.ServerRelativeUrl).AbsoluteUri; |
| FileInfo msgTemp = (from f in new DirectoryInfo(tempDir).GetFiles() |
| activity.UpdateActivityFieldValue("Link do Sharepoint", activity.Sharepoint); |
| orderby f.LastWriteTime descending |
| bool flag5 = string.IsNullOrEmpty(emailContent); |
| select f).First<FileInfo>(); |
| if (flag5) |
| Microsoft.SharePoint.Client.File file = manager.UploadFile(folder, activity.EmailSubject + ".eml", msgTemp.FullName); |
| |
| bool flag6 = file == null; |
| |
| if (flag6) |
| { |
| { |
. | activity.UpdateActivitySycn(2); |
| activity.UpdateActivitySycn(3); |
| } |
| } |
| else |
| else |
| { |
| { |
. | HtmlDocument htmlDoc = new HtmlDocument(); |
| System.IO.File.Delete(msgTemp.FullName); |
| htmlDoc.LoadHtml(emailContent); |
| activity.UpdateActivitySycn(2); |
| string result = htmlDoc.DocumentNode.InnerHtml; |
| |
| string to = activity.EmailTo ?? "consultas@soarespicon.adv.br"; |
| |
| string from = "consultas@soarespicon.adv.br"; |
| |
| string subject = emailSubject; |
| |
| string body = result; |
| |
| string tempDir = "C:\\Temp\\Email"; |
| |
| using (SmtpClient client = new SmtpClient()) |
| |
| { |
| |
| MailMessage msg = new MailMessage(from, to, subject, body); |
| |
| msg.IsBodyHtml = true; |
| |
| msg.BodyEncoding = Encoding.UTF8; |
| |
| client.UseDefaultCredentials = true; |
| |
| client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory; |
| |
| client.PickupDirectoryLocation = tempDir; |
| |
| try |
| |
| { |
| |
| client.Send(msg); |
| |
| } |
| |
| catch (Exception ex) |
| |
| { |
| |
| Environment.Exit(-1); |
| |
| } |
| |
| } |
| |
| FileInfo msgTemp = (from f in new DirectoryInfo(tempDir).GetFiles() |
| |
| orderby f.LastWriteTime descending |
| |
| select f).First<FileInfo>(); |
| |
| Microsoft.SharePoint.Client.File file = manager.UploadFile(folder, subject + ".eml", msgTemp.FullName); |
| |
| bool flag6 = file == null; |
| |
| if (flag6) |
| |
| { |
| |
| activity.UpdateActivitySycn(3); |
| |
| } |
| |
| else |
| |
| { |
| |
| System.IO.File.Delete(msgTemp.FullName); |
| |
| activity.UpdateActivitySycn(2); |
| |
| } |
| |
| } |
| } |
| } |
| } |
. | catch (Exception ex2) |
| |
| { |
| |
| activity.UpdateActivitySycn(12); |
| |
| } |
| |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x06000387 RID: 903 RVA: 0x0000B714 File Offset: 0x00009914 |
| // Token: 0x06000254 RID: 596 RVA: 0x00009498 File Offset: 0x00007698 |
| public void CreateSubActivity(Activity activity) |
| public void CreateSubActivity(Activity activity) |
| { |
| { |
| this.Activity = activity; |
| this.Activity = activity; |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
. | bool flag; |
| List<ZionRobot.Models.Source.Action> createActivityActions = new List<ZionRobot.Models.Source.Action>(); |
| if (string.IsNullOrEmpty(activity.ProcessURL) && string.IsNullOrEmpty(activity.CaseURL)) |
| createActivityActions = (from be in this.Source.BlockElements |
| |
| where be.Name == "CreateActivity" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| Dictionary<string, string> dictionary = this.DictionaryValues; |
| |
| string key = "UrlToCreate"; |
| |
| string value; |
| |
| if ((value = activity.ParentDataJuri) == null) |
| |
| { |
| |
| value = (activity.CaseURL ?? activity.ProcessURL); |
| |
| } |
| |
| dictionary.Add(key, value); |
| |
| bool flag = !string.IsNullOrEmpty(activity.Content); |
| |
| if (flag) |
| { |
| { |
. | if (activity.ParentId != null) |
| try |
| { |
| { |
. | int? parentId = activity.ParentId; |
| HtmlDocument doc = new HtmlDocument(); |
| int num = 0; |
| doc.LoadHtml(activity.Content); |
| if (!(parentId.GetValueOrDefault() <= num & parentId != null)) |
| this.DictionaryValues.Add("Content", doc.DocumentNode.InnerText.Replace(" ", string.Empty)); |
| { |
| } |
| goto IL_73; |
| catch (Exception) |
| } |
| { |
| |
| this.DictionaryValues.Add("Content", activity.Content); |
| } |
| } |
. | flag = string.IsNullOrEmpty(activity.ParentDataJuri); |
| |
| goto IL_74; |
| |
| } |
| } |
. | IL_73: |
| this.DictionaryValues.Add("ZionId", activity.Id.ToString()); |
| flag = false; |
| this.DictionaryValues.Add("Responser", activity.Sponsor); |
| IL_74: |
| this.DictionaryValues.Add("ResponserEmail", activity.SponsorEmail); |
| bool flag2 = flag; |
| this.DictionaryValues.Add("Subject", activity.Subject); |
| |
| this.DictionaryValues.Add("Date", Shift.formatDate(activity.Date, "dd/MM/yyyy", "pt-BR")); |
| |
| this.DictionaryValues.Add("DateFinal", Shift.formatDate(activity.DateFinal, "dd/MM/yyyy", "pt-BR")); |
| |
| this.DictionaryValues.Add("Group", activity.Group); |
| |
| this.DictionaryValues.Add("SearchElements.Fields.Tipo", "Publicação"); |
| |
| bool flag2 = !string.IsNullOrEmpty(activity.Hour); |
| if (flag2) |
| if (flag2) |
| { |
| { |
. | Console.WriteLine(); |
| this.DictionaryValues.Add("Hour", activity.Hour); |
| |
| } |
| |
| foreach (ZionRobot.Models.Source.Action action in createActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| bool flag3 = this.dictionaryValues.ContainsKey("URL da atividade"); |
| |
| if (flag3) |
| |
| { |
| |
| activity.DataJuri = this.dictionaryValues["URL da atividade"]; |
| |
| activity.UpdateActivityUrl(); |
| |
| activity.UpdateActivitySycn(2); |
| } |
| } |
| else |
| else |
| { |
| { |
. | List<ZionRobot.Models.Source.Action> createActivityActions = new List<ZionRobot.Models.Source.Action>(); |
| activity.UpdateActivitySycn(5); |
| createActivityActions = (from be in this.Source.BlockElements |
| |
| where be.Name == "CreateActivity" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| Dictionary<string, string> dictionary = this.DictionaryValues; |
| |
| string key = "UrlToCreate"; |
| |
| string value; |
| |
| if ((value = activity.ParentDataJuri) == null) |
| |
| { |
| |
| value = (activity.CaseURL ?? activity.ProcessURL); |
| |
| } |
| |
| dictionary.Add(key, value); |
| |
| bool flag3 = !string.IsNullOrEmpty(activity.Content); |
| |
| if (flag3) |
| |
| { |
| |
| try |
| |
| { |
| |
| HtmlDocument doc = new HtmlDocument(); |
| |
| doc.LoadHtml(activity.Content); |
| |
| this.DictionaryValues.Add("Content", doc.DocumentNode.InnerText.Replace(" ", string.Empty)); |
| |
| } |
| |
| catch (Exception) |
| |
| { |
| |
| this.DictionaryValues.Add("Content", activity.Content); |
| |
| } |
| |
| } |
| |
| this.DictionaryValues.Add("ZionId", activity.Id.ToString()); |
| |
| this.DictionaryValues.Add("Responser", activity.Sponsor); |
| |
| this.DictionaryValues.Add("ResponserEmail", activity.SponsorEmail); |
| |
| this.DictionaryValues.Add("Subject", activity.Subject); |
| |
| this.DictionaryValues.Add("Date", Shift.formatDate(activity.Date, "dd/MM/yyyy", "pt-BR")); |
| |
| this.DictionaryValues.Add("DateFinal", Shift.formatDate(activity.DateFinal, "dd/MM/yyyy", "pt-BR")); |
| |
| this.DictionaryValues.Add("Group", activity.Group); |
| |
| this.DictionaryValues.Add("SearchElements.Fields.Tipo", "Publicação"); |
| |
| bool flag4 = !string.IsNullOrEmpty(activity.Hour); |
| |
| if (flag4) |
| |
| { |
| |
| this.DictionaryValues.Add("Hour", activity.Hour); |
| |
| } |
| |
| foreach (ZionRobot.Models.Source.Action action in createActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| bool flag5 = this.dictionaryValues.ContainsKey("URL da atividade"); |
| |
| if (flag5) |
| |
| { |
| |
| activity.DataJuri = this.dictionaryValues["URL da atividade"]; |
| |
| activity.UpdateActivityUrl(); |
| |
| activity.UpdateActivitySycn(2); |
| |
| } |
| |
| else |
| |
| { |
| |
| activity.UpdateActivitySycn(5); |
| |
| } |
| |
| } |
| } |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x06000388 RID: 904 RVA: 0x0000B784 File Offset: 0x00009984 |
| // Token: 0x06000255 RID: 597 RVA: 0x00009508 File Offset: 0x00007708 |
| public void CreateCase(Activity activity) |
| public void CreateCase(Activity activity) |
| { |
| { |
| this.Activity = activity; |
| this.Activity = activity; |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
. | bool flag = string.IsNullOrEmpty(activity.Sharepoint); |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| |
| where be.Name == "CreateCase" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| |
| htmlDoc.LoadHtml(activity.EmailContent); |
| |
| string result = htmlDoc.DocumentNode.InnerText; |
| |
| this.DictionaryValues.Add("CaseURL", activity.CaseURL); |
| |
| this.DictionaryValues.Add("Responser", activity.Sponsor); |
| |
| this.DictionaryValues.Add("ResponserEmail", activity.SponsorEmail); |
| |
| this.DictionaryValues.Add("Area", this.translateArea(activity.Subject)); |
| |
| this.DictionaryValues.Add("CreatedAt", Shift.formatDate(activity.CreatedAt, "dd/MM/yyyy", "pt-BR")); |
| |
| this.DictionaryValues.Add("EmailSubject", activity.EmailSubject); |
| |
| this.DictionaryValues.Add("EmailContent", result); |
| |
| this.DictionaryValues.Add("Priority", activity.Priority); |
| |
| this.DictionaryValues.Add("Sharepoint", activity.Sharepoint); |
| |
| this.DictionaryValues.Add("Client", activity.Client); |
| |
| this.DictionaryValues.Add("FolderNumber", activity.ProcessNumber); |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| bool flag = this.dictionaryValues.ContainsKey("CaseUrl"); |
| if (flag) |
| if (flag) |
| { |
| { |
. | Console.WriteLine(); |
| activity.CaseURL = this.dictionaryValues["CaseUrl"]; |
| |
| activity.UpdateActivityFieldValue("Link do Caso", activity.CaseURL); |
| |
| activity.UpdateActivitySycn(2); |
| } |
| } |
| else |
| else |
| { |
| { |
. | List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| activity.UpdateActivitySycn(5); |
| where be.Name == "CreateCase" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| |
| htmlDoc.LoadHtml(activity.EmailContent); |
| |
| string result = htmlDoc.DocumentNode.InnerText; |
| |
| this.DictionaryValues.Add("CaseURL", activity.CaseURL); |
| |
| this.DictionaryValues.Add("Responser", activity.Sponsor); |
| |
| this.DictionaryValues.Add("ResponserEmail", activity.SponsorEmail); |
| |
| this.DictionaryValues.Add("Area", this.translateArea(activity.Subject)); |
| |
| this.DictionaryValues.Add("CreatedAt", Shift.formatDate(activity.CreatedAt, "dd/MM/yyyy", "pt-BR")); |
| |
| this.DictionaryValues.Add("EmailSubject", activity.EmailSubject); |
| |
| this.DictionaryValues.Add("EmailContent", result); |
| |
| this.DictionaryValues.Add("Priority", activity.Priority); |
| |
| this.DictionaryValues.Add("Sharepoint", activity.Sharepoint); |
| |
| this.DictionaryValues.Add("Client", activity.Client); |
| |
| this.DictionaryValues.Add("FolderNumber", activity.ProcessNumber); |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| bool flag2 = this.dictionaryValues.ContainsKey("CaseUrl"); |
| |
| if (flag2) |
| |
| { |
| |
| activity.CaseURL = this.dictionaryValues["CaseUrl"]; |
| |
| activity.UpdateActivityFieldValue("Link do Caso", activity.CaseURL); |
| |
| activity.UpdateActivitySycn(2); |
| |
| } |
| |
| else |
| |
| { |
| |
| activity.UpdateActivitySycn(5); |
| |
| } |
| |
| } |
| } |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x06000389 RID: 905 RVA: 0x0000B7F4 File Offset: 0x000099F4 |
| // Token: 0x06000256 RID: 598 RVA: 0x00009578 File Offset: 0x00007778 |
| public void CloseCase(Activity activity) |
| public void CloseCase(Activity activity) |
| { |
| { |
| this.Activity = activity; |
| this.Activity = activity; |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
. | bool flag = string.IsNullOrEmpty(activity.CaseURL); |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| if (flag) |
| where be.Name == "CloseCase" |
| { |
| select be).FirstOrDefault<BlockElement>().Actions; |
| Console.WriteLine(); |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| } |
| htmlDoc.LoadHtml(activity.EmailReplyContent); |
| else |
| string result = htmlDoc.DocumentNode.InnerText; |
| |
| this.DictionaryValues.Add("CaseUrl", activity.CaseURL); |
| |
| this.DictionaryValues.Add("Responser", activity.Sponsor); |
| |
| this.DictionaryValues.Add("SyncCreateAt", Shift.formatDate(activity.SyncCreateAt, "dd/MM/yyyy", "pt-BR")); |
| |
| this.DictionaryValues.Add("EmailReplyContent", result); |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| { |
| { |
. | List<ZionRobot.Models.Source.Action> UpdateActivityActions = (from be in this.Source.BlockElements |
| Task<bool> task = this.executeAction(action); |
| where be.Name == "CloseCase" |
| task.Wait(); |
| select be).FirstOrDefault<BlockElement>().Actions; |
| bool execute = task.Result; |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| |
| htmlDoc.LoadHtml(activity.EmailReplyContent); |
| |
| string result = htmlDoc.DocumentNode.InnerText; |
| |
| this.DictionaryValues.Add("CaseUrl", activity.CaseURL); |
| |
| this.DictionaryValues.Add("Responser", activity.Sponsor); |
| |
| this.DictionaryValues.Add("Client", activity.Client); |
| |
| this.DictionaryValues.Add("SyncCreateAt", Shift.formatDate(activity.SyncCreateAt, "dd/MM/yyyy", "pt-BR")); |
| |
| this.DictionaryValues.Add("EmailReplyContent", result); |
| |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| |
| { |
| |
| Task<bool> task = this.executeAction(action); |
| |
| task.Wait(); |
| |
| bool execute = task.Result; |
| |
| } |
| |
| activity.UpdateActivitySycn(2); |
| |
| } |
| } |
. | |
| activity.UpdateActivitySycn(2); |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x0600038A RID: 906 RVA: 0x0000B864 File Offset: 0x00009A64 |
| // Token: 0x06000257 RID: 599 RVA: 0x000095E8 File Offset: 0x000077E8 |
| private string translateArea(string area) |
| private string translateArea(string area) |
| { |
| { |
| uint num = <PrivateImplementationDetails>.ComputeStringHash(area); |
| uint num = <PrivateImplementationDetails>.ComputeStringHash(area); |
| if (num <= 1241302063U) |
| if (num <= 1241302063U) |
| { |
| { |
| if (num <= 794282553U) |
| if (num <= 794282553U) |
| { |
| { |
| if (num != 386975329U) |
| if (num != 386975329U) |
| { |
| { |
| if (num != 776646911U) |
| if (num != 776646911U) |
| { |
| { |
| if (num != 794282553U) |
| if (num != 794282553U) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| if (!(area == "Trabalhista - Justa Causa")) |
| if (!(area == "Trabalhista - Justa Causa")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| if (!(area == "Contratos - Plano de saúde (Convênios)")) |
| if (!(area == "Contratos - Plano de saúde (Convênios)")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| goto IL_18E; |
| goto IL_18E; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| if (!(area == "Contratos - Locação")) |
| if (!(area == "Contratos - Locação")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| goto IL_18E; |
| goto IL_18E; |
| } |
| } |
| } |
| } |
| else if (num != 914995025U) |
| else if (num != 914995025U) |
| { |
| { |
| if (num != 1224632208U) |
| if (num != 1224632208U) |
| { |
| { |
| if (num != 1241302063U) |
| if (num != 1241302063U) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| if (!(area == "Contratos - Outros")) |
| if (!(area == "Contratos - Outros")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| goto IL_18E; |
| goto IL_18E; |
| } |
| } |
| else |
| else |
| { |
| { |
| if (!(area == "Contratos - Compra e Venda")) |
| if (!(area == "Contratos - Compra e Venda")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| goto IL_18E; |
| goto IL_18E; |
| } |
| } |
| } |
| } |
| else if (!(area == "Trabalhista - Outros")) |
| else if (!(area == "Trabalhista - Outros")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| } |
| } |
| else if (num <= 2200322199U) |
| else if (num <= 2200322199U) |
| { |
| { |
| if (num != 1249023226U) |
| if (num != 1249023226U) |
| { |
| { |
| if (num != 2168012727U) |
| if (num != 2168012727U) |
| { |
| { |
| if (num != 2200322199U) |
| if (num != 2200322199U) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| if (!(area == "Trabalhista - Afastamento INSS")) |
| if (!(area == "Trabalhista - Afastamento INSS")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| } |
| } |
| else if (!(area == "Trabalhista - Estágio")) |
| else if (!(area == "Trabalhista - Estágio")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| if (!(area == "Contratos - Internacional")) |
| if (!(area == "Contratos - Internacional")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| goto IL_18E; |
| goto IL_18E; |
| } |
| } |
| } |
| } |
| else if (num != 2676606078U) |
| else if (num != 2676606078U) |
| { |
| { |
| if (num != 3041903933U) |
| if (num != 3041903933U) |
| { |
| { |
| if (num != 4101459249U) |
| if (num != 4101459249U) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| if (!(area == "Trabalhista - Outras Sanções")) |
| if (!(area == "Trabalhista - Outras Sanções")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| } |
| } |
| else if (!(area == "Trabalhista - Contrato de Trabalho")) |
| else if (!(area == "Trabalhista - Contrato de Trabalho")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| if (!(area == "Contratos - Prestação de Serviços")) |
| if (!(area == "Contratos - Prestação de Serviços")) |
| { |
| { |
| goto IL_196; |
| goto IL_196; |
| } |
| } |
| goto IL_18E; |
| goto IL_18E; |
| } |
| } |
| return "Trabalhista"; |
| return "Trabalhista"; |
| IL_18E: |
| IL_18E: |
| return "Contratos"; |
| return "Contratos"; |
| IL_196: |
| IL_196: |
| return area; |
| return area; |
| } |
| } |
| |
| |
| // Token: 0x0600038B RID: 907 RVA: 0x0000BA0C File Offset: 0x00009C0C |
| // Token: 0x06000258 RID: 600 RVA: 0x00009790 File Offset: 0x00007990 |
| public void UpdateActivity(Activity activity) |
| public void UpdateActivity(Activity activity) |
| { |
| { |
| this.Activity = activity; |
| this.Activity = activity; |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
. | Func<BlockElement, bool> <>9__3; |
| Func<BlockElement, bool> <>9__2; |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
. | List<ZionRobot.Models.Source.Action> actions; |
| IEnumerable<BlockElement> blockElements = this.Source.BlockElements; |
| if (!(activity.Status == "2")) |
| Func<BlockElement, bool> predicate; |
| { |
| if ((predicate = <>9__2) == null) |
| IEnumerable<BlockElement> blockElements = this.Source.BlockElements; |
| |
| Func<BlockElement, bool> predicate; |
| |
| if ((predicate = <>9__3) == null) |
| |
| { |
| |
| predicate = (<>9__3 = ((BlockElement be) => be.Name == ((activity.CaseURL != null) ? "UpdateActivityConsulta" : "UpdateActivity"))); |
| |
| } |
| |
| actions = blockElements.Where(predicate).FirstOrDefault<BlockElement>().Actions; |
| |
| } |
| |
| else |
| |
| { |
| { |
. | actions = (from be in this.Source.BlockElements |
| predicate = (<>9__2 = ((BlockElement be) => be.Name == ((activity.CaseURL != null) ? "UpdateActivityConsulta" : "UpdateActivity"))); |
| where be.Name == "FinalizeActivity" |
| |
| select be).FirstOrDefault<BlockElement>().Actions; |
| |
| } |
| } |
. | List<ZionRobot.Models.Source.Action> UpdateActivityActions = actions; |
| List<ZionRobot.Models.Source.Action> UpdateActivityActions = blockElements.Where(predicate).FirstOrDefault<BlockElement>().Actions; |
| this.DictionaryValues.Add("ZionId", activity.Id.ToString()); |
| this.DictionaryValues.Add("ZionId", activity.Id.ToString()); |
| this.DictionaryValues.Add("ActivityUrl", activity.DataJuri); |
| this.DictionaryValues.Add("ActivityUrl", activity.DataJuri); |
| this.DictionaryValues.Add("Responser", activity.Sponsor); |
| this.DictionaryValues.Add("Responser", activity.Sponsor); |
| this.DictionaryValues.Add("ResponserEmail", activity.SponsorEmail); |
| this.DictionaryValues.Add("ResponserEmail", activity.SponsorEmail); |
| this.DictionaryValues.Add("Subject", activity.Subject); |
| this.DictionaryValues.Add("Subject", activity.Subject); |
| this.DictionaryValues.Add("Date", Shift.formatDate(activity.Date, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("Date", Shift.formatDate(activity.Date, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("DateFinal", Shift.formatDate(activity.DateFinal, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("DateFinal", Shift.formatDate(activity.DateFinal, "dd/MM/yyyy", "pt-BR")); |
| this.DictionaryValues.Add("Group", activity.Group); |
| this.DictionaryValues.Add("Group", activity.Group); |
| this.DictionaryValues.Add("SearchElements.Fields.Tipo", "Publicação"); |
| this.DictionaryValues.Add("SearchElements.Fields.Tipo", "Publicação"); |
| this.DictionaryValues.Add("ActivityStatus", this.translateActivityStatus(activity.Status)); |
| this.DictionaryValues.Add("ActivityStatus", this.translateActivityStatus(activity.Status)); |
| this.DictionaryValues.Add("Client", activity.Client); |
| this.DictionaryValues.Add("Client", activity.Client); |
| this.DictionaryValues.Add("FolderNumber", activity.ProcessNumber); |
| this.DictionaryValues.Add("FolderNumber", activity.ProcessNumber); |
. | bool flag = !string.IsNullOrEmpty(activity.Hour); |
| bool flag = !string.IsNullOrEmpty(activity.Content); |
| if (flag) |
| if (flag) |
| { |
| { |
. | this.DictionaryValues.Add("Hour", activity.Hour); |
| |
| } |
| |
| bool flag2 = !string.IsNullOrEmpty(activity.Content); |
| |
| if (flag2) |
| |
| { |
| |
| try |
| try |
| { |
| { |
| HtmlDocument doc = new HtmlDocument(); |
| HtmlDocument doc = new HtmlDocument(); |
| doc.LoadHtml(activity.Content); |
| doc.LoadHtml(activity.Content); |
| this.DictionaryValues.Add("Content", doc.DocumentNode.InnerText.Replace(" ", string.Empty)); |
| this.DictionaryValues.Add("Content", doc.DocumentNode.InnerText.Replace(" ", string.Empty)); |
| } |
| } |
| catch (Exception) |
| catch (Exception) |
| { |
| { |
| this.DictionaryValues.Add("Content", activity.Content); |
| this.DictionaryValues.Add("Content", activity.Content); |
| } |
| } |
| } |
| } |
. | bool flag3 = activity.Comment != null; |
| bool flag2 = activity.Comment != null; |
| if (flag3) |
| if (flag2) |
| { |
| { |
| this.DictionaryValues.Add("CommentResponser", activity.CommentCreateBy); |
| this.DictionaryValues.Add("CommentResponser", activity.CommentCreateBy); |
| this.DictionaryValues.Add("CommentSubject", activity.Subject); |
| this.DictionaryValues.Add("CommentSubject", activity.Subject); |
| this.DictionaryValues.Add("CommentValue", activity.Comment); |
| this.DictionaryValues.Add("CommentValue", activity.Comment); |
| } |
| } |
. | bool flag4 = !string.IsNullOrEmpty(activity.Parecer); |
| bool flag3 = !string.IsNullOrEmpty(activity.Parecer); |
| if (flag4) |
| if (flag3) |
| { |
| { |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| HtmlDocument htmlDoc = new HtmlDocument(); |
| htmlDoc.LoadHtml(activity.Parecer); |
| htmlDoc.LoadHtml(activity.Parecer); |
| string result = htmlDoc.DocumentNode.InnerText; |
| string result = htmlDoc.DocumentNode.InnerText; |
| this.DictionaryValues.Add("ActivityParecer", result); |
| this.DictionaryValues.Add("ActivityParecer", result); |
| } |
| } |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| foreach (ZionRobot.Models.Source.Action action in UpdateActivityActions) |
| { |
| { |
| Task<bool> task = this.executeAction(action); |
| Task<bool> task = this.executeAction(action); |
| task.Wait(); |
| task.Wait(); |
| bool execute = task.Result; |
| bool execute = task.Result; |
| } |
| } |
| activity.UpdateActivitySycn(2); |
| activity.UpdateActivitySycn(2); |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x0600038C RID: 908 RVA: 0x0000BA7C File Offset: 0x00009C7C |
| // Token: 0x06000259 RID: 601 RVA: 0x00009800 File Offset: 0x00007A00 |
| private string translateActivityStatus(string status) |
| private string translateActivityStatus(string status) |
| { |
| { |
| string text = status; |
| string text = status; |
| string text2 = text; |
| string text2 = text; |
| if ((text2 == null || text2.Length != 0) && !(text2 == "0")) |
| if ((text2 == null || text2.Length != 0) && !(text2 == "0")) |
| { |
| { |
| if (!(text2 == "2") && !(text2 == "3")) |
| if (!(text2 == "2") && !(text2 == "3")) |
| { |
| { |
| if (!(text2 == "4")) |
| if (!(text2 == "4")) |
| { |
| { |
| status = "Não iniciado"; |
| status = "Não iniciado"; |
| } |
| } |
| else |
| else |
| { |
| { |
| status = "Aguardando"; |
| status = "Aguardando"; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| status = "Concluído"; |
| status = "Concluído"; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| status = "Cancelado"; |
| status = "Cancelado"; |
| } |
| } |
| return status; |
| return status; |
| } |
| } |
| |
| |
| // Token: 0x0600038D RID: 909 RVA: 0x0000BAF8 File Offset: 0x00009CF8 |
| // Token: 0x0600025A RID: 602 RVA: 0x0000987C File Offset: 0x00007A7C |
| public void SyncActivityCanceling(Activity activity) |
| public void SyncActivityCanceling(Activity activity) |
| { |
| { |
| Application.Current.Dispatcher.Invoke(delegate() |
| Application.Current.Dispatcher.Invoke(delegate() |
| { |
| { |
| this.Visibility = Visibility.Visible; |
| this.Visibility = Visibility.Visible; |
| this.ShowInTaskbar = true; |
| this.ShowInTaskbar = true; |
| this.Show(); |
| this.Show(); |
| this.terminate = false; |
| this.terminate = false; |
| }); |
| }); |
| this.main = new Thread(delegate() |
| this.main = new Thread(delegate() |
| { |
| { |
| bool execute = true; |
| bool execute = true; |
| this.DictionaryValues.Add("ActivityUrl", activity.DataJuri); |
| this.DictionaryValues.Add("ActivityUrl", activity.DataJuri); |
| List<ZionRobot.Models.Source.Action> authenticateActions = (from be in this.Source.BlockElements |
| List<ZionRobot.Models.Source.Action> authenticateActions = (from be in this.Source.BlockElements |
| where be.Name == "Authenticate" |
| where be.Name == "Authenticate" |
| select be).FirstOrDefault<BlockElement>().Actions; |
| select be).FirstOrDefault<BlockElement>().Actions; |
| foreach (ZionRobot.Models.Source.Action action in authenticateActions) |
| foreach (ZionRobot.Models.Source.Action action in authenticateActions) |
| { |
| { |
| Task<bool> task = this.executeAction(action); |
| Task<bool> task = this.executeAction(action); |
| task.Wait(); |
| task.Wait(); |
| execute = task.Result; |
| execute = task.Result; |
| } |
| } |
| List<ZionRobot.Models.Source.Action> createCommentActions = (from be in this.Source.BlockElements |
| List<ZionRobot.Models.Source.Action> createCommentActions = (from be in this.Source.BlockElements |
| where be.Name == "CreateComment" |
| where be.Name == "CreateComment" |
| select be).FirstOrDefault<BlockElement>().Actions; |
| select be).FirstOrDefault<BlockElement>().Actions; |
| bool flag = createCommentActions != null; |
| bool flag = createCommentActions != null; |
| if (flag) |
| if (flag) |
| { |
| { |
| (from c in activity.Comments |
| (from c in activity.Comments |
| orderby c.CreatedAt |
| orderby c.CreatedAt |
| select c).ToList<Comment>().ForEach(delegate(Comment comment) |
| select c).ToList<Comment>().ForEach(delegate(Comment comment) |
| { |
| { |
| this.DictionaryValues.Add("CommentResponser", comment.CreatedByName); |
| this.DictionaryValues.Add("CommentResponser", comment.CreatedByName); |
| this.DictionaryValues.Add("CommentSubject", comment.Subject); |
| this.DictionaryValues.Add("CommentSubject", comment.Subject); |
| this.DictionaryValues.Add("CommentValue", comment.Value); |
| this.DictionaryValues.Add("CommentValue", comment.Value); |
| foreach (ZionRobot.Models.Source.Action action3 in createCommentActions) |
| foreach (ZionRobot.Models.Source.Action action3 in createCommentActions) |
| { |
| { |
| Task<bool> task3 = this.executeAction(action3); |
| Task<bool> task3 = this.executeAction(action3); |
| task3.Wait(); |
| task3.Wait(); |
| execute = task3.Result; |
| execute = task3.Result; |
| } |
| } |
| this.DictionaryValues.Remove("CommentResponser"); |
| this.DictionaryValues.Remove("CommentResponser"); |
| this.DictionaryValues.Remove("CommentSubject"); |
| this.DictionaryValues.Remove("CommentSubject"); |
| this.DictionaryValues.Remove("CommentValue"); |
| this.DictionaryValues.Remove("CommentValue"); |
| }); |
| }); |
| } |
| } |
| List<ZionRobot.Models.Source.Action> cancelingActivityActions = (from be in this.Source.BlockElements |
| List<ZionRobot.Models.Source.Action> cancelingActivityActions = (from be in this.Source.BlockElements |
| where be.Name == "CancelingActivity" |
| where be.Name == "CancelingActivity" |
| select be).FirstOrDefault<BlockElement>().Actions; |
| select be).FirstOrDefault<BlockElement>().Actions; |
| bool flag2 = cancelingActivityActions != null; |
| bool flag2 = cancelingActivityActions != null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| foreach (ZionRobot.Models.Source.Action action2 in cancelingActivityActions) |
| foreach (ZionRobot.Models.Source.Action action2 in cancelingActivityActions) |
| { |
| { |
| Task<bool> task2 = this.executeAction(action2); |
| Task<bool> task2 = this.executeAction(action2); |
| task2.Wait(); |
| task2.Wait(); |
| execute = task2.Result; |
| execute = task2.Result; |
| } |
| } |
| } |
| } |
| activity.CanceledActivity(); |
| activity.CanceledActivity(); |
| }); |
| }); |
| this.Main.Start(); |
| this.Main.Start(); |
| } |
| } |
| |
| |
| // Token: 0x0600038E RID: 910 RVA: 0x0000BB5C File Offset: 0x00009D5C |
| // Token: 0x0600025B RID: 603 RVA: 0x000098E0 File Offset: 0x00007AE0 |
| [DebuggerStepThrough] |
| [DebuggerStepThrough] |
| private Task<bool> executeAction(ZionRobot.Models.Source.Action action) |
| private Task<bool> executeAction(ZionRobot.Models.Source.Action action) |
| { |
| { |
. | Browser.<executeAction>d__59 <executeAction>d__ = new Browser.<executeAction>d__59(); |
| Browser.<executeAction>d__48 <executeAction>d__ = new Browser.<executeAction>d__48(); |
| <executeAction>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <executeAction>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <executeAction>d__.<>4__this = this; |
| <executeAction>d__.<>4__this = this; |
| <executeAction>d__.action = action; |
| <executeAction>d__.action = action; |
| <executeAction>d__.<>1__state = -1; |
| <executeAction>d__.<>1__state = -1; |
. | <executeAction>d__.<>t__builder.Start<Browser.<executeAction>d__59>(ref <executeAction>d__); |
| <executeAction>d__.<>t__builder.Start<Browser.<executeAction>d__48>(ref <executeAction>d__); |
| return <executeAction>d__.<>t__builder.Task; |
| return <executeAction>d__.<>t__builder.Task; |
| } |
| } |
| |
| |
| // Token: 0x0600038F RID: 911 RVA: 0x0000BBA8 File Offset: 0x00009DA8 |
| // Token: 0x0600025C RID: 604 RVA: 0x0000992C File Offset: 0x00007B2C |
| private List<IHTMLElement> getHTMLElements(string where, IHTMLElementCollection elementCollection = null) |
| private List<IHTMLElement> getHTMLElements(string where, IHTMLElementCollection elementCollection = null) |
| { |
| { |
| HTMLDocument htmlDoc = this.GetHTMLDocument(); |
| HTMLDocument htmlDoc = this.GetHTMLDocument(); |
| bool flag = htmlDoc.all == null && elementCollection == null; |
| bool flag = htmlDoc.all == null && elementCollection == null; |
| List<IHTMLElement> result; |
| List<IHTMLElement> result; |
| if (flag) |
| if (flag) |
| { |
| { |
| result = new List<IHTMLElement>(); |
| result = new List<IHTMLElement>(); |
| } |
| } |
| else |
| else |
| { |
| { |
| List<IHTMLElementCollection> list = new List<IHTMLElementCollection> |
| List<IHTMLElementCollection> list = new List<IHTMLElementCollection> |
| { |
| { |
| (elementCollection != null) ? elementCollection : htmlDoc.all |
| (elementCollection != null) ? elementCollection : htmlDoc.all |
| }; |
| }; |
| result = CQuery.Find(where, list); |
| result = CQuery.Find(where, list); |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x06000390 RID: 912 RVA: 0x0000BBFC File Offset: 0x00009DFC |
| // Token: 0x0600025D RID: 605 RVA: 0x00009980 File Offset: 0x00007B80 |
| private bool checkDictionaryKey(ZionRobot.Models.Source.Action action) |
| private bool checkDictionaryKey(ZionRobot.Models.Source.Action action) |
| { |
| { |
| bool flag = this.dictionaryValues.ContainsKey(action.Value) && action.ResultTrue.Count > 0; |
| bool flag = this.dictionaryValues.ContainsKey(action.Value) && action.ResultTrue.Count > 0; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| action.ResultTrue.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| action.ResultTrue.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| { |
| { |
| this.executeAction(a).Wait(); |
| this.executeAction(a).Wait(); |
| }); |
| }); |
| result = true; |
| result = true; |
| } |
| } |
| else |
| else |
| { |
| { |
| bool flag2 = action.ResultFalse.Count > 0; |
| bool flag2 = action.ResultFalse.Count > 0; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| action.ResultFalse.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| action.ResultFalse.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| { |
| { |
| this.executeAction(a).Wait(); |
| this.executeAction(a).Wait(); |
| }); |
| }); |
| result = true; |
| result = true; |
| } |
| } |
| else |
| else |
| { |
| { |
| result = false; |
| result = false; |
| } |
| } |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x06000391 RID: 913 RVA: 0x0000BC84 File Offset: 0x00009E84 |
| // Token: 0x0600025E RID: 606 RVA: 0x00009A08 File Offset: 0x00007C08 |
. | private bool special2(ZionRobot.Models.Source.Action action) |
| |
| { |
| |
| bool result; |
| |
| try |
| |
| { |
| |
| string fileName = "C:\\Users\\onset\\Downloads\\Nao_feitos.json"; |
| |
| string text = System.IO.File.ReadAllText(fileName); |
| |
| JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer(); |
| |
| List<Dictionary<string, string>> json = jsonSerialiser.Deserialize<List<Dictionary<string, string>>>(text); |
| |
| using (List<Dictionary<string, string>>.Enumerator enumerator = json.GetEnumerator()) |
| |
| { |
| |
| while (enumerator.MoveNext()) |
| |
| { |
| |
| Browser.<>c__DisplayClass62_0 CS$<>8__locals1 = new Browser.<>c__DisplayClass62_0(); |
| |
| CS$<>8__locals1.item = enumerator.Current; |
| |
| List<Element> listElements = new List<Element>(); |
| |
| this.source.SearchElements.ForEach(delegate(Element element) |
| |
| { |
| |
| element.Value = CS$<>8__locals1.item[element.Where]; |
| |
| listElements.Add(new Element(element.Name, element.Where, element.Value, element.GoTo, element.IsHtml, element.Attribute)); |
| |
| }); |
| |
| this.searchElements.Add(listElements); |
| |
| } |
| |
| } |
| |
| result = true; |
| |
| } |
| |
| catch (Exception e) |
| |
| { |
| |
| result = false; |
| |
| } |
| |
| return result; |
| |
| } |
| |
| |
| |
| // Token: 0x06000392 RID: 914 RVA: 0x0000BD64 File Offset: 0x00009F64 |
| |
| private bool special(ZionRobot.Models.Source.Action action) |
| |
| { |
| |
| bool result; |
| |
| try |
| |
| { |
| |
| using (StreamReader sr = new StreamReader("C:\\Users\\onset\\Downloads\\ADVISE_02.02.txt")) |
| |
| { |
| |
| string currentLine; |
| |
| while ((currentLine = sr.ReadLine()) != null) |
| |
| { |
| |
| bool flag = currentLine == "DIÁRIO\tPROCESSO\tPUBLICAÇÃO EM\tCOMARCA\tVARA\tDISPONIBILIZAÇÃO EM\tPALAVRA CHAVE\tCADERNO\tCONTRATANTE\tUSUÁRIO\tEDIÇÃO\tPÁGINA INICIAL\tPÁGINA FINAL\tDESPACHO\tCONTEUDO" || currentLine == string.Empty; |
| |
| if (!flag) |
| |
| { |
| |
| string[] array = currentLine.Split(new char[] |
| |
| { |
| |
| '\t' |
| |
| }); |
| |
| List<Element> listElements = new List<Element>(); |
| |
| this.source.SearchElements.ForEach(delegate(Element element) |
| |
| { |
| |
| bool flag2 = element.Where == "-1"; |
| |
| if (flag2) |
| |
| { |
| |
| element.Value = ""; |
| |
| } |
| |
| else |
| |
| { |
| |
| int index = int.Parse(element.Where); |
| |
| element.Value = element.Name + ": " + array[index]; |
| |
| } |
| |
| listElements.Add(new Element(element.Name, element.Where, element.Value, element.GoTo, element.IsHtml, element.Attribute)); |
| |
| }); |
| |
| this.searchElements.Add(listElements); |
| |
| } |
| |
| } |
| |
| } |
| |
| result = true; |
| |
| } |
| |
| catch (Exception ex) |
| |
| { |
| |
| result = false; |
| |
| } |
| |
| return result; |
| |
| } |
| |
| |
| |
| // Token: 0x06000393 RID: 915 RVA: 0x0000BE48 File Offset: 0x0000A048 |
| |
| private bool readResultsFromDownloadFile(ZionRobot.Models.Source.Action action) |
| |
| { |
| |
| return true; |
| |
| } |
| |
| |
| |
| // Token: 0x06000394 RID: 916 RVA: 0x0000BE5C File Offset: 0x0000A05C |
| |
| private bool appendFromApi(ZionRobot.Models.Source.Action action) |
| private bool appendFromApi(ZionRobot.Models.Source.Action action) |
| { |
| { |
| bool result2; |
| bool result2; |
| try |
| try |
| { |
| { |
| string value = action.ReplaceWithDictionary(action.Where, this.DictionaryValues); |
| string value = action.ReplaceWithDictionary(action.Where, this.DictionaryValues); |
| string result = new Client(WSProperties.UrlApi)._request("GET", value, WSProperties.Token, null, string.Empty, null); |
| string result = new Client(WSProperties.UrlApi)._request("GET", value, WSProperties.Token, null, string.Empty, null); |
| JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer(); |
| JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer(); |
| Dictionary<string, string> json = jsonSerialiser.Deserialize<Dictionary<string, string>>(result); |
| Dictionary<string, string> json = jsonSerialiser.Deserialize<Dictionary<string, string>>(result); |
| json.ToList<KeyValuePair<string, string>>().ForEach(delegate(KeyValuePair<string, string> j) |
| json.ToList<KeyValuePair<string, string>>().ForEach(delegate(KeyValuePair<string, string> j) |
| { |
| { |
| this.dictionaryValues.Add(j.Key, j.Value); |
| this.dictionaryValues.Add(j.Key, j.Value); |
| }); |
| }); |
| result2 = true; |
| result2 = true; |
| } |
| } |
| catch (Exception ex) |
| catch (Exception ex) |
| { |
| { |
| result2 = false; |
| result2 = false; |
| } |
| } |
| return result2; |
| return result2; |
| } |
| } |
| |
| |
| // Token: 0x06000395 RID: 917 RVA: 0x0000BEE8 File Offset: 0x0000A0E8 |
| // Token: 0x0600025F RID: 607 RVA: 0x00009A94 File Offset: 0x00007C94 |
| private bool changeAttributeValue(ZionRobot.Models.Source.Action action) |
| private bool changeAttributeValue(ZionRobot.Models.Source.Action action) |
| { |
| { |
| IHTMLElement element = this.getHTMLElements(action.Where, null).FirstOrDefault<IHTMLElement>(); |
| IHTMLElement element = this.getHTMLElements(action.Where, null).FirstOrDefault<IHTMLElement>(); |
| bool flag = element == null; |
| bool flag = element == null; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| result = false; |
| result = false; |
| } |
| } |
| else |
| else |
| { |
| { |
| string[] parts = action.Value.Split("=".ToCharArray(), 2); |
| string[] parts = action.Value.Split("=".ToCharArray(), 2); |
| element.setAttribute(parts[0], (parts.Length == 1) ? string.Empty : parts[1], 1); |
| element.setAttribute(parts[0], (parts.Length == 1) ? string.Empty : parts[1], 1); |
| result = true; |
| result = true; |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x06000396 RID: 918 RVA: 0x0000BF50 File Offset: 0x0000A150 |
| // Token: 0x06000260 RID: 608 RVA: 0x00009AFC File Offset: 0x00007CFC |
| private bool readJson(ZionRobot.Models.Source.Action action) |
| private bool readJson(ZionRobot.Models.Source.Action action) |
| { |
| { |
| bool result2; |
| bool result2; |
| try |
| try |
| { |
| { |
| using (WebClient wc = new WebClient |
| using (WebClient wc = new WebClient |
| { |
| { |
| Encoding = Encoding.UTF8 |
| Encoding = Encoding.UTF8 |
| }) |
| }) |
| { |
| { |
| string result = this.ReplaceActionsValue(action); |
| string result = this.ReplaceActionsValue(action); |
| string json = wc.DownloadString(result); |
| string json = wc.DownloadString(result); |
| bool flag = string.IsNullOrEmpty(json); |
| bool flag = string.IsNullOrEmpty(json); |
| if (flag) |
| if (flag) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
. | IntimacoesCollection IC = System.Text.Json.JsonSerializer.Deserialize<IntimacoesCollection>(json, new JsonSerializerOptions |
| IntimacoesCollection IC = JsonSerializer.Deserialize<IntimacoesCollection>(json, new JsonSerializerOptions |
| { |
| { |
| PropertyNameCaseInsensitive = true |
| PropertyNameCaseInsensitive = true |
| }); |
| }); |
| IC.Intimacoes.ForEach(delegate(Intimacao intimacao) |
| IC.Intimacoes.ForEach(delegate(Intimacao intimacao) |
| { |
| { |
| List<Element> listElements = new List<Element>(); |
| List<Element> listElements = new List<Element>(); |
| this.source.SearchElements.ForEach(delegate(Element element) |
| this.source.SearchElements.ForEach(delegate(Element element) |
| { |
| { |
| element.Value = ((element.Where.ToUpper() == "ALL") ? intimacao.GetParamAASP() : intimacao.GetParamValue(element.Where)); |
| element.Value = ((element.Where.ToUpper() == "ALL") ? intimacao.GetParamAASP() : intimacao.GetParamValue(element.Where)); |
| listElements.Add(new Element(element.Name, element.Where, element.Value, element.GoTo, element.IsHtml, element.Attribute)); |
| listElements.Add(new Element(element.Name, element.Where, element.Value, element.GoTo, element.IsHtml, element.Attribute)); |
| }); |
| }); |
| this.searchElements.Add(listElements); |
| this.searchElements.Add(listElements); |
| }); |
| }); |
| } |
| } |
| result2 = true; |
| result2 = true; |
| } |
| } |
| catch (Exception ex) |
| catch (Exception ex) |
| { |
| { |
| result2 = false; |
| result2 = false; |
| } |
| } |
| return result2; |
| return result2; |
| } |
| } |
| |
| |
| // Token: 0x06000397 RID: 919 RVA: 0x0000BFF8 File Offset: 0x0000A1F8 |
| // Token: 0x06000261 RID: 609 RVA: 0x00009BA4 File Offset: 0x00007DA4 |
| private bool invokeOnClick(ZionRobot.Models.Source.Action action) |
| private bool invokeOnClick(ZionRobot.Models.Source.Action action) |
| { |
| { |
| IHTMLElement element = this.getHTMLElements(action.Where, null).FirstOrDefault<IHTMLElement>(); |
| IHTMLElement element = this.getHTMLElements(action.Where, null).FirstOrDefault<IHTMLElement>(); |
| return element != null; |
| return element != null; |
| } |
| } |
| |
| |
| // Token: 0x06000398 RID: 920 RVA: 0x0000C02C File Offset: 0x0000A22C |
| // Token: 0x06000262 RID: 610 RVA: 0x00009BD8 File Offset: 0x00007DD8 |
| private bool executeBLock(ZionRobot.Models.Source.Action action) |
| private bool executeBLock(ZionRobot.Models.Source.Action action) |
| { |
| { |
| BlockElement block = (from b in this.source.BlockElements |
| BlockElement block = (from b in this.source.BlockElements |
| where b.Name == action.Value |
| where b.Name == action.Value |
| select b).FirstOrDefault<BlockElement>(); |
| select b).FirstOrDefault<BlockElement>(); |
| bool flag = block != null; |
| bool flag = block != null; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| foreach (ZionRobot.Models.Source.Action a in block.Actions) |
| foreach (ZionRobot.Models.Source.Action a in block.Actions) |
| { |
| { |
| Task<bool> task = this.executeAction(a); |
| Task<bool> task = this.executeAction(a); |
| task.Wait(); |
| task.Wait(); |
| } |
| } |
| result = true; |
| result = true; |
| } |
| } |
| else |
| else |
| { |
| { |
| result = false; |
| result = false; |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x06000399 RID: 921 RVA: 0x0000C0D4 File Offset: 0x0000A2D4 |
| // Token: 0x06000263 RID: 611 RVA: 0x00009C80 File Offset: 0x00007E80 |
| [DebuggerStepThrough] |
| [DebuggerStepThrough] |
| private Task<bool> navigate(ZionRobot.Models.Source.Action action) |
| private Task<bool> navigate(ZionRobot.Models.Source.Action action) |
| { |
| { |
. | Browser.<navigate>d__70 <navigate>d__ = new Browser.<navigate>d__70(); |
| Browser.<navigate>d__56 <navigate>d__ = new Browser.<navigate>d__56(); |
| <navigate>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <navigate>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <navigate>d__.<>4__this = this; |
| <navigate>d__.<>4__this = this; |
| <navigate>d__.action = action; |
| <navigate>d__.action = action; |
| <navigate>d__.<>1__state = -1; |
| <navigate>d__.<>1__state = -1; |
. | <navigate>d__.<>t__builder.Start<Browser.<navigate>d__70>(ref <navigate>d__); |
| <navigate>d__.<>t__builder.Start<Browser.<navigate>d__56>(ref <navigate>d__); |
| return <navigate>d__.<>t__builder.Task; |
| return <navigate>d__.<>t__builder.Task; |
| } |
| } |
| |
| |
| // Token: 0x0600039A RID: 922 RVA: 0x0000C120 File Offset: 0x0000A320 |
| // Token: 0x06000264 RID: 612 RVA: 0x00009CCC File Offset: 0x00007ECC |
| private bool readResultsFromPage(ZionRobot.Models.Source.Action action) |
| private bool readResultsFromPage(ZionRobot.Models.Source.Action action) |
| { |
| { |
| List<IHTMLElement> hElements = this.getHTMLElements(action.Where, null).ToList<IHTMLElement>(); |
| List<IHTMLElement> hElements = this.getHTMLElements(action.Where, null).ToList<IHTMLElement>(); |
| bool flag = hElements.Count == 0; |
| bool flag = hElements.Count == 0; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| result = false; |
| result = false; |
| } |
| } |
| else |
| else |
| { |
| { |
| hElements.ForEach(delegate(IHTMLElement hElement) |
| hElements.ForEach(delegate(IHTMLElement hElement) |
| { |
| { |
| List<Element> listElements = new List<Element>(); |
| List<Element> listElements = new List<Element>(); |
| this.source.SearchElements.ForEach(delegate(Element element) |
| this.source.SearchElements.ForEach(delegate(Element element) |
| { |
| { |
| bool flag2 = string.IsNullOrEmpty(element.Attribute); |
| bool flag2 = string.IsNullOrEmpty(element.Attribute); |
| if (flag2) |
| if (flag2) |
| { |
| { |
| Browser <>4__this = this; |
| Browser <>4__this = this; |
| string where = element.Where; |
| string where = element.Where; |
. | if (Browser.<>o__71.<>p__0 == null) |
| if (Browser.<>o__57.<>p__0 == null) |
| { |
| { |
. | Browser.<>o__71.<>p__0 = CallSite<Func<CallSite, object, IHTMLElementCollection>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(IHTMLElementCollection), typeof(Browser))); |
| Browser.<>o__57.<>p__0 = CallSite<Func<CallSite, object, IHTMLElementCollection>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(IHTMLElementCollection), typeof(Browser))); |
| } |
| } |
. | IHTMLElement ihtmlelement = <>4__this.getHTMLElements(where, Browser.<>o__71.<>p__0.Target(Browser.<>o__71.<>p__0, hElement.all)).FirstOrDefault<IHTMLElement>(); |
| IHTMLElement ihtmlelement = <>4__this.getHTMLElements(where, Browser.<>o__57.<>p__0.Target(Browser.<>o__57.<>p__0, hElement.all)).FirstOrDefault<IHTMLElement>(); |
| element.Value = (((ihtmlelement != null) ? ihtmlelement.innerText : null) ?? string.Empty); |
| element.Value = (((ihtmlelement != null) ? ihtmlelement.innerText : null) ?? string.Empty); |
| } |
| } |
| else |
| else |
| { |
| { |
. | if (Browser.<>o__71.<>p__1 == null) |
| if (Browser.<>o__57.<>p__1 == null) |
| { |
| { |
. | Browser.<>o__71.<>p__1 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(Browser))); |
| Browser.<>o__57.<>p__1 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(Browser))); |
| } |
| } |
. | element.Value = Browser.<>o__71.<>p__1.Target(Browser.<>o__71.<>p__1, hElement.getAttribute(element.Attribute, 0)); |
| element.Value = Browser.<>o__57.<>p__1.Target(Browser.<>o__57.<>p__1, hElement.getAttribute(element.Attribute, 0)); |
| } |
| } |
| element.Value = Regex.Replace(element.Value, " Exibir comentários Inserir comentários ", string.Empty); |
| element.Value = Regex.Replace(element.Value, " Exibir comentários Inserir comentários ", string.Empty); |
| bool isHtml = element.IsHtml; |
| bool isHtml = element.IsHtml; |
| if (isHtml) |
| if (isHtml) |
| { |
| { |
| HtmlDocument doc = new HtmlDocument(); |
| HtmlDocument doc = new HtmlDocument(); |
| doc.LoadHtml(element.Value); |
| doc.LoadHtml(element.Value); |
| element.Value = doc.DocumentNode.InnerText; |
| element.Value = doc.DocumentNode.InnerText; |
| } |
| } |
| listElements.Add(new Element(element.Name, element.Where, element.Value, element.GoTo, element.IsHtml, element.Attribute)); |
| listElements.Add(new Element(element.Name, element.Where, element.Value, element.GoTo, element.IsHtml, element.Attribute)); |
| }); |
| }); |
| this.searchElements.Add(listElements); |
| this.searchElements.Add(listElements); |
| }); |
| }); |
| result = true; |
| result = true; |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x0600039B RID: 923 RVA: 0x0000C16C File Offset: 0x0000A36C |
| // Token: 0x06000265 RID: 613 RVA: 0x00009D18 File Offset: 0x00007F18 |
| private bool invoke(ZionRobot.Models.Source.Action action) |
| private bool invoke(ZionRobot.Models.Source.Action action) |
| { |
| { |
| bool flag = action.Where != null; |
| bool flag = action.Where != null; |
| if (flag) |
| if (flag) |
| { |
| { |
| IHTMLElement element = this.getHTMLElements(action.Where.Replace("@", ""), null).FirstOrDefault<IHTMLElement>(); |
| IHTMLElement element = this.getHTMLElements(action.Where.Replace("@", ""), null).FirstOrDefault<IHTMLElement>(); |
| bool flag2 = element != null; |
| bool flag2 = element != null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
. | if (Browser.<>o__72.<>p__0 == null) |
| if (Browser.<>o__58.<>p__0 == null) |
| { |
| { |
. | Browser.<>o__72.<>p__0 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(string), typeof(Browser))); |
| Browser.<>o__58.<>p__0 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(string), typeof(Browser))); |
| } |
| } |
. | string[] parts = Browser.<>o__72.<>p__0.Target(Browser.<>o__72.<>p__0, element.getAttribute("href", 0)).Split(new char[] |
| string[] parts = Browser.<>o__58.<>p__0.Target(Browser.<>o__58.<>p__0, element.getAttribute("href", 0)).Split(new char[] |
| { |
| { |
| '(' |
| '(' |
| }); |
| }); |
| string scriptName = parts[0].Replace("javascript:", string.Empty); |
| string scriptName = parts[0].Replace("javascript:", string.Empty); |
| string[] args = parts[1].Trim(new char[] |
| string[] args = parts[1].Trim(new char[] |
| { |
| { |
| ')' |
| ')' |
| }).Replace("'", string.Empty).Split(new char[] |
| }).Replace("'", string.Empty).Split(new char[] |
| { |
| { |
| ',' |
| ',' |
| }); |
| }); |
| IHTMLElement elementTemp = string.IsNullOrEmpty(action.Check) ? null : this.getHTMLElements(action.Check, null).First<IHTMLElement>(); |
| IHTMLElement elementTemp = string.IsNullOrEmpty(action.Check) ? null : this.getHTMLElements(action.Check, null).First<IHTMLElement>(); |
| this.browser.Dispatcher.Invoke(delegate() |
| this.browser.Dispatcher.Invoke(delegate() |
| { |
| { |
| WebBrowser webBrowser = this.browser; |
| WebBrowser webBrowser = this.browser; |
| string scriptName = scriptName; |
| string scriptName = scriptName; |
| object[] args = args; |
| object[] args = args; |
| webBrowser.InvokeScript(scriptName, args); |
| webBrowser.InvokeScript(scriptName, args); |
| }); |
| }); |
| bool flag3 = elementTemp != null; |
| bool flag3 = elementTemp != null; |
| if (flag3) |
| if (flag3) |
| { |
| { |
| while (CQuery.CompareInnerHtmlByElements(elementTemp, this.getHTMLElements(action.Check, null).First<IHTMLElement>())) |
| while (CQuery.CompareInnerHtmlByElements(elementTemp, this.getHTMLElements(action.Check, null).First<IHTMLElement>())) |
| { |
| { |
| Thread.Sleep(200); |
| Thread.Sleep(200); |
| } |
| } |
| return true; |
| return true; |
| } |
| } |
| return true; |
| return true; |
| } |
| } |
| } |
| } |
| bool flag4 = action.Value != null; |
| bool flag4 = action.Value != null; |
| if (flag4) |
| if (flag4) |
| { |
| { |
| bool flag5 = Regex.IsMatch(action.Value, "javascript"); |
| bool flag5 = Regex.IsMatch(action.Value, "javascript"); |
| if (flag5) |
| if (flag5) |
| { |
| { |
| string[] parts2 = action.Value.Split(new char[] |
| string[] parts2 = action.Value.Split(new char[] |
| { |
| { |
| '(' |
| '(' |
| }); |
| }); |
| string scriptName = parts2[0].Trim().Replace("javascript:", string.Empty).Trim(); |
| string scriptName = parts2[0].Trim().Replace("javascript:", string.Empty).Trim(); |
| string[] args = parts2[1].Trim(new char[] |
| string[] args = parts2[1].Trim(new char[] |
| { |
| { |
| ')' |
| ')' |
| }).Replace("'", string.Empty).Split(new char[] |
| }).Replace("'", string.Empty).Split(new char[] |
| { |
| { |
| ',' |
| ',' |
| }); |
| }); |
| IHTMLElement elementTemp2 = string.IsNullOrEmpty(action.Check) ? null : this.getHTMLElements(action.Check, null).First<IHTMLElement>(); |
| IHTMLElement elementTemp2 = string.IsNullOrEmpty(action.Check) ? null : this.getHTMLElements(action.Check, null).First<IHTMLElement>(); |
| this.browser.Dispatcher.Invoke(delegate() |
| this.browser.Dispatcher.Invoke(delegate() |
| { |
| { |
| WebBrowser webBrowser = this.browser; |
| WebBrowser webBrowser = this.browser; |
| string scriptName = scriptName; |
| string scriptName = scriptName; |
| object[] args = args; |
| object[] args = args; |
| webBrowser.InvokeScript(scriptName, args); |
| webBrowser.InvokeScript(scriptName, args); |
| }); |
| }); |
| bool flag6 = elementTemp2 != null; |
| bool flag6 = elementTemp2 != null; |
| if (flag6) |
| if (flag6) |
| { |
| { |
| while (CQuery.CompareInnerHtmlByElements(elementTemp2, this.getHTMLElements(action.Check, null).First<IHTMLElement>())) |
| while (CQuery.CompareInnerHtmlByElements(elementTemp2, this.getHTMLElements(action.Check, null).First<IHTMLElement>())) |
| { |
| { |
| Thread.Sleep(200); |
| Thread.Sleep(200); |
| } |
| } |
| return true; |
| return true; |
| } |
| } |
| return true; |
| return true; |
| } |
| } |
| } |
| } |
| return false; |
| return false; |
| } |
| } |
| |
| |
| // Token: 0x0600039C RID: 924 RVA: 0x0000C444 File Offset: 0x0000A644 |
| // Token: 0x06000266 RID: 614 RVA: 0x00009FF0 File Offset: 0x000081F0 |
| private bool fillInput(ZionRobot.Models.Source.Action action) |
| private bool fillInput(ZionRobot.Models.Source.Action action) |
| { |
| { |
| List<IHTMLElement> elements = this.getHTMLElements(action.Where, null); |
| List<IHTMLElement> elements = this.getHTMLElements(action.Where, null); |
| bool flag = elements.Count > 0; |
| bool flag = elements.Count > 0; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| elements.ForEach(delegate(IHTMLElement element) |
| elements.ForEach(delegate(IHTMLElement element) |
| { |
| { |
| element.setAttribute("value", this.ReplaceActionsValue(action), 1); |
| element.setAttribute("value", this.ReplaceActionsValue(action), 1); |
| }); |
| }); |
| result = true; |
| result = true; |
| } |
| } |
| else |
| else |
| { |
| { |
| result = false; |
| result = false; |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x0600039D RID: 925 RVA: 0x0000C4A4 File Offset: 0x0000A6A4 |
| // Token: 0x06000267 RID: 615 RVA: 0x0000A050 File Offset: 0x00008250 |
| private bool checkInput(ZionRobot.Models.Source.Action action) |
| private bool checkInput(ZionRobot.Models.Source.Action action) |
| { |
| { |
| IHTMLElement element = this.getHTMLElements(action.Where, null).FirstOrDefault<IHTMLElement>(); |
| IHTMLElement element = this.getHTMLElements(action.Where, null).FirstOrDefault<IHTMLElement>(); |
| bool flag = element == null; |
| bool flag = element == null; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| result = false; |
| result = false; |
| } |
| } |
| else |
| else |
| { |
| { |
. | string value = this.ReplaceActionsValue(action); |
| (element as HTMLInputElement).@checked = bool.Parse(action.Value); |
| string text = value.ToUpper(); |
| |
| string a = text; |
| |
| if (!(a == "0") && !(a == "NÃO")) |
| |
| { |
| |
| if (!(a == "1") && !(a == "SIM") && !(a == "TRUE")) |
| |
| { |
| |
| value = "False"; |
| |
| } |
| |
| else |
| |
| { |
| |
| value = "True"; |
| |
| } |
| |
| } |
| |
| else |
| |
| { |
| |
| value = "False"; |
| |
| } |
| |
| bool x = bool.Parse(value); |
| |
| (element as HTMLInputElement).@checked = bool.Parse(value); |
| |
| result = true; |
| result = true; |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x0600039E RID: 926 RVA: 0x0000C56C File Offset: 0x0000A76C |
| // Token: 0x06000268 RID: 616 RVA: 0x0000A09C File Offset: 0x0000829C |
| private bool selectOption(ZionRobot.Models.Source.Action action) |
| private bool selectOption(ZionRobot.Models.Source.Action action) |
| { |
| { |
| string value = action.ReplaceWithDictionary(action.Where, this.DictionaryValues); |
| string value = action.ReplaceWithDictionary(action.Where, this.DictionaryValues); |
| IHTMLElement element = this.getHTMLElements(value, null).FirstOrDefault<IHTMLElement>(); |
| IHTMLElement element = this.getHTMLElements(value, null).FirstOrDefault<IHTMLElement>(); |
| bool flag = element != null; |
| bool flag = element != null; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| element.setAttribute("selected", "Selected", 1); |
| element.setAttribute("selected", "Selected", 1); |
| result = true; |
| result = true; |
| } |
| } |
| else |
| else |
| { |
| { |
| result = false; |
| result = false; |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x0600039F RID: 927 RVA: 0x0000C5C0 File Offset: 0x0000A7C0 |
| // Token: 0x06000269 RID: 617 RVA: 0x0000A0F0 File Offset: 0x000082F0 |
| [DebuggerStepThrough] |
| [DebuggerStepThrough] |
| private Task<bool> clickButton(ZionRobot.Models.Source.Action action) |
| private Task<bool> clickButton(ZionRobot.Models.Source.Action action) |
| { |
| { |
. | Browser.<clickButton>d__76 <clickButton>d__ = new Browser.<clickButton>d__76(); |
| Browser.<clickButton>d__62 <clickButton>d__ = new Browser.<clickButton>d__62(); |
| <clickButton>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <clickButton>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <clickButton>d__.<>4__this = this; |
| <clickButton>d__.<>4__this = this; |
| <clickButton>d__.action = action; |
| <clickButton>d__.action = action; |
| <clickButton>d__.<>1__state = -1; |
| <clickButton>d__.<>1__state = -1; |
. | <clickButton>d__.<>t__builder.Start<Browser.<clickButton>d__76>(ref <clickButton>d__); |
| <clickButton>d__.<>t__builder.Start<Browser.<clickButton>d__62>(ref <clickButton>d__); |
| return <clickButton>d__.<>t__builder.Task; |
| return <clickButton>d__.<>t__builder.Task; |
| } |
| } |
| |
| |
| // Token: 0x060003A0 RID: 928 RVA: 0x0000C60C File Offset: 0x0000A80C |
| // Token: 0x0600026A RID: 618 RVA: 0x0000A13C File Offset: 0x0000833C |
| private bool executeIf(ZionRobot.Models.Source.Action action) |
| private bool executeIf(ZionRobot.Models.Source.Action action) |
| { |
| { |
| string @operator = (from Match match in Regex.Matches(action.Value, "([!=_<>]{1,2}=?)|\\d+") |
| string @operator = (from Match match in Regex.Matches(action.Value, "([!=_<>]{1,2}=?)|\\d+") |
| select match.Value).First<string>(); |
| select match.Value).First<string>(); |
| string[] parts = action.Value.Split(new string[] |
| string[] parts = action.Value.Split(new string[] |
| { |
| { |
| @operator |
| @operator |
| }, StringSplitOptions.RemoveEmptyEntries); |
| }, StringSplitOptions.RemoveEmptyEntries); |
| string value = string.Empty; |
| string value = string.Empty; |
| bool flag = parts.Count<string>() > 0; |
| bool flag = parts.Count<string>() > 0; |
| if (flag) |
| if (flag) |
| { |
| { |
| value = action.ReplaceWithDictionary(parts[0], this.DictionaryValues); |
| value = action.ReplaceWithDictionary(parts[0], this.DictionaryValues); |
| value = value.Replace(@operator, string.Empty); |
| value = value.Replace(@operator, string.Empty); |
| } |
| } |
| IHTMLElement element = this.getHTMLElements(action.Where, null).FirstOrDefault<IHTMLElement>(); |
| IHTMLElement element = this.getHTMLElements(action.Where, null).FirstOrDefault<IHTMLElement>(); |
| bool flag2 = element != null; |
| bool flag2 = element != null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| string fa = element.innerText; |
| string fa = element.innerText; |
| bool x = fa == value; |
| bool x = fa == value; |
| int y = parts.Count<string>(); |
| int y = parts.Count<string>(); |
| bool flag3 = @operator == "=_=" || (@operator == "==" && element.innerText == value) || (@operator == "==" && parts.Count<string>() > 1 && action.ReplaceWithDictionary(parts[0], this.DictionaryValues) == action.ReplaceWithDictionary(parts[1], this.DictionaryValues)) || (@operator == "===" && Regex.IsMatch(element.innerText, value)) || (@operator == "!=" && element.innerText != value) || (@operator == "!==" && !Regex.IsMatch(element.innerText, value)); |
| bool flag3 = @operator == "=_=" || (@operator == "==" && element.innerText == value) || (@operator == "==" && parts.Count<string>() > 1 && action.ReplaceWithDictionary(parts[0], this.DictionaryValues) == action.ReplaceWithDictionary(parts[1], this.DictionaryValues)) || (@operator == "===" && Regex.IsMatch(element.innerText, value)) || (@operator == "!=" && element.innerText != value) || (@operator == "!==" && !Regex.IsMatch(element.innerText, value)); |
| if (flag3) |
| if (flag3) |
| { |
| { |
| action.ResultTrue.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| action.ResultTrue.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| { |
| { |
| this.executeAction(a).Wait(); |
| this.executeAction(a).Wait(); |
| }); |
| }); |
| return true; |
| return true; |
| } |
| } |
| bool flag4 = action.ResultFalse.Count > 0; |
| bool flag4 = action.ResultFalse.Count > 0; |
| if (flag4) |
| if (flag4) |
| { |
| { |
| Console.WriteLine("ELLSEEEEEEE"); |
| Console.WriteLine("ELLSEEEEEEE"); |
| action.ResultFalse.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| action.ResultFalse.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| { |
| { |
| this.executeAction(a).Wait(); |
| this.executeAction(a).Wait(); |
| }); |
| }); |
| return true; |
| return true; |
| } |
| } |
| } |
| } |
| return false; |
| return false; |
| } |
| } |
| |
| |
| // Token: 0x060003A1 RID: 929 RVA: 0x0000C80C File Offset: 0x0000AA0C |
| // Token: 0x0600026B RID: 619 RVA: 0x0000A33C File Offset: 0x0000853C |
| [DebuggerStepThrough] |
| [DebuggerStepThrough] |
| private Task<bool> loopWithOperator(ZionRobot.Models.Source.Action action) |
| private Task<bool> loopWithOperator(ZionRobot.Models.Source.Action action) |
| { |
| { |
. | Browser.<loopWithOperator>d__78 <loopWithOperator>d__ = new Browser.<loopWithOperator>d__78(); |
| Browser.<loopWithOperator>d__64 <loopWithOperator>d__ = new Browser.<loopWithOperator>d__64(); |
| <loopWithOperator>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <loopWithOperator>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <loopWithOperator>d__.<>4__this = this; |
| <loopWithOperator>d__.<>4__this = this; |
| <loopWithOperator>d__.action = action; |
| <loopWithOperator>d__.action = action; |
| <loopWithOperator>d__.<>1__state = -1; |
| <loopWithOperator>d__.<>1__state = -1; |
. | <loopWithOperator>d__.<>t__builder.Start<Browser.<loopWithOperator>d__78>(ref <loopWithOperator>d__); |
| <loopWithOperator>d__.<>t__builder.Start<Browser.<loopWithOperator>d__64>(ref <loopWithOperator>d__); |
| return <loopWithOperator>d__.<>t__builder.Task; |
| return <loopWithOperator>d__.<>t__builder.Task; |
| } |
| } |
| |
| |
| // Token: 0x060003A2 RID: 930 RVA: 0x0000C858 File Offset: 0x0000AA58 |
| // Token: 0x0600026C RID: 620 RVA: 0x0000A388 File Offset: 0x00008588 |
| [DebuggerStepThrough] |
| [DebuggerStepThrough] |
| private Task<bool> loopWithBoolean(ZionRobot.Models.Source.Action action) |
| private Task<bool> loopWithBoolean(ZionRobot.Models.Source.Action action) |
| { |
| { |
. | Browser.<loopWithBoolean>d__79 <loopWithBoolean>d__ = new Browser.<loopWithBoolean>d__79(); |
| Browser.<loopWithBoolean>d__65 <loopWithBoolean>d__ = new Browser.<loopWithBoolean>d__65(); |
| <loopWithBoolean>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <loopWithBoolean>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <loopWithBoolean>d__.<>4__this = this; |
| <loopWithBoolean>d__.<>4__this = this; |
| <loopWithBoolean>d__.action = action; |
| <loopWithBoolean>d__.action = action; |
| <loopWithBoolean>d__.<>1__state = -1; |
| <loopWithBoolean>d__.<>1__state = -1; |
. | <loopWithBoolean>d__.<>t__builder.Start<Browser.<loopWithBoolean>d__79>(ref <loopWithBoolean>d__); |
| <loopWithBoolean>d__.<>t__builder.Start<Browser.<loopWithBoolean>d__65>(ref <loopWithBoolean>d__); |
| return <loopWithBoolean>d__.<>t__builder.Task; |
| return <loopWithBoolean>d__.<>t__builder.Task; |
| } |
| } |
| |
| |
| // Token: 0x060003A3 RID: 931 RVA: 0x0000C8A4 File Offset: 0x0000AAA4 |
| // Token: 0x0600026D RID: 621 RVA: 0x0000A3D4 File Offset: 0x000085D4 |
| private bool checkDomain(ZionRobot.Models.Source.Action action) |
| private bool checkDomain(ZionRobot.Models.Source.Action action) |
| { |
| { |
| HTMLDocument doc = null; |
| HTMLDocument doc = null; |
| string domain = null; |
| string domain = null; |
| this.browser.Dispatcher.Invoke(delegate() |
| this.browser.Dispatcher.Invoke(delegate() |
| { |
| { |
| doc = (HTMLDocument)this.browser.Document; |
| doc = (HTMLDocument)this.browser.Document; |
| bool flag2 = doc != null; |
| bool flag2 = doc != null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| domain = doc.domain; |
| domain = doc.domain; |
| } |
| } |
| }); |
| }); |
| bool flag = domain == null || domain == string.Empty || domain != this.source.Domain; |
| bool flag = domain == null || domain == string.Empty || domain != this.source.Domain; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| action.ResultTrue.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| action.ResultTrue.ForEach(delegate(ZionRobot.Models.Source.Action a) |
| { |
| { |
| this.executeAction(a).Wait(); |
| this.executeAction(a).Wait(); |
| }); |
| }); |
| result = true; |
| result = true; |
| } |
| } |
| else |
| else |
| { |
| { |
| result = true; |
| result = true; |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x060003A4 RID: 932 RVA: 0x0000C944 File Offset: 0x0000AB44 |
| // Token: 0x0600026E RID: 622 RVA: 0x0000A474 File Offset: 0x00008674 |
| [DebuggerStepThrough] |
| [DebuggerStepThrough] |
| private Task<bool> goBack(ZionRobot.Models.Source.Action action) |
| private Task<bool> goBack(ZionRobot.Models.Source.Action action) |
| { |
| { |
. | Browser.<goBack>d__81 <goBack>d__ = new Browser.<goBack>d__81(); |
| Browser.<goBack>d__67 <goBack>d__ = new Browser.<goBack>d__67(); |
| <goBack>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <goBack>d__.<>t__builder = AsyncTaskMethodBuilder<bool>.Create(); |
| <goBack>d__.<>4__this = this; |
| <goBack>d__.<>4__this = this; |
| <goBack>d__.action = action; |
| <goBack>d__.action = action; |
| <goBack>d__.<>1__state = -1; |
| <goBack>d__.<>1__state = -1; |
. | <goBack>d__.<>t__builder.Start<Browser.<goBack>d__81>(ref <goBack>d__); |
| <goBack>d__.<>t__builder.Start<Browser.<goBack>d__67>(ref <goBack>d__); |
| return <goBack>d__.<>t__builder.Task; |
| return <goBack>d__.<>t__builder.Task; |
| } |
| } |
| |
| |
| // Token: 0x060003A5 RID: 933 RVA: 0x0000C990 File Offset: 0x0000AB90 |
| // Token: 0x0600026F RID: 623 RVA: 0x0000A4C0 File Offset: 0x000086C0 |
| private bool appendData(ZionRobot.Models.Source.Action action) |
| private bool appendData(ZionRobot.Models.Source.Action action) |
| { |
| { |
| string actionWhere = action.ReplaceWithDictionary(action.Where, this.DictionaryValues); |
| string actionWhere = action.ReplaceWithDictionary(action.Where, this.DictionaryValues); |
| bool flag = actionWhere == "currentUrl"; |
| bool flag = actionWhere == "currentUrl"; |
| bool result; |
| bool result; |
| if (flag) |
| if (flag) |
| { |
| { |
| this.DictionaryValues.Add(action.Value, this.getUrl()); |
| this.DictionaryValues.Add(action.Value, this.getUrl()); |
| result = true; |
| result = true; |
| } |
| } |
| else |
| else |
| { |
| { |
| IHTMLElement ihtmlelement; |
| IHTMLElement ihtmlelement; |
| if (action.Regex == null) |
| if (action.Regex == null) |
| { |
| { |
| ihtmlelement = this.getHTMLElements(actionWhere, null).FirstOrDefault<IHTMLElement>(); |
| ihtmlelement = this.getHTMLElements(actionWhere, null).FirstOrDefault<IHTMLElement>(); |
| } |
| } |
| else |
| else |
| { |
| { |
| ihtmlelement = (from e in this.getHTMLElements(actionWhere, null) |
| ihtmlelement = (from e in this.getHTMLElements(actionWhere, null) |
| where e.innerText != null && Regex.IsMatch(e.innerText, action.Regex) |
| where e.innerText != null && Regex.IsMatch(e.innerText, action.Regex) |
| select e).FirstOrDefault<IHTMLElement>(); |
| select e).FirstOrDefault<IHTMLElement>(); |
| } |
| } |
| IHTMLElement element = ihtmlelement; |
| IHTMLElement element = ihtmlelement; |
| bool flag2 = element != null; |
| bool flag2 = element != null; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| bool flag3 = this.DictionaryValues.FirstOrDefault((KeyValuePair<string, string> x) => x.Key == action.Value).Key != null; |
| bool flag3 = this.DictionaryValues.FirstOrDefault((KeyValuePair<string, string> x) => x.Key == action.Value).Key != null; |
| if (flag3) |
| if (flag3) |
| { |
| { |
| this.DictionaryValues.Remove(action.Value); |
| this.DictionaryValues.Remove(action.Value); |
| } |
| } |
| bool flag4 = action.Attribute != null; |
| bool flag4 = action.Attribute != null; |
| if (flag4) |
| if (flag4) |
| { |
| { |
. | if (Browser.<>o__82.<>p__0 == null) |
| if (Browser.<>o__68.<>p__0 == null) |
| { |
| { |
. | Browser.<>o__82.<>p__0 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(string), typeof(Browser))); |
| Browser.<>o__68.<>p__0 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(string), typeof(Browser))); |
| } |
| } |
. | string a = Browser.<>o__82.<>p__0.Target(Browser.<>o__82.<>p__0, element.getAttribute(action.Attribute, 0)); |
| string a = Browser.<>o__68.<>p__0.Target(Browser.<>o__68.<>p__0, element.getAttribute(action.Attribute, 0)); |
| this.DictionaryValues.Add(action.Value, a); |
| this.DictionaryValues.Add(action.Value, a); |
| } |
| } |
| else |
| else |
| { |
| { |
| this.DictionaryValues.Add(action.Value, element.innerText); |
| this.DictionaryValues.Add(action.Value, element.innerText); |
| } |
| } |
| result = true; |
| result = true; |
| } |
| } |
| else |
| else |
| { |
| { |
| result = false; |
| result = false; |
| } |
| } |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| // Token: 0x060003A6 RID: 934 RVA: 0x0000CB5C File Offset: 0x0000AD5C |
| // Token: 0x06000270 RID: 624 RVA: 0x0000A68C File Offset: 0x0000888C |
| private bool saveIntegrationLog(ZionRobot.Models.Source.Action action) |
| private bool saveIntegrationLog(ZionRobot.Models.Source.Action action) |
| { |
| { |
| string value = this.ReplaceActionsValue(action); |
| string value = this.ReplaceActionsValue(action); |
| System.IO.File.AppendAllText(Basic.LogsFolder + "IntegrationLog.csv", string.Format("{0}{1}\n", DateTime.Now, value)); |
| System.IO.File.AppendAllText(Basic.LogsFolder + "IntegrationLog.csv", string.Format("{0}{1}\n", DateTime.Now, value)); |
| return true; |
| return true; |
| } |
| } |
| |
| |
| // Token: 0x060003A7 RID: 935 RVA: 0x0000CBA4 File Offset: 0x0000ADA4 |
| // Token: 0x06000271 RID: 625 RVA: 0x0000A6D4 File Offset: 0x000088D4 |
| private string getUrl() |
| private string getUrl() |
| { |
| { |
| string url = string.Empty; |
| string url = string.Empty; |
| this.browser.Dispatcher.Invoke(delegate() |
| this.browser.Dispatcher.Invoke(delegate() |
| { |
| { |
| url = this.browser.Source.AbsoluteUri; |
| url = this.browser.Source.AbsoluteUri; |
| }); |
| }); |
| return url; |
| return url; |
| } |
| } |
| |
| |
| // Token: 0x060003A8 RID: 936 RVA: 0x0000CBF4 File Offset: 0x0000ADF4 |
| // Token: 0x06000272 RID: 626 RVA: 0x0000A724 File Offset: 0x00008924 |
| private HTMLDocument GetHTMLDocument() |
| private HTMLDocument GetHTMLDocument() |
| { |
| { |
| HTMLDocument doc = null; |
| HTMLDocument doc = null; |
| this.browser.Dispatcher.Invoke(DispatcherPriority.Normal, new System.Action(delegate() |
| this.browser.Dispatcher.Invoke(DispatcherPriority.Normal, new System.Action(delegate() |
| { |
| { |
| doc = (HTMLDocument)this.browser.Document; |
| doc = (HTMLDocument)this.browser.Document; |
| })); |
| })); |
| return doc; |
| return doc; |
| } |
| } |
| |
| |
| // Token: 0x060003A9 RID: 937 RVA: 0x0000CC40 File Offset: 0x0000AE40 |
| // Token: 0x06000273 RID: 627 RVA: 0x0000A770 File Offset: 0x00008970 |
| private bool hasLog(string text) |
| private bool hasLog(string text) |
| { |
| { |
| foreach (string r in Logs.SearchLog.SearchResults) |
| foreach (string r in Logs.SearchLog.SearchResults) |
| { |
| { |
| foreach (string v in r.Split(new string[] |
| foreach (string v in r.Split(new string[] |
| { |
| { |
| "||" |
| "||" |
| }, StringSplitOptions.None).ToList<string>()) |
| }, StringSplitOptions.None).ToList<string>()) |
| { |
| { |
| string ab = text.Replace(Environment.NewLine, ""); |
| string ab = text.Replace(Environment.NewLine, ""); |
| bool flag = v == ab; |
| bool flag = v == ab; |
| if (flag) |
| if (flag) |
| { |
| { |
| return true; |
| return true; |
| } |
| } |
| bool flag2 = v == text; |
| bool flag2 = v == text; |
| if (flag2) |
| if (flag2) |
| { |
| { |
| return true; |
| return true; |
| } |
| } |
| } |
| } |
| } |
| } |
| return false; |
| return false; |
| } |
| } |
| |
| |
| // Token: 0x060003AA RID: 938 RVA: 0x0000CD30 File Offset: 0x0000AF30 |
| // Token: 0x06000274 RID: 628 RVA: 0x0000A860 File Offset: 0x00008A60 |
| private string ReplaceActionsValue(ZionRobot.Models.Source.Action action) |
| private string ReplaceActionsValue(ZionRobot.Models.Source.Action action) |
| { |
| { |
| string value = string.Empty; |
| string value = string.Empty; |
| List<string> parts = (from Match m in Regex.Matches(action.Value, "\\{[^\\}]*\\}|([:=\\[\\(\\{]{0}[a-zA-Z0-9_%@\\-\\.\\/:?=&;]{1,})") |
| List<string> parts = (from Match m in Regex.Matches(action.Value, "\\{[^\\}]*\\}|([:=\\[\\(\\{]{0}[a-zA-Z0-9_%@\\-\\.\\/:?=&;]{1,})") |
| select m.Value).ToList<string>(); |
| select m.Value).ToList<string>(); |
| parts.ForEach(delegate(string part) |
| parts.ForEach(delegate(string part) |
| { |
| { |
| string temp = part.Trim(new char[] |
| string temp = part.Trim(new char[] |
| { |
| { |
| '{' |
| '{' |
| }).Trim(new char[] |
| }).Trim(new char[] |
| { |
| { |
| '}' |
| '}' |
| }); |
| }); |
| string add = string.Empty; |
| string add = string.Empty; |
| bool flag2 = Regex.IsMatch(temp, "\\$_Now"); |
| bool flag2 = Regex.IsMatch(temp, "\\$_Now"); |
| if (flag2) |
| if (flag2) |
| { |
| { |
| DateTime dateNow = DateTime.Now; |
| DateTime dateNow = DateTime.Now; |
| int day = 0; |
| int day = 0; |
| string[] p = temp.Split(new char[] |
| string[] p = temp.Split(new char[] |
| { |
| { |
| '?' |
| '?' |
| }); |
| }); |
| bool flag3 = p.Count<string>() == 1; |
| bool flag3 = p.Count<string>() == 1; |
| if (flag3) |
| if (flag3) |
| { |
| { |
| bool flag4 = Regex.IsMatch(p[0], "\\."); |
| bool flag4 = Regex.IsMatch(p[0], "\\."); |
| if (flag4) |
| if (flag4) |
| { |
| { |
| day = int.Parse(temp.Split(new char[] |
| day = int.Parse(temp.Split(new char[] |
| { |
| { |
| '.' |
| '.' |
| }).Last<string>()); |
| }).Last<string>()); |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| string @operator = (from Match match in Regex.Matches(p[0], "([!=<>]{1,2}[<>=]?)") |
| string @operator = (from Match match in Regex.Matches(p[0], "([!=<>]{1,2}[<>=]?)") |
| select match.Value).First<string>(); |
| select match.Value).First<string>(); |
| string[] s = p[0].Split(new string[] |
| string[] s = p[0].Split(new string[] |
| { |
| { |
| @operator |
| @operator |
| }, StringSplitOptions.RemoveEmptyEntries); |
| }, StringSplitOptions.RemoveEmptyEntries); |
| int hours = int.Parse(s[1]); |
| int hours = int.Parse(s[1]); |
| string[] days = p[1].Split(new char[] |
| string[] days = p[1].Split(new char[] |
| { |
| { |
| ':' |
| ':' |
| }); |
| }); |
| bool flag5 = (@operator == "==" && dateNow.Hour == hours) || (@operator == "!=" && dateNow.Hour != hours) || (@operator == "<=" && dateNow.Hour <= hours) || (@operator == ">=" && dateNow.Hour >= hours) || (@operator == ">" && dateNow.Hour > hours) || (@operator == "<" && dateNow.Hour < hours); |
| bool flag5 = (@operator == "==" && dateNow.Hour == hours) || (@operator == "!=" && dateNow.Hour != hours) || (@operator == "<=" && dateNow.Hour <= hours) || (@operator == ">=" && dateNow.Hour >= hours) || (@operator == ">" && dateNow.Hour > hours) || (@operator == "<" && dateNow.Hour < hours); |
| if (flag5) |
| if (flag5) |
| { |
| { |
| day = int.Parse(days[0]); |
| day = int.Parse(days[0]); |
| } |
| } |
| else |
| else |
| { |
| { |
| day = int.Parse(days[1]); |
| day = int.Parse(days[1]); |
| } |
| } |
| } |
| } |
| add = ((day == 0) ? dateNow.ToString("dd/MM/yyyy") : this.getBusinessDay(DateTime.Now, day).ToString("dd/MM/yyyy")); |
| add = ((day == 0) ? dateNow.ToString("dd/MM/yyyy") : this.getBusinessDay(DateTime.Now, day).ToString("dd/MM/yyyy")); |
| } |
| } |
| bool flag6 = this.DictionaryValues.ContainsKey(temp); |
| bool flag6 = this.DictionaryValues.ContainsKey(temp); |
| if (flag6) |
| if (flag6) |
| { |
| { |
| bool flag7 = string.IsNullOrEmpty(this.DictionaryValues[temp]); |
| bool flag7 = string.IsNullOrEmpty(this.DictionaryValues[temp]); |
| if (flag7) |
| if (flag7) |
| { |
| { |
| part = string.Empty; |
| part = string.Empty; |
| } |
| } |
| else |
| else |
| { |
| { |
. | add += this.DictionaryValues[temp]; |
| bool flag8 = action.Where == "input[id=data_da_disponibilizStr]" && this.DictionaryValues["SearchElements.Fields.Tipo"] == "Publicação"; |
| |
| if (flag8) |
| |
| { |
| |
| add += this.getBusinessDay(DateTime.Parse(this.DictionaryValues[temp]), -1).ToString("dd/MM/yyyy"); |
| |
| } |
| |
| else |
| |
| { |
| |
| bool flag9 = action.Where == "input[id=data_de_publicacaoStr]" && (this.DictionaryValues["SearchElements.Fields.Tipo"] == "Disponibilização" || this.DictionaryValues["SearchElements.Fields.Tipo"] == "Divulgação"); |
| |
| if (flag9) |
| |
| { |
| |
| add += this.getBusinessDay(DateTime.Parse(this.DictionaryValues[temp]), 1).ToString("dd/MM/yyyy"); |
| |
| } |
| |
| else |
| |
| { |
| |
| add += this.DictionaryValues[temp]; |
| |
| } |
| |
| } |
| } |
| } |
| } |
| } |
. | bool flag8 = add != string.Empty; |
| bool flag10 = add != string.Empty; |
| if (flag8) |
| if (flag10) |
| { |
| { |
| value += add; |
| value += add; |
| } |
| } |
| else |
| else |
| { |
| { |
| value += Regex.Replace(part, "amp;", string.Empty); |
| value += Regex.Replace(part, "amp;", string.Empty); |
| } |
| } |
| }); |
| }); |
| bool flag = !string.IsNullOrEmpty(action.Replace); |
| bool flag = !string.IsNullOrEmpty(action.Replace); |
| if (flag) |
| if (flag) |
| { |
| { |
| List<string> replaces = action.Replace.Split(new char[] |
| List<string> replaces = action.Replace.Split(new char[] |
| { |
| { |
| ';' |
| ';' |
| }).ToList<string>(); |
| }).ToList<string>(); |
| replaces.ForEach(delegate(string replace) |
| replaces.ForEach(delegate(string replace) |
| { |
| { |
| string[] r = replace.Split(new char[] |
| string[] r = replace.Split(new char[] |
| { |
| { |
| ',' |
| ',' |
| }); |
| }); |
| value = Regex.Replace(value, r[0], r[1]); |
| value = Regex.Replace(value, r[0], r[1]); |
| }); |
| }); |
| } |
| } |
| string a = value.Substring(0, Math.Min(value.Length, action.MaxLength)); |
| string a = value.Substring(0, Math.Min(value.Length, action.MaxLength)); |
| return (action.MaxLength > 0) ? value.Substring(0, Math.Min(value.Length, action.MaxLength)) : value; |
| return (action.MaxLength > 0) ? value.Substring(0, Math.Min(value.Length, action.MaxLength)) : value; |
| } |
| } |
| |
| |
| // Token: 0x060003AB RID: 939 RVA: 0x0000CE4C File Offset: 0x0000B04C |
| // Token: 0x06000275 RID: 629 RVA: 0x0000A9A0 File Offset: 0x00008BA0 |
| private DateTime getBusinessDay(DateTime dateTime, int day) |
| private DateTime getBusinessDay(DateTime dateTime, int day) |
| { |
| { |
| DateTime currentDay = dateTime; |
| DateTime currentDay = dateTime; |
| bool flag = day >= 0; |
| bool flag = day >= 0; |
| if (flag) |
| if (flag) |
| { |
| { |
| List<DateTime> dates = Shift.getDaysWithInterval(currentDay, 30, true); |
| List<DateTime> dates = Shift.getDaysWithInterval(currentDay, 30, true); |
| currentDay = dates[day]; |
| currentDay = dates[day]; |
| } |
| } |
| else |
| else |
| { |
| { |
| int count = 0; |
| int count = 0; |
| while (count > day) |
| while (count > day) |
| { |
| { |
| currentDay = currentDay.AddDays(-1.0); |
| currentDay = currentDay.AddDays(-1.0); |
| bool flag2 = Shift.isDuringTheWeek(currentDay); |
| bool flag2 = Shift.isDuringTheWeek(currentDay); |
| if (flag2) |
| if (flag2) |
| { |
| { |
| count--; |
| count--; |
| } |
| } |
| } |
| } |
| } |
| } |
| return currentDay; |
| return currentDay; |
| } |
| } |
| |
| |
| // Token: 0x04000174 RID: 372 |
| // Token: 0x040000F5 RID: 245 |
| private static Browser instance; |
| private static Browser instance; |
| |
| |
| // Token: 0x04000175 RID: 373 |
| // Token: 0x040000F6 RID: 246 |
| private WebBrowser browser; |
| private WebBrowser browser; |
| |
| |
| // Token: 0x04000176 RID: 374 |
| // Token: 0x040000F7 RID: 247 |
| private bool wait = false; |
| private bool wait = false; |
| |
| |
| // Token: 0x04000177 RID: 375 |
| // Token: 0x040000F8 RID: 248 |
| private Thread main; |
| private Thread main; |
| |
| |
| // Token: 0x04000178 RID: 376 |
| // Token: 0x040000F9 RID: 249 |
| private bool terminate = false; |
| private bool terminate = false; |
| |
| |
| // Token: 0x04000179 RID: 377 |
| // Token: 0x040000FA RID: 250 |
| private Origin source; |
| private Origin source; |
| |
| |
| // Token: 0x0400017A RID: 378 |
| // Token: 0x040000FB RID: 251 |
| private Dictionary<string, string> dictionaryValues; |
| private Dictionary<string, string> dictionaryValues; |
| |
| |
| // Token: 0x0400017B RID: 379 |
| // Token: 0x040000FC RID: 252 |
| private List<List<Element>> searchElements; |
| private List<List<Element>> searchElements; |
| |
| |
| // Token: 0x0400017C RID: 380 |
| // Token: 0x040000FD RID: 253 |
| public Activity Activity; |
| public Activity Activity; |
| } |
| } |
| } |
| } |
| |
| |