private DataTable ValidarPLE(int Ind, DateTime Desde, DateTime Hasta) { DataTable dt = new DataTable(); BLcontrolPeriodo BL_ControlPeriodo = new BLcontrolPeriodo(); // Hasta= Convert.ToDateTime("30/05/2016"); dt = BL_ControlPeriodo.ValidacionTransferencia(Ind, Desde, Hasta); return(dt); }
public frmLoginNew() { InitializeComponent(); objcontrolPeriodo = new BLcontrolPeriodo(); objBLUser = new BLUser(); }
private void btnTransferir_Click_1(object sender, EventArgs e) { BLcontrolPeriodo BL_ComtrolPeriodo = new BLcontrolPeriodo(); int id; DataTable dt = new DataTable(); //ver el indice if (this.lvwTransferencias.SelectedItems.Count != 1) { MessageBox.Show("Debe seleccionar la transferencia a realizar."); return; } ListViewItem ItmX = this.lvwTransferencias.SelectedItems[0]; tipoTransferencia = Convert.ToInt32(ItmX.Name); switch (tipoTransferencia) { case 3: id = 1; break; case 1: id = 2; break; case 11: id = 3; break; case 2: id = 4; break; case 13: id = 5; break; case 12: id = 6; break; case 4: id = 7; break; default: id = 0; break; } //MessageBox.Show(tipoTransferencia.ToString()); Mes = cboMonth.SelectedIndex + 1; Anio = cboYear.SelectedIndex + 2000; string a1 = (dtpDesde.Value.Year.ToString()); string a2 = (dtpHasta.Value.Year.ToString()); if (tipoTransferencia == 12 | tipoTransferencia == 13) { string valormes = (cboMonth.SelectedIndex + 1).ToString(); string f = "01/" + valormes + "/" + PeriodoiID; DateTime f1 = Convert.ToDateTime(f); DateTime f2; if (f1.Month + 1 < 13) { f2 = new DateTime(f1.Year, f1.Month + 1, 1).AddDays(-1); } else { f2 = new DateTime(f1.Year + 1, 1, 1).AddDays(-1); } dt = BL_ComtrolPeriodo.ValidacionTransferencia(id, f1, f2); if (dt.Rows.Count == 0) { iniciar(1); } else { TransferInforme _trans = new TransferInforme(dt); _trans.MdiParent = this.MdiParent; _trans.Show(); } //} //else //{ // MessageBox.Show("Periodo Ingresado es Incorrecto!"); //} } else { if (cDatos.Periodo.ToString() == a1 && cDatos.Periodo.ToString() == a2) { DateTime desd = Convert.ToDateTime(dtpDesde.Value.ToShortDateString()); DateTime hast = Convert.ToDateTime(dtpHasta.Value.ToShortDateString()); dt = BL_ComtrolPeriodo.ValidacionTransferencia(id, desd, hast); if (dt.Rows.Count == 0) { iniciar(0); } else { TransferInforme _trans = new TransferInforme(dt); _trans.MdiParent = this.MdiParent; _trans.Show(); } } else { MessageBox.Show("El rango de fechas no se encuentra en el periodo correcto!"); } } }