-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathseleccionarCliente.cs
109 lines (102 loc) · 3.88 KB
/
seleccionarCliente.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MundoMusical.XBASE;
using MundoMusical.DB;
using MundoMusical.CONSULTAS.VENTAS;
namespace MundoMusical.VENTA
{
public partial class seleccionarCliente :gridquerybase
{
private centralVenta source;
private consulta_ventas baseventas;
public seleccionarCliente()
{
InitializeComponent();
this.MinimizeBox = false;
this.Text = "Seleccionar Cliente-Venta";
this.db = new dbop();
this.txtname.KeyUp += (sender, args) =>
{
this.getGrid();
};
}
public seleccionarCliente(consulta_ventas baseventas) // CONSTRUCTOR BASADO EN FORMA CONSULTAS VENTAS
{
InitializeComponent();
this.MinimizeBox = false;
this.Text = "Seleccionar Cliente";
this.baseventas = baseventas;
this.db = new dbop();
this.txtname.KeyUp += (sender, args) =>
{
this.getGrid();
};
this.dgv.CellClick += (sender, args) =>
{
bool flag = false;
if (args.RowIndex > -1 && args.ColumnIndex > -1)
{
for(int x=0; x<this.baseventas.arrclientes.Length; ++x)
{
if(this.baseventas.arrclientes[x].id.ToString() == this.dgv.Rows[args.RowIndex].Cells[0].Value.ToString().Trim())
{
this.baseventas.cbidcliente.SelectedIndex = x;
flag = true;
break;
}
}
if (!flag)
{
genericDefinitions.error("Error al realizar busqueda Avanzada, contacte al desarrollador");
}
this.Close();
}
};
this.dgv.Cursor = Cursors.Hand;
}
public seleccionarCliente(centralVenta source) //CONSTRUCTOR BASADO EN FORMA VENTAS CENTRAL
{
InitializeComponent();
this.MinimizeBox = false;
this.Text = "Seleccionar Cliente-Venta";
this.source = source;
this.db = new dbop();
this.txtname.KeyUp += (sender, args) =>
{
this.getGrid();
};
this.dgv.CellClick += (sender, args) =>
{
if (args.RowIndex > -1 && args.ColumnIndex > -1)
{
this.source.txtcliente.Text = this.dgv.Rows[args.RowIndex].Cells[1].Value + " " + this.dgv.Rows[args.RowIndex].Cells[2].Value;
this.source.txtid.Text = this.dgv.Rows[args.RowIndex].Cells[0].Value.ToString();
this.source.checkboxCP.Checked = false;
this.Close();
}
};
this.dgv.Cursor = Cursors.Hand;
}
private void seleccionarCliente_Load(object sender, EventArgs e)
{
getGrid();
this.ActiveControl = this.txtname;
}
private void getGrid()
{
this.db.getSeleccionarclienteventaDGV(ref this.dgv, this.txtname.Text.Trim());
this.dgv.Columns[0].HeaderText = "Id";
this.dgv.Columns[1].HeaderText = "Nombre";
this.dgv.Columns[2].HeaderText = "Apellido";
this.dgv.Columns[3].HeaderText = "Curp";
this.dgv.Columns[4].HeaderText = "Rfc";
}
}
}