1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
using Agger.Registro;
using Gestor.Application.Helpers;
using Gestor.Application.Model.Ajuda;
using Gestor.Application.ViewModels.Drawer.Ajuda;
using Gestor.Application.ViewModels.Generic;
using Gestor.Application.Views.Generic;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Markup;
namespace Gestor.Application.Drawers.Ajuda
{
public class BoletosNotasDrawerView : BaseUserControl, IComponentConnector, IStyleConnector
{
internal System.Windows.Controls.ProgressBar ProgressBar;
internal ComboBox StatusCbo;
internal DataGrid BoletosGrid;
internal DataGridTemplateColumn BaixarBoletoColumn;
internal DataGridTextColumn PagamentoColumn;
internal ItemsControl BoletoDisponivel;
internal TextBlock TxtBoletoDisponivel;
private bool _contentLoaded;
public BoletosNotasViewModel ViewModel
{
get;
set;
}
public BoletosNotasDrawerView()
{
this.ViewModel = new BoletosNotasViewModel();
base.DataContext = this.ViewModel;
this.InitializeComponent();
this.StatusCbo.SelectedIndex = 0;
}
private void ExibirBoleto_OnClick(object sender, RoutedEventArgs e)
{
Boleto selectedItem = (Boleto)this.BoletosGrid.SelectedItem;
if ((selectedItem.Vencimento - Funcoes.GetNetworkTime()).TotalDays > 10)
{
return;
}
Process.Start(string.Format("{0}billet/id/{1}", Address.get_ApiBoletoAgger(), selectedItem.IdBoleto));
}
private void ExibirNota_OnClick(object sender, RoutedEventArgs e)
{
Process.Start(((Boleto)this.BoletosGrid.SelectedItem).Nota ?? "");
}
private void Fechar_OnClick(object sender, RoutedEventArgs e)
{
this.ViewModel.CloseDrawer();
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent()
{
if (this._contentLoaded)
{
return;
}
this._contentLoaded = true;
System.Windows.Application.LoadComponent(this, new Uri("/Gestor.Application;component/drawers/ajuda/boletosnotasdrawerview.xaml", UriKind.Relative));
}
private void SelectedStatus_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (this.StatusCbo.SelectedItem == null)
{
return;
}
this.ViewModel.WorkOnSelectedStatus(this.StatusCbo.SelectedItem.ToString());
this.PagamentoColumn.Visibility = (this.StatusCbo.SelectedItem.ToString() == "PENDENTES" ? System.Windows.Visibility.Collapsed : System.Windows.Visibility.Visible);
this.BaixarBoletoColumn.Visibility = (this.StatusCbo.SelectedItem.ToString() == "PENDENTES" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed);
this.BoletoDisponivel.Visibility = (this.StatusCbo.SelectedItem.ToString() == "PENDENTES" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed);
}
[DebuggerNonUserCode]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
{
switch (connectionId)
{
case 1:
{
this.ProgressBar = (System.Windows.Controls.ProgressBar)target;
return;
}
case 2:
{
((Button)target).Click += new RoutedEventHandler(this.Fechar_OnClick);
return;
}
case 3:
{
this.StatusCbo = (ComboBox)target;
this.StatusCbo.SelectionChanged += new SelectionChangedEventHandler(this.SelectedStatus_OnSelectionChanged);
return;
}
case 4:
{
this.BoletosGrid = (DataGrid)target;
return;
}
case 5:
{
this.BaixarBoletoColumn = (DataGridTemplateColumn)target;
return;
}
case 6:
case 7:
{
this._contentLoaded = true;
return;
}
case 8:
{
this.PagamentoColumn = (DataGridTextColumn)target;
return;
}
case 9:
{
this.BoletoDisponivel = (ItemsControl)target;
return;
}
case 10:
{
this.TxtBoletoDisponivel = (TextBlock)target;
return;
}
default:
{
this._contentLoaded = true;
return;
}
}
}
[DebuggerNonUserCode]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target)
{
if (connectionId == 6)
{
((Button)target).Click += new RoutedEventHandler(this.ExibirBoleto_OnClick);
return;
}
if (connectionId != 7)
{
return;
}
((Button)target).Click += new RoutedEventHandler(this.ExibirNota_OnClick);
}
}
}
|