btEntrega.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 
6 using sage.ew.objetos;
7 using sage.ew.docsven;
8 using sage.ew.global;
10 using System.Windows.Forms;
11 using System.ComponentModel;
12 using System.Drawing;
13 using sage.ew.interficies;
14 
15 namespace sage.ew.botones.Clases
16 {
21  {
22 
23 
27  public docsven.UserControls.gridArtDocVenta _GridArt
28  {
29  get { return _oGridArt; }
30  set { _oGridArt = value; }
31  }
32  private docsven.UserControls.gridArtDocVenta _oGridArt;
33 
37  public dynamic _Documento
38  {
39  get { return _oDocumento; }
40  set { _oDocumento = value; }
41  }
42  private dynamic _oDocumento;
43 
47  public dynamic _DocLinea
48  {
49  get { return _oDocLinea; }
50  set { _oDocLinea = value; }
51  }
52  private dynamic _oDocLinea = null;
53 
54  private dynamic _oLinea;
58  public dynamic _Linea
59  {
60  get { return _oLinea; }
61  set { _oLinea = value; }
62  }
63 
64 
65 
66  // Propiedades
68 
69 
74  public Font _Font
75  {
76  get { return this._oFont; }
77  set
78  {
79  if (value is Font && value != null)
80  {
81  //this._Font = value;
82  this._oFont = value;
83  }
84  }
85  }
86  private Font _oFont = new Font("Arial", 9.5f);
87 
88 
89 
90 
91 
92 
93 
94 
95 
99  [DefaultValue("Desmarcar entregada")]
100  public string _TextoLineaPositivo
101  {
102  get { return this._cTextoLineaPositivo; }
103  set
104  {
105  //this.Text = value;
106  this._cTextoLineaPositivo = value;
107  }
108  }
109  private string _cTextoLineaPositivo = "Desmarcar entregada";
110 
111 
115  [Bindable(false),
116  Category("Varios_Apariencia"),
117  DefaultValue(typeof(Color), "Control"),
118  Description("Obtiene o establece el color de fondo del control."),
119  DisplayName("Color del fondo"),
120  Localizable(false),
121  Browsable(true)]
122  public Color _ForeColorPositivo
123  {
124  get { return this._oForeColorPositivo; }
125  set
126  {
127  if (value != null)
128  {
129  //this.BackColor = value;
130  this._oForeColorPositivo = value;
131  }
132  }
133  }
134  private Color _oForeColorPositivo = SystemColors.ControlText;
135 
136 
140  [Bindable(false),
141  Category("Varios_Apariencia"),
142  DefaultValue(typeof(Color), "Control"),
143  Description("Obtiene o establece el color de fondo del control."),
144  DisplayName("Color del fondo"),
145  Localizable(false),
146  Browsable(true)]
147  public Color _BackColorPositivo
148  {
149  get { return this._oBackColorPositivo; }
150  set
151  {
152  if (value != null)
153  {
154  //this.BackColor = value;
155 
156  this._oBackColorPositivo = value;
157  }
158  }
159  }
160  private Color _oBackColorPositivo = SystemColors.Control;
161 
162 
163 
164 
168  [DefaultValue("Marcar entregada")]
169  public string _TextoLineaNegativo
170  {
171  get { return this._cTextoLineaNegativo; }
172  set
173  {
174  this.Text = value;
175  this._cTextoLineaNegativo = value;
176  }
177  }
178  private string _cTextoLineaNegativo = "Marcar entregada";
179 
180 
181 
185  [Bindable(false),
186  Category("Varios_Apariencia"),
187  DefaultValue(typeof(Color), "Control"),
188  Description("Obtiene o establece el color de fondo del control."),
189  DisplayName("Color del fondo"),
190  Localizable(false),
191  Browsable(true)]
192  public Color _ForeColorNegativo
193  {
194  get { return this._oForeColorNegativo; }
195  set
196  {
197  if (value != null)
198  {
199  this.ForeColor = value;
200  this._oForeColorNegativo = value;
201  }
202  }
203  }
204  private Color _oForeColorNegativo = SystemColors.ControlText;
205 
206 
207 
211  [Bindable(false),
212  Category("Varios_Apariencia"),
213  DefaultValue(typeof(Color), "Control"),
214  Description("Obtiene o establece el color de fondo del control."),
215  DisplayName("Color del fondo"),
216  Localizable(false),
217  Browsable(true)]
218  public Color _BackColorNegativo
219  {
220  get { return this._oBackColorNegativo; }
221  set
222  {
223  if (value != null)
224  {
225  this.BackColor = value;
226  this._oBackColorNegativo = value;
227  }
228  }
229  }
230  private Color _oBackColorNegativo = Color.Aqua;
231 
232 
234 
238  public btEntrega()
239  {
240  this.Text = "Entregar línea";
241 
242  this.Click += new EventHandler(btEntrega_Click);
243  }
244 
250  public void btEntrega_Click(object sender, EventArgs e)
251  {
252  if (this._Documento == null)
253  return;
254 
255  // 93689
256  if (!_Documento._Cabecera._Reservar)
257  {
258  _Documento._MessageBox("No se puede entregar material, si el documento no está reservado.", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, DialogResult.OK);
259  return;
260  }
261  // fi 93689
262 
264  dynamic loLineaActual = null;
265  if (_oDocLinea != null)
266  {
267  loLineaActual = _oDocLinea;
268  _oDocLinea = null; //Reinicio la variable
269  }
270  else
271  loLineaActual = _oDocumento._Lineas[_oGridArt._Grid.CurrentRow.Index];
272 
273  //Si he encontrado el grid
274  if (_GridArt != null && _GridArt._Grid.CurrentRow != null)
275  {
276  if (_GridArt._Grid.CurrentRow.Index >= 0 && _GridArt._Grid.CurrentRow.Index < _GridArt._Grid.Rows.Count)
277  {
278  if (_Documento._Lineas[_GridArt._Grid.CurrentRow.Index]._Unidades == 0)
279  {
280  _Documento._MessageBox("No se puede anular una línea en la que no se ha indicado las unidades.", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, DialogResult.OK);
281  return;
282  }
283  _Documento._Lineas[_GridArt._Grid.CurrentRow.Index]._Actualizar_Entrega_Material();
284  }
285  }
286 
287  this._Refresh();
288  }
289 
293  public void _Refresh()
294  {
295  // PE-94201. El texto del botón si debe cambiar según el estado de la línea, los colores no
296 
297  //Si he encontrado el grid
298  if (_GridArt != null && _GridArt._Grid.CurrentRow != null)
299  {
300  if (_GridArt._Grid.CurrentRow.Index >= 0 && _GridArt._Grid.CurrentRow.Index < _GridArt._Grid.Rows.Count)
301  {
302  if (_Documento._Lineas[_GridArt._Grid.CurrentRow.Index]._Entregado)
303  {
304  this.Text = this._TextoLineaPositivo;
305  }
306  else
307  {
308  this.Text = this._TextoLineaNegativo;
309  }
310  }
311  }
312  }
313  }
314 }
void _Refresh()
Reasigna propiedades a las columnas (máscaras precios e importes)
Definition: btEntrega.cs:293
Interfaz utilizada en los controles que se añaden en los perfiles
Clase del botón entregas línea
Definition: btEntrega.cs:20
Base para los botones de Eurowin
void btEntrega_Click(object sender, EventArgs e)
btAnularLinea_Click
Definition: btEntrega.cs:250