-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsultas_inicios.cs
77 lines (61 loc) · 2.65 KB
/
consultas_inicios.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
using MundoMusical.DB;
using MundoMusical.XBASE;
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;
namespace MundoMusical.CONSULTAS.INICIOS_SESION
{
public partial class consultas_inicios : baseConsultas
{
private dbop db;
public consultas_inicios(consultas_central central)
{
InitializeComponent();
this.db = new dbop();
this.setatribs();
this.FormClosed += (sender, args) => { central.Close(); };
}
public consultas_inicios()
{
InitializeComponent();
this.db = new dbop();
this.setatribs();
}
private void setatribs()
{
this.cbusuario.DataSource = this.db.getusuariosNames();
this.cbusuario.SelectedIndex = -1;
this.dgv.DataSourceChanged += (sender, args) => { this.lblregs.Text = "Registros:" + this.dgv.RowCount.ToString(); };
this.dtpinicio.KeyUp += (sender, args) => { this.db.getinicios(ref this.dgv, "inicio", this.dtpinicio.Text.Trim()); };
this.dtpinicio.ValueChanged += (sender, args) => { this.db.getinicios(ref this.dgv, "inicio", this.dtpinicio.Text.Trim()); };
this.dtpcierre.KeyUp += (sender, args) => { this.db.getinicios(ref this.dgv, "inicio", this.dtpcierre.Text.Trim()); };
this.dtpcierre.ValueChanged += (sender, args) => { this.db.getinicios(ref this.dgv, "inicio", this.dtpcierre.Text.Trim()); };
this.cbusuario.TextChanged += (sender, args) => {
if(this.cbusuario.Text != string.Empty)
{
this.db.getinicios(ref this.dgv, "usuario", this.cbusuario.Text.Trim());
}
};
this.dtpinicio.GotFocus += (sender, args) => { this.loadAll(); };
this.dtpcierre.GotFocus += (sender, args) => { this.loadAll(); };
this.cbusuario.GotFocus += (sender, args) => { this.loadAll(); };
}
private void consultas_inicios_Load(object sender, EventArgs e)
{
this.loadAll();
}
private void loadAll()
{
this.dtpinicio.Text = DateTime.Now.ToShortDateString();
this.dtpcierre.Text = DateTime.Now.ToShortDateString();
this.cbusuario.SelectedIndex = -1;
this.db.getinicios(ref this.dgv, "all", null);
}
}
}