private void cargarDatos() { try { String vQuery = "[STEISP_INVENTARIO_Generales] 13"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); if (vDatos.Rows.Count > 0) { DDLUsuarios.Items.Clear(); DDLUsuarios.Items.Add(new ListItem { Value = "0", Text = "Seleccione una opción" }); foreach (DataRow item in vDatos.Rows) { DDLUsuarios.Items.Add(new ListItem { Value = item["idUsuario"].ToString(), Text = item["nombre"].ToString() + " " + item["apellidos"].ToString() }); } } } catch (Exception ex) { Mensaje(ex.Message, WarningType.Danger); } }
void cargarDataNotificacion() { try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_Generales 16, '" + Session["codNotificacion"] + "'"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); Session["ATM_NOTIF_TECNICOS"] = vDatos; Session["UPDATEATM"] = 1; } catch (Exception Ex) { } try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_Generales 17, '" + Session["codNotificacion"] + "'"); GVLlenaJefeApruebaNotif.DataSource = vDatos; GVLlenaJefeApruebaNotif.DataBind(); Session["ATM_NOTIFJEFESAGEN"] = vDatos; Session["UPDATEATM"] = 1; } catch (Exception Ex) { } }
void cargarData() { try { if (HttpContext.Current.Session["NOTIFCORRECTIVO"] == null) { String vQuery2 = "STEISP_AGENCIA_CreacionNotificacion 5"; DataTable vDatos2 = vConexion.ObtenerTabla(vQuery2); //DLLtecResponsable.Items.Clear(); DLLtecResponsable.Items.Add(new ListItem { Value = "0", Text = "Seleccione técnico responsable..." }); foreach (DataRow item in vDatos2.Rows) { DLLtecResponsable.Items.Add(new ListItem { Value = item["idUsuario"].ToString(), Text = item["nombre"].ToString() + " " + item["apellidos"].ToString() }); } Session["NOTIFCORRECTIVO"] = "1"; } } catch (Exception ex) { throw; } }
void cargarData() { if (HttpContext.Current.Session["SO_ATM"] == null) { try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_Generales 9, 1"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); if (vSecurity.ObtenerPermiso(Session["USUARIO"].ToString(), 3).Edicion) { foreach (GridViewRow item in GVBusqueda.Rows) { LinkButton LbEdit = item.FindControl("BtnEditar") as LinkButton; LbEdit.Visible = true; } } Session["soATM"] = vDatos; } catch (Exception Ex) { } Session["SO_ATM"] = 1; } }
void cargarData() { try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_Generales 50"); GVMantenimientos.DataSource = vDatos; GVMantenimientos.DataBind(); //if (vSecurity.ObtenerPermiso(Session["USUARIO"].ToString(), 3).Edicion) //{ // foreach (GridViewRow item in GVBusqueda.Rows) // { // LinkButton LbEdit = item.FindControl("btnbajaATM") as LinkButton; // LbEdit.Visible = true; // } //} Session["ATM_CAMBIAR_FECHA"] = vDatos; } catch (Exception Ex) { Mensaje(Ex.Message, WarningType.Danger); } }
void cargarData() { //AVANCES DataTable vDatos2 = new DataTable(); vDatos2 = vConexion.ObtenerTabla("[STEISP_ATM_GeneralesCorrectivo] 9"); GVAvances.DataSource = vDatos2; GVAvances.DataBind(); Session["ATM_AVANCES_COR"] = vDatos2; if (HttpContext.Current.Session["AVANCE_COR"] == null) { // DDLFiltroEstado.Items.Clear(); String vQuery = "[STEISP_ATM_GeneralesCorrectivo] 8"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLFiltroEstado.Items.Add(new ListItem { Value = "0", Text = "Seleccione Estado..." }); foreach (DataRow item in vDatos.Rows) { DDLFiltroEstado.Items.Add(new ListItem { Value = item["idEstado"].ToString(), Text = item["nombre"].ToString() }); } Session["AVANCE_COR"] = "1"; } }
void cargarData() { if (HttpContext.Current.Session["DETALLE_MODELO_ATM"] == null) { //lbdetalle1.Visible = false; //lbdetalle2.Visible = false; string det = ""; try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_DetalleModelo 4,1,1,'" + det + "','" + Session["USUARIO"].ToString() + "'"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); if (vSecurity.ObtenerPermiso(Session["USUARIO"].ToString(), 3).Edicion) { foreach (GridViewRow item in GVBusqueda.Rows) { LinkButton LbEdit = item.FindControl("BtnEditar") as LinkButton; LbEdit.Visible = true; } } Session["detMATM"] = vDatos; Session["UPDATEATM"] = 1; } catch (Exception Ex) { throw; } try { String vQuery = "STEISP_ATM_Generales 2,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLModeloATM.Items.Add(new ListItem { Value = "0", Text = "Seleccione modelo..." }); DDLNewModelo.Items.Add(new ListItem { Value = "0", Text = "Seleccione modelo..." }); foreach (DataRow item in vDatos.Rows) { DDLModeloATM.Items.Add(new ListItem { Value = item["idModeloATM"].ToString(), Text = item["nombreModeloATM"].ToString() }); DDLNewModelo.Items.Add(new ListItem { Value = item["idModeloATM"].ToString(), Text = item["nombreModeloATM"].ToString() }); } } catch (Exception ex) { throw; } Session["DETALLE_MODELO_ATM"] = "1"; } }
void cargarData() { try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_VERIFICACION 3,'" + Session["USUARIO"].ToString() + "',1"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); Session["ATM_RECHAZADOVERIF_CARGAR"] = vDatos; } catch (Exception Ex) { } }
void cargarData() { try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_Generales 14, 1"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); Session["ATM_APROBNOTIF_CARGAR"] = vDatos; Session["UPDATEATM"] = 1; } catch (Exception Ex) { } }
void cargarData() { try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_VERIFICACION 10, '" + Session["USUARIO"].ToString() + "'"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); Session["ATM_MATERIALES_MANTENIMIENTO"] = vDatos; } catch (Exception Ex) { Mensaje(Ex.Message, WarningType.Danger); } }
protected void GVBusqueda_RowCommand(object sender, GridViewCommandEventArgs e) { try { string vEstado = ""; string codATMs = e.CommandArgument.ToString(); if (e.CommandName == "Modificar") { DataTable vDatos = new DataTable(); String vQuery = "STEISP_ATM_NotificacionCorrectivo 3,'" + codATMs + "'"; vDatos = vConexion.ObtenerTabla(vQuery); foreach (DataRow item in vDatos.Rows) { vEstado = item["estado"].ToString(); } if (vEstado == "5" || vEstado == "4" || vEstado == "") { TxBuscarATM.Text = string.Empty; Response.Redirect("mantCorrectivoNotificacion.aspx?cod=" + codATMs); } else { Mensaje("¡ALERTA! ATM " + codATMs + " ya está en proceso de mantenimiento, no puede seleccionarlo hasta finalizar mantenimiento pendiente.", WarningType.Danger); } } } catch (Exception Ex) { Mensaje(Ex.Message, WarningType.Danger); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { String vUsuario = Request.QueryString["u"]; String vQuery = "[STEISP_Login] 3, '" + vUsuario + "'"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); if (vDatos.Rows.Count > 0) { if (vDatos.Rows[0]["auth"].ToString() != "1") { Response.Redirect("/login.aspx"); } else { Session["AUTHCLASS"] = vDatos; Session["USUARIO"] = vDatos.Rows[0]["idUsuario"].ToString(); Session["AUTH"] = true; Contar(); } } else { Response.Redirect("/login.aspx"); } } } catch (Exception ex) { String vError = ex.Message; } }
void cargarData() { //LISTA DE MANTENIMIENTOS A CANCELAR DataTable vDatos2 = new DataTable(); vDatos2 = vConexion.ObtenerTabla("[STEISP_ATM_CancelarMantenimiento] 1"); GVCancelar.DataSource = vDatos2; GVCancelar.DataBind(); Session["ATM_CANCELAR"] = vDatos2; //LISTA DE MANTENIMIENTOS CANCELADOS DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("[STEISP_ATM_CancelarMantenimiento] 6"); GVMantenimientoCancelado.DataSource = vDatos; GVMantenimientoCancelado.DataBind(); Session["ATM_CANCELADO"] = vDatos; }
void TransaccionInventario() { try { DataTable vDatos = (DataTable)Session["ATM_MATERIALES_VERIF"]; for (int i = 0; i < vDatos.Rows.Count; i++) { string vMantenimiento = vDatos.Rows[i]["idMantenimiento"].ToString(); string vStock = vDatos.Rows[i]["idStock"].ToString(); int vCantidadSolicitada = Convert.ToInt32(vDatos.Rows[i]["cantidad"].ToString()); //int vUbi = Convert.ToInt32(vDatos.Rows[i]["idUbi"].ToString()); String vQuery = "[STEISP_INVENTARIO_Stock] 2," + vStock; DataTable vDataStock = vConexion.ObtenerTabla(vQuery); Decimal vCantidad = Convert.ToDecimal(vDataStock.Rows[0]["cantidad"].ToString()); Decimal vCantidadActual = vCantidad - Convert.ToDecimal(vCantidadSolicitada); String vNombreMaterial = vDataStock.Rows[0]["descripcion"].ToString(); if (vCantidadActual < 0) { throw new Exception("No hay suficiente material de " + vNombreMaterial + " en existencia"); } Decimal vPrecioDec = Convert.ToDecimal(vCantidadSolicitada) * Convert.ToDecimal(vDataStock.Rows[0]["precioUnit"].ToString()); String vPrecio = vPrecioDec.ToString().Replace(",", "."); String vCodigoUbi = Session["ATM_CODUBI_MATERIAL"].ToString(); String vUsuario = Session["USUARIO"].ToString(); String vUsuResponsable = Session["ATM_USUARIO_MATERIAL"].ToString(); //Session["ATM_USUARIO_MATERIAL"].ToString() generarxml vMaestro = new generarxml(); Object[] vDatosMaestro = new object[10]; vDatosMaestro[0] = vCodigoUbi; vDatosMaestro[1] = vStock; vDatosMaestro[2] = Session["ATM_INVUBI_MATERIAL"]; vDatosMaestro[3] = vUsuResponsable; //Responsable vDatosMaestro[4] = "Mantenimiento ATM"; vDatosMaestro[5] = vCantidadSolicitada; vDatosMaestro[6] = ""; // Serie vDatosMaestro[7] = vPrecio; vDatosMaestro[8] = vUsuario; vDatosMaestro[9] = "6"; String vXML = vMaestro.ObtenerMaestroString(vDatosMaestro); vXML = vXML.Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", ""); vQuery = "[STEISP_INVENTARIO_Principal] 1" + "," + vStock + "," + vCantidadActual + ",'" + vXML + "'"; Int32 vInfo = vConexion.ejecutarSQL(vQuery); } } catch (Exception) { throw new Exception(); } }
void cargarData() { try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_GeneralesCorrectivo 5"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); Session["ATM_APROVVERIFCOR"] = vDatos; } catch (Exception Ex) { } }
void cargarData() { if (HttpContext.Current.Session["TIPO_ATM"] == null) { try { DataTable vDatos = new DataTable(); vDatos = vConexionATM.ObtenerTablaATM("SPSTEI_ATM 4"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); if (vSecurity.ObtenerPermiso(Session["USUARIO"].ToString(), 3).Edicion) { foreach (GridViewRow item in GVBusqueda.Rows) { LinkButton LbEdit = item.FindControl("btnbajaATM") as LinkButton; LbEdit.Visible = true; } } DataTable vDatos2 = new DataTable(); String vQuery2 = "STEISP_ATM_Generales 43"; vDatos2 = vConexion.ObtenerTabla(vQuery2); foreach (DataRow item in vDatos2.Rows) { string vImagen1 = item["IMG"].ToString(); string srcImgen1 = "data:image;base64," + vImagen1; imgDiscoDuro.Src = srcImgen1; } Session["tipoATM"] = vDatos; } catch (Exception Ex) { } Session["TIPO_ATM"] = 1; } }
void cargarDataATM() { if (HttpContext.Current.Session["ATM_ADD"] == null) { try { String vQuery = "STEISP_ATM_Generales 12,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLsucursalATM.Items.Add(new ListItem { Value = "0", Text = "Seleccione sucursal..." }); foreach (DataRow item in vDatos.Rows) { DDLsucursalATM.Items.Add(new ListItem { Value = item["idMunicipio"].ToString(), Text = item["nombre"].ToString() }); } } catch (Exception Ex) { throw; } //UBICACIONES try { String vQuery = "STEISP_ATM_Generales 7,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLUbicacionATM.Items.Add(new ListItem { Value = "0", Text = "Seleccione ubicación..." }); foreach (DataRow item in vDatos.Rows) { DDLUbicacionATM.Items.Add(new ListItem { Value = item["idUbicacion"].ToString(), Text = item["nombreUbicacion"].ToString() }); } } catch (Exception ex) { throw; } //TIPO ATM try { String vQuery = "STEISP_ATM_Generales 1,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLTipoATM.Items.Add(new ListItem { Value = "0", Text = "Seleccione tipo de ATM..." }); foreach (DataRow item in vDatos.Rows) { DDLTipoATM.Items.Add(new ListItem { Value = item["idTipoATM"].ToString(), Text = item["nombreTipoATM"].ToString() }); } } catch (Exception ex) { throw; } //MODELO ATM try { String vQuery = "STEISP_ATM_Generales 2,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLModeloATM.Items.Add(new ListItem { Value = "0", Text = "Seleccione modelo..." }); foreach (DataRow item in vDatos.Rows) { DDLModeloATM.Items.Add(new ListItem { Value = item["idModeloATM"].ToString(), Text = item["nombreModeloATM"].ToString() }); } } catch (Exception ex) { throw; } //TIPO CARGA ATM try { String vQuery = "STEISP_ATM_Generales 4,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLTipoCarga.Items.Add(new ListItem { Value = "0", Text = "Seleccione tipo de carga..." }); foreach (DataRow item in vDatos.Rows) { DDLTipoCarga.Items.Add(new ListItem { Value = item["idTipoCargaATM"].ToString(), Text = item["nombreTipoCargaATM"].ToString() }); } } catch (Exception ex) { throw; } //PROCESADOR ATM try { String vQuery = "STEISP_ATM_Generales 5,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLProcesadorATM.Items.Add(new ListItem { Value = "0", Text = "Seleccione tipo de procesador..." }); foreach (DataRow item in vDatos.Rows) { DDLProcesadorATM.Items.Add(new ListItem { Value = item["idProcesadorATM"].ToString(), Text = item["nombreProcesadorATM"].ToString() }); } } catch (Exception ex) { throw; } //TECLADO ATM try { String vQuery = "STEISP_ATM_Generales 6,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLTecladoATM.Items.Add(new ListItem { Value = "0", Text = "Seleccione tipo de teclado..." }); foreach (DataRow item in vDatos.Rows) { DDLTecladoATM.Items.Add(new ListItem { Value = item["idTecladoATM"].ToString(), Text = item["nombreTecladoATM"].ToString() }); } } catch (Exception ex) { throw; } //SISTEMA OPERATIVO try { String vQuery = "STEISP_ATM_Generales 9,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLso.Items.Add(new ListItem { Value = "0", Text = "Seleccione sistema operativo..." }); foreach (DataRow item in vDatos.Rows) { DDLso.Items.Add(new ListItem { Value = item["idSO"].ToString(), Text = item["nombreSO"].ToString() }); } } catch (Exception ex) { throw; } //VERSION SO try { String vQuery = "STEISP_ATM_Generales 10,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLversionSw.Items.Add(new ListItem { Value = "0", Text = "Seleccione version del software..." }); foreach (DataRow item in vDatos.Rows) { DDLversionSw.Items.Add(new ListItem { Value = item["idVersion"].ToString(), Text = item["nombreVersion"].ToString() }); } } catch (Exception ex) { throw; } //MARCAS try { String vQuery = "STEISP_ATM_Generales 11,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLmarca.Items.Add(new ListItem { Value = "0", Text = "Seleccione la marca..." }); foreach (DataRow item in vDatos.Rows) { DDLmarca.Items.Add(new ListItem { Value = item["idMarca"].ToString(), Text = item["nombreMarca"].ToString() }); } } catch (Exception ex) { throw; } //ESTADOS try { String vQuery = "STEISP_ATM_Generales 8,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLestado.Items.Add(new ListItem { Value = "0", Text = "Seleccione estado de ATM..." }); foreach (DataRow item in vDatos.Rows) { DDLestado.Items.Add(new ListItem { Value = item["idEstado"].ToString(), Text = item["nombreEstado"].ToString() }); } } catch (Exception ex) { throw; } Session["ATM_ADD"] = "1"; } }
void llenarForm() { try { DataTable vDatos = new DataTable(); String vQuery = "SPSTEI_ATM 1,'" + Session["codATM"] + "'"; vDatos = vConexionATM.ObtenerTablaATM(vQuery); foreach (DataRow item in vDatos.Rows) { txtcodATM.Text = item["codATM"].ToString(); txtnombreATM.Text = item["nombreATM"].ToString(); DDLestado.SelectedIndex = CargarInformacionDDL(DDLestado, item["idEstado"].ToString()); DDLsucursalATM.SelectedIndex = CargarInformacionDDL(DDLsucursalATM, item["sucursalATM"].ToString()); DDLUbicacionATM.SelectedIndex = CargarInformacionDDL(DDLUbicacionATM, item["ubicacionATM"].ToString()); DDLTipoATM.SelectedIndex = CargarInformacionDDL(DDLTipoATM, item["tipoATM"].ToString()); DDLModeloATM.SelectedIndex = CargarInformacionDDL(DDLModeloATM, item["ModeloATM"].ToString()); DDLTipoCarga.SelectedIndex = CargarInformacionDDL(DDLTipoCarga, item["tipoCargaATM"].ToString()); DDLProcesadorATM.SelectedIndex = CargarInformacionDDL(DDLProcesadorATM, item["procesadorATM"].ToString()); DDLTecladoATM.SelectedIndex = CargarInformacionDDL(DDLTecladoATM, item["tecladoATM"].ToString()); txtserieATM.Text = item["serieATM"].ToString(); string MyString = item["ramATM"].ToString(); char[] MyChar = { 'G', 'B', ' ' }; string NewString = MyString.TrimEnd(MyChar); txtramATM.Text = NewString; string capacidad = item["capacidadDiscoATM"].ToString(); char[] MyChar1 = { 'G', 'B', ' ' }; string Newcapacidad = capacidad.TrimEnd(MyChar1); txtcapacidadDisco.Text = Newcapacidad; DDLso.SelectedIndex = CargarInformacionDDL(DDLso, item["idSO"].ToString()); txtserieDisco.Text = item["serieDiscoATM"].ToString(); DDLmarca.SelectedIndex = CargarInformacionDDL(DDLmarca, item["idMarca"].ToString()); txtIP.Text = item["ipATM"].ToString(); txtpuerto.Text = item["puertoATM"].ToString(); txtlatitud.Text = item["latitudATM"].ToString(); txtlongitud.Text = item["longitudATM"].ToString(); txtdireccion.Text = item["direccionATM"].ToString(); txtinventarioATM.Text = item["inventarioATM"].ToString(); DDLversionSw.SelectedIndex = CargarInformacionDDL(DDLversionSw, item["idVersionSw"].ToString()); DDLUbicacionATM.SelectedIndex = CargarInformacionDDL(DDLUbicacionATM, item["ubicacionATM"].ToString()); txtcodUbicacion.Text = item["codUbicacion"].ToString(); String vModelo = ""; String vQueryModelo = "STEISP_ATM_Generales 37,'" + item["modeloATM"].ToString() + "'"; DataTable vDatosModelo = vConexion.ObtenerTabla(vQueryModelo); foreach (DataRow itemMod in vDatosModelo.Rows) { vModelo = itemMod["idModeloATM"].ToString(); } DDLModeloATM.SelectedIndex = CargarInformacionDDL(DDLModeloATM, vModelo); //String vQueryDet = "STEISP_ATM_Generales 3,'" + DDLModeloATM.SelectedValue + "'"; // DataTable vDatosDet = vConexion.ObtenerTabla(vQueryDet); // DDLDetalleModelo.Items.Clear(); // DDLDetalleModelo.Items.Add(new ListItem { Value = "0", Text = "Seleccione detalle de modelo..." }); // foreach (DataRow itemDet in vDatosDet.Rows) // { // DDLDetalleModelo.Items.Add(new ListItem { Value = itemDet["idDetalleModeloATM"].ToString(), Text = itemDet["nombreDetalleModeloATM"].ToString() }); // } //DDLDetalleModelo.SelectedIndex = CargarInformacionDDL(DDLDetalleModelo, item["modeloATM"].ToString()); } limpiarImagen(); DataTable vDatos2 = new DataTable(); String vQuery2 = "SPSTEI_ATM 33,'" + Session["codATM"] + "'"; vDatos2 = vConexionATM.ObtenerTablaATM(vQuery2); foreach (DataRow item in vDatos2.Rows) { string vImagen1 = item["imgMapaATM"].ToString(); if (vImagen1 != "") { string srcImgen1 = "data:image;base64," + vImagen1; imgMapaATM.Src = srcImgen1; HFMapa.Value = "si"; } } } catch (Exception Ex) { Mensaje(Ex.Message, WarningType.Danger); } }
void cargarData() { try { DataTable vDatos = new DataTable(); vDatos = vConexion.ObtenerTabla("STEISP_ATM_VERIFICACION 1, '" + Session["USUARIO"].ToString() + "','" + Session["COD_VERIFMANTE_ATM"] + "'"); GVBusqueda.DataSource = vDatos; GVBusqueda.DataBind(); Session["ATM_VERIF_CARGAR"] = vDatos; //Session["UPDATEATM"] = 1; } catch (Exception Ex) { } if (HttpContext.Current.Session["ModalVerif"] == null) { try { DDLModalNewTecnico.Items.Clear(); String vQuery = "STEISP_AGENCIA_CreacionNotificacion 5"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLModalNewTecnico.Items.Add(new ListItem { Value = "0", Text = "Seleccione nuevo técnico..." }); foreach (DataRow item in vDatos.Rows) { DDLModalNewTecnico.Items.Add(new ListItem { Value = item["idUsuario"].ToString(), Text = item["nombre"].ToString() }); } } catch (Exception ex) { throw; } try { String vQuery = "STEISP_ATM_Generales 20,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLModalMotivo.Items.Add(new ListItem { Value = "0", Text = "Seleccione motivo..." }); foreach (DataRow item in vDatos.Rows) { DDLModalMotivo.Items.Add(new ListItem { Value = item["idCancelMant"].ToString(), Text = item["nombreCancelar"].ToString() }); } } catch (Exception ex) { throw; } try { String vQuery = "STEISP_ATM_Generales 21,1"; DataTable vDatos = vConexion.ObtenerTabla(vQuery); DDLModalcambioPor.Items.Add(new ListItem { Value = "0", Text = "Cambio realizado por..." }); foreach (DataRow item in vDatos.Rows) { DDLModalcambioPor.Items.Add(new ListItem { Value = item["id"].ToString(), Text = item["nombre"].ToString() }); } } catch (Exception ex) { throw; } Session["ModalVerif"] = 1; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Convert.ToBoolean(Session["AUTH"])) { Response.Redirect("/login.aspx"); } DataTable vDatosP = (DataTable)Session["AUTHCLASS"]; string ver = Session["USUARIO"].ToString(); if (!Page.IsPostBack) { if (!vSecurity.ObtenerPermiso(Session["USUARIO"].ToString(), 3).Consulta) { Response.Redirect("/default.aspx"); } if (vSecurity.ObtenerPermiso(Session["USUARIO"].ToString(), 3).Creacion) { //LIAgregar.Visible = true; LIModCrear.Visible = true; LIVerCrear.Visible = true; LIMatSolicitar.Visible = true; LIDevoluciones.Visible = true; } if (vSecurity.ObtenerPermiso(Session["USUARIO"].ToString(), 3).Edicion) { LIModAprobar.Visible = true; LIVerAprobar.Visible = true; LIMatAprobar.Visible = true; LIReprogramar.Visible = true; LICalendario.Visible = true; } DataTable vDatos = (DataTable)Session["AUTHCLASS"]; LitUsuario.Text = vDatos.Rows[0]["nombre"].ToString().ToUpper() + " " + vDatos.Rows[0]["apellidos"].ToString().ToUpper(); String vString = "", vPointer = ""; String vQuery = "[STEISP_Mensajes] 3,'" + Session["USUARIO"].ToString() + "'"; vDatos = vConexion.ObtenerTabla(vQuery); for (int i = 0; i < vDatos.Rows.Count; i++) { vPointer = "<span class='heartbit'></span><span class='point'></span>"; String vColor = "", vLogo = ""; if (vDatos.Rows[i]["idAplicacion"].ToString() == "1") { vColor = "primary"; vLogo = "ti ti-shopping-cart"; } else if (vDatos.Rows[i]["idAplicacion"].ToString() == "2") { vColor = "success"; vLogo = "ti ti-home"; } else if (vDatos.Rows[i]["idAplicacion"].ToString() == "3") { vColor = "info"; vLogo = "ti ti-desktop"; } else if (vDatos.Rows[i]["idAplicacion"].ToString() == "4") { vColor = "danger"; vLogo = "ti ti-plug"; } vString += "<a href = 'javascript:void(0)'>" + "<div class='btn btn-" + vColor + " btn-circle'><i class='" + vLogo + "'></i></div>" + "<div class='mail-contnet'>" + "<h5>" + vDatos.Rows[i]["asunto"].ToString() + "</h5>" + "<span class='mail-desc'>" + vDatos.Rows[i]["mensaje"].ToString() + "</span> <span class='time'>" + vDatos.Rows[i]["nombre"].ToString() + "</span>" + "</div>" + "</a>"; } LitNotificaciones.Text = vString; LitPointer.Text = vPointer; string vUsuario = Session["USUARIO"].ToString(); LIPermisos.Visible = false; LIMenuATM.Visible = false; LINotifATM.Visible = false; LIModCrear.Visible = false; LINotifATM.Visible = false; LIModAprobar.Visible = false; LIVerifATM.Visible = false; LIVerCrear.Visible = false; LIVerifATM.Visible = false; LIVerCrear.Visible = false; LIDevoluciones.Visible = false; LIVerifATM.Visible = false; LIVerAprobar.Visible = false; LIReprogramar.Visible = false; LICalendario.Visible = false; LIAvances.Visible = false; LICancelar.Visible = false; LICambiarFecha.Visible = false; LIAvancesCorrectivo.Visible = false; LICorrectivoNotif.Visible = false; LICorrectivoVerifCrea.Visible = false; LICorrectivoVerifAprobar.Visible = false; LICorrectivoVerifDevolver.Visible = false; DataTable vDatosMain = new DataTable(); String vQueryMain = "[STEISP_ATM_Generales] 46,'" + vUsuario + "'"; vDatosMain = vConexion.ObtenerTabla(vQueryMain); foreach (DataRow item in vDatosMain.Rows) { if (item["permisos"].ToString() == "True") { LIPermisos.Visible = true; LICancelar.Visible = true; LICambiarFecha.Visible = true; } if (item["ATM"].ToString() == "True") { LIMenuATM.Visible = true; } if (item["crearNotif"].ToString() == "True") { LINotifATM.Visible = true; LIModCrear.Visible = true; LIModAprobar.Visible = true; LICorrectivoNotif.Visible = true; } //if (item["aprobarNotif"].ToString() == "True") //{ // LINotifATM.Visible = true; // LIModAprobar.Visible = true; //} if (item["crearVerif"].ToString() == "True") { LIVerifATM.Visible = true; LIVerCrear.Visible = true; LICorrectivoVerifCrea.Visible = true; LICorrectivoVerifDevolver.Visible = true; LIDevoluciones.Visible = true; } //if (item["crearVerif"].ToString() == "True") //{ // LIVerifATM.Visible = true; // LIVerCrear.Visible = true; // LIDevoluciones.Visible = true; //} if (item["aprobarVerif"].ToString() == "True") { LIVerifATM.Visible = true; LIVerAprobar.Visible = true; LICorrectivoVerifAprobar.Visible = true; } if (item["reprogramar"].ToString() == "True") { LIReprogramar.Visible = true; } if (item["calendario"].ToString() == "True") { LICalendario.Visible = true; } if (item["avance"].ToString() == "True") { LIAvances.Visible = true; LIAvancesCorrectivo.Visible = true; } } //if (vUsuario== "jmembreno") //{ // LINotifATM.Visible = true; // LIVerAprobar.Visible = false; //} } } catch (Exception ex) { String vError = ex.Message; } }
public void procesarArchivo(DataSet vArchivo, ref int vSuccess, string DireccionCarga, string TipoProceso) { try { if (vArchivo.Tables[0].Rows.Count > 0) { DataTable vDatos = vArchivo.Tables[0]; string vQuery = ""; //Boolean idEmpleado = false; Session["CODATM_SUBIDO"] = "Completo"; Session["FECHA_SUBIDO"] = "Completo"; for (int i = 0; i < vDatos.Rows.Count; i++) { String CodATM = vDatos.Rows[i]["CodigoATM"].ToString(); String Fecha = vDatos.Rows[i]["FECHA"].ToString(); //String vFormato = "yyyy/MM/dd"; //"dd/MM/yyyy HH:mm:ss" string vFechaMant = Convert.ToDateTime(Fecha).Year.ToString(); string vCodATM = ""; String vQuery2 = "SPSTEI_ATM 3, '" + CodATM + "'"; DataTable vDatos2 = vConexionATM.ObtenerTablaATM(vQuery2); foreach (DataRow item in vDatos2.Rows) { Session["CODATM_MANT"] = item["codATM"].ToString(); vCodATM = item["codATM"].ToString(); } if (Session["CODATM_MANT"].ToString() != CodATM) { if (Session["CODATM_SUBIDO"].ToString() == "Completo") { Session["CODATM_SUBIDO"] = ""; } Session["CODATM_SUBIDO"] = Session["CODATM_SUBIDO"] + ", " + CodATM; } DateTime today = DateTime.Today; string vYear = Convert.ToString(today.Year); if (vFechaMant != vYear) { if (Session["FECHA_SUBIDO"].ToString() == "Completo") { Session["FECHA_SUBIDO"] = ""; } Session["FECHA_SUBIDO"] = Session["FECHA_SUBIDO"] + ", " + CodATM; } } if (Session["CODATM_SUBIDO"].ToString() != "Completo" || Session["FECHA_SUBIDO"].ToString() != "Completo") { throw new Exception(); } else { if (TipoProceso == "LISTA_MAN") { Boolean vCodATM = false, vFecha = false; foreach (DataColumn item in vDatos.Columns) { if (item.ColumnName.ToString() == "CodigoATM") { vCodATM = true; } if (item.ColumnName.ToString() == "FECHA") { vFecha = true; } } if (vCodATM && vFecha) { for (int i = 0; i < vDatos.Rows.Count; i++) { String CodATM = vDatos.Rows[i]["CodigoATM"].ToString(); String Fecha = vDatos.Rows[i]["FECHA"].ToString(); String vFormato = "yyyy/MM/dd"; //"dd/MM/yyyy HH:mm:ss" String vFechaMant = Convert.ToDateTime(Fecha).ToString(vFormato); String ATM = ""; String FECHA = ""; DataTable vDatosP = new DataTable(); String vQueryP = "STEISP_ATM_Generales 40,'" + CodATM + "'"; vDatosP = vConexion.ObtenerTabla(vQueryP); foreach (DataRow item in vDatosP.Rows) { ATM = item["codATM"].ToString(); FECHA = Convert.ToDateTime(item["fechaMantenimiento"].ToString()).ToString(vFormato); } if (ATM == CodATM && FECHA == vFechaMant) { Session["FechaRepetida"] = Session["FechaRepetida"] + ", " + CodATM + "-" + vFechaMant; } else { vQuery = "STEISP_ATM_Mantenimientos '" + vFechaMant + "'" + ",'" + CodATM + "'" + ",'" + Session["USUARIO"].ToString() + "'"; //Session["FechaRepetida"] = null; int vRespuesta = vConexion.ejecutarSQL(vQuery); //VALIDA QUE ATM ESTE ACTIVO String vQuery2 = "STEISP_ATM_VERIFICACION 8, '" + CodATM + "'"; DataTable vDatos2 = vConexion.ObtenerTabla(vQuery2); if (vRespuesta == 1) { vSuccess++; } } } } } } } else { throw new Exception("No contiene ninguna hoja de excel."); } } catch (Exception ex) { LbMensaje.Text = ex.Message; } }