protected void btnGuardar_Click(object sender, EventArgs e) { try { if (gvInformation.SelectedRow != null) { bool reportar = rblReportar.SelectedItem.Value == "SI" ? true : false; string motivo = reportar ? txtMotivoSiReportar.Text.Trim() : ddlMotivoNoReportar.SelectedItem.Text; ReportsOperations.UpdateRegistro(gvInformation.SelectedRow.Cells[0].Text, ddlAutorizadoPor.SelectedItem.Text, motivo, DateTime.ParseExact(txtFechaAutorizacion.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture), reportar, txtCriterioPLD.Text.Trim()); ShowMessage(false); ddlAutorizadoPor.SelectedValue = "0"; ddlMotivoNoReportar.SelectedValue = "0"; txtCriterioPLD.Text = String.Empty; txtMotivoSiReportar.Text = String.Empty; rfvMotivoNoReportar.Visible = false; btnEditar.Visible = false; BindData(); } } catch (Exception ex) { ShowMessage(true); throw ex; } }
protected void gvInformation_SelectedIndexChanged(object sender, EventArgs e) { btnEditar.Visible = false; txtCriterioPLD.Text = String.Empty; txtFechaAutorizacion.Text = String.Empty; ddlAutorizadoPor.SelectedValue = "0"; ddlMotivoNoReportar.SelectedValue = "0"; try { foreach (GridViewRow row in gvInformation.Rows) { if (row.RowIndex == gvInformation.SelectedIndex) //when row is selected { row.BackColor = ColorTranslator.FromHtml("#A1DCF2"); row.ToolTip = String.Empty; //fill values when row is clicked txtFechaAutorizacion.Text = DateTime.Now.ToString("dd/MM/yyyy"); String ID = gvInformation.SelectedRow.Cells[0].Text; txtCriterioPLD.Text = ReportsOperations.GetDescripcionOperacion(ID); string calificar; if (ddlTipoReporte.SelectedItem.Value == "3" || ddlTipoReporte.SelectedItem.Value == "4") //para los reportes internas preocupantes y 24 horas no existe la columna número de control, por eso es una posición antes { calificar = row.Cells[5].Text; } else { calificar = row.Cells[6].Text; } //set text to perfil transaccional this.SetPerfilTransaccional(row.Cells[4].Text.Trim()); if (calificar != "NO") { //inusuales y no reportados no se pueden modificar if (ddlTipoReporte.SelectedItem.Value != "1" && ddlTipoReporte.SelectedItem.Value != "7") { btnEditar.Visible = true; } } else { ReportsOperations.InformationOperacion data = ReportsOperations.GetInformationOperacion(ID); ddlAutorizadoPor.SelectedIndex = ddlAutorizadoPor.Items.IndexOf(ddlAutorizadoPor.Items.FindByText(data.autorizadoPor)); txtFechaAutorizacion.Text = data.fechaAutorizacion; ddlMotivoNoReportar.SelectedIndex = ddlMotivoNoReportar.Items.IndexOf(ddlMotivoNoReportar.Items.FindByText(data.motivoParaNoReportar)); } } else { row.BackColor = ColorTranslator.FromHtml("#FFFFFF"); row.ToolTip = "Click to select this row."; } } } catch (Exception ex) { ShowMessage(true, ex.Message); } }
protected void btnReportar_Click(object sender, EventArgs e) { try { CNBVPreocupantesBean preo = ReportsOperations.Get(); preo.Nombre = txtNombre.Text.Trim(); preo.ApellidoPaterno = txtApellidoPaterno.Text.Trim(); preo.ApellidoMaterno = txtApellidoMaterno.Text.Trim(); preo.RazonSocial = String.Format("{0} {1} {2}", preo.ApellidoPaterno, preo.ApellidoMaterno, preo.Nombre); preo.Domicilio = txtDomicilio.Text.Trim(); preo.Ciudad = txtCiudad.Text.Trim(); preo.Colonia = txtColonia.Text.Trim(); preo.Telefono = txtTelefono.Text.Trim(); DateTime fechaNacimiento = DateTime.ParseExact(txtFechaNacimiento.Text.Trim(), "dd/MM/yyyy", CultureInfo.InvariantCulture); preo.FechaNacimiento = fechaNacimiento.ToString("yyyyMMdd"); preo.Nacionalidad = ddlNacionalidad.SelectedItem.Value; preo.RFC = txtRfc.Text.Trim(); preo.CURP = txtCurp.Text.Trim(); preo.TipoPersona = "1"; //preo.Localidad = ddlLocalidad.SelectedItem.Text; //preo.OrganoSupervisor = ddlSucursal.SelectedItem.Text; preo.Razones = txtCausa.Text.Trim(); ReportsOperations.Save(preo); LimpiarCampos(); MostarMensaje(true); } catch (Exception ex) { MostarMensaje(false); throw ex; } }
protected void btnExportToExcel_Click(object sender, EventArgs e) { try { if (this.ddlTipoReporte.SelectedItem.Value != "0") { if (cbFechas.Checked) { if (txtDel.Text != String.Empty && txtHasta.Text != String.Empty) //Bind gridview between dates { DateTime initialDate = DateTime.ParseExact(txtDel.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime finalDate = DateTime.ParseExact(txtHasta.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); String query = ReportsOperations.GetQueryToExport(ddlTipoReporte.SelectedItem.Value, initialDate, finalDate); if (txtFiltroNombre.Text.Trim() != String.Empty) { String finalQuery = String.Format("AND RazonSocial LIKE '%{0}%'", txtFiltroNombre.Text.Trim()); query = String.Format("{0} {1}", query, finalQuery); //concat like condition to where clause } DataTable aux = new DataTable(); DataBaseSettings db = new DataBaseSettings(); aux = db.GetDataTable(query); string fileName = FileSettings.CreateCSVFile(aux, ddlTipoReporte.SelectedItem.Text + " " + DateTime.Now.ToString("yyyy-MM-dd")); this.DownloadFile(fileName); } else { ShowMessage(true, "Favor de ingresar ambas fechas"); } } else //Bind gridview without dates { String query = ReportsOperations.GetQueryToExport(ddlTipoReporte.SelectedItem.Value); if (txtFiltroNombre.Text.Trim() != String.Empty) { String finalQuery = String.Format("AND RazonSocial LIKE '%{0}%'", txtFiltroNombre.Text.Trim()); query = String.Format("{0} {1}", query, finalQuery); //concat like condition to where clause } DataTable aux = new DataTable(); DataBaseSettings db = new DataBaseSettings(); aux = db.GetDataTable(query); string fileName = FileSettings.CreateCSVFile(aux, ddlTipoReporte.SelectedItem.Text + " " + DateTime.Now.ToString("yyyy-MM-dd")); this.DownloadFile(fileName); } } } catch (Exception ex) { throw ex; } }
protected void btnGetReport_Click(object sender, EventArgs e) { try { if (txtPeriodo.Text != String.Empty) { ReportsOperations.UpdatePeriod(DateTime.ParseExact(txtPeriodo.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture)); } BindData(); //bind data } catch (Exception ex) { Response.Write("<script>alert('A ocurrido un error favor de contactar al administrador');</script>" + ex); } }
private void SetPerfilTransaccional(String custID) { try { ReportsOperations.PerfilTransaccional perfilTran = ReportsOperations.GetPerfilTransaccional(custID); txtActividadPrep.Text = perfilTran.actividadPrep; txtManejoEfectivo.Text = perfilTran.manejoEfec; txtMontoEfectivoMensual.Text = perfilTran.montoEfectivoMensual; txtNumEstimadoMovMensual.Text = perfilTran.numeroEstimadoMovimientos; txtMontoEstimadoMensual.Text = perfilTran.montoEstimadoMensual; } catch (Exception ex) { throw ex; } }
protected void btnBuscarCliente_Click(object sender, ImageClickEventArgs e) { try { CNBVInusualesBean data = ReportsOperations.Get(txtNumCliente.Text.Trim()); Session["Object"] = data; ddlNumControl.Items.Clear(); txtCliente.Text = data.RazonSocial; LlenarDropDowns.NumeroControl(ddlNumControl, txtNumCliente.Text.Trim()); } catch (Exception ex) { throw ex; } }
protected void btnReportar_Click(object sender, EventArgs e) { try { CNBVInusualesBean data = Session["Object"] as CNBVInusualesBean; data.NumeroCuenta = ddlNumControl.SelectedItem.Text; data.Monto = Convert.ToDecimal(txtMonto.Text.Trim()); data.Moneda = ddlMoneda.SelectedItem.Value; data.InstrumentoMonetario = ddlInstumentoMonetario.SelectedItem.Value; data.TipoOperacion = ddlTipoOperacion.SelectedItem.Value; data.DescripcionOperacion = ddlDescripcionOperacion.SelectedItem.Text; data.Razones = txtCausa.Text.Trim(); ReportsOperations.Save(data, rblTipoReporte.SelectedValue); LimpiarCampos(); MostarMensaje(true); } catch (Exception ex) { MostarMensaje(false); throw ex; } }
public override DataTable ImplementReport(DateTime inicio, DateTime final) { base.query = ReportsOperations.GetQueryReportsApproved("4", inicio, final); base.cmd = new SqlCommand(base.query, base.conn); try { base.conn.Open(); base.reader = base.cmd.ExecuteReader(); base.data.Load(base.reader); } catch (Exception ex) { throw ex; } finally { base.conn.Close(); } return(base.data); }
public override DataTable ImplementReport(DateTime inicio, DateTime final) { base.query = ReportsOperations.GetQueryReportsApproved("1", inicio, final); //base.query = String.Format(@"select * from xvr_ReportCNBVRelevantes where [FECHA DE LA OPERACION] between '{0}' and '{1}'", // inicio.ToString("yyyy-MM-dd HH:mm:ss.fff"), final.ToString("yyyy-MM-dd HH:mm:ss.fff")); base.cmd = new SqlCommand(base.query, base.conn); try { base.conn.Open(); base.cmd.CommandTimeout = 0; base.reader = base.cmd.ExecuteReader(); base.data.Load(base.reader); } catch (Exception ex) { throw ex; } finally { base.conn.Close(); } return(base.data); }
private void BindData() { try { if (this.ddlTipoReporte.SelectedItem.Value != "0") { if (cbFechas.Checked) { if (txtDel.Text != String.Empty && txtHasta.Text != String.Empty) //Bind gridview between dates { DateTime initialDate = DateTime.ParseExact(txtDel.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime finalDate = DateTime.ParseExact(txtHasta.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); String query = ReportsOperations.GetQueryReports(ddlTipoReporte.SelectedItem.Value, initialDate, finalDate); if (txtFiltroNombre.Text.Trim() != String.Empty) { String finalQuery = String.Format("AND RazonSocial LIKE '%{0}%'", txtFiltroNombre.Text.Trim()); query = String.Format("{0} {1}", query, finalQuery); //concat like condition to where clause } DataTable aux = new DataTable(); DataBaseSettings db = new DataBaseSettings(); aux = db.GetDataTable(query); gvInformation.DataSource = aux; gvInformation.DataBind(); if (aux.Rows.Count > 0) { pnlFiltro.Visible = true; lblTotalRegistros.Text = String.Format("{0} registros", aux.Rows.Count); } else { txtFiltroNombre.Text = String.Empty; lblTotalRegistros.Text = String.Empty; pnlFiltro.Visible = false; ShowMessage(true, "No fueron encontrados registros con dichos criterios de búsqueda"); } } else { ShowMessage(true, "Favor de ingresar ambas fechas"); } } else //Bind gridview without dates { String query = ReportsOperations.GetQueryReports(ddlTipoReporte.SelectedItem.Value); if (txtFiltroNombre.Text.Trim() != String.Empty) { String finalQuery = String.Format("AND RazonSocial LIKE '%{0}%'", txtFiltroNombre.Text.Trim()); query = String.Format("{0} {1}", query, finalQuery); //concat like condition to where clause } DataTable aux = new DataTable(); DataBaseSettings db = new DataBaseSettings(); aux = db.GetDataTable(query); gvInformation.DataSource = aux; gvInformation.DataBind(); if (aux.Rows.Count > 0) { pnlFiltro.Visible = true; lblTotalRegistros.Text = String.Format("{0} registros", aux.Rows.Count); } else { txtFiltroNombre.Text = String.Empty; lblTotalRegistros.Text = String.Empty; pnlFiltro.Visible = false; ShowMessage(true, "No fueron encontrados registros con dichos criterios de búsqueda"); } } cbFechas.Checked = false; } } catch (Exception ex) { throw ex; } }