void cargarData()
 {
     if (HttpContext.Current.Session["TIPO_CARGA_ATM"] == null)
     {
         try
         {
             DataTable vDatos = new DataTable();
             vDatos = vConexionATM.ObtenerTablaATM("SPSTEI_ATM 5");
             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["tipoCargaATM"] = vDatos;
         }
         catch (Exception Ex)
         {
         }
         Session["TIPO_CARGA_ATM"] = 1;
     }
 }
Beispiel #2
0
        void cargarData()
        {
            try
            {
                DataTable vDatos = new DataTable();
                vDatos = vConexionATM.ObtenerTablaATM("SPSTEI_ATM 2");
                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;
                        LinkButton LbEdit2 = item.FindControl("btnmodificarATM") as LinkButton;
                        //LbEdit.Visible = true;
                        LbEdit2.Visible = true;
                    }
                }
                Session["ATM"]       = vDatos;
                Session["UPDATEATM"] = 1;
            }
            catch (Exception Ex)
            {
                Mensaje(Ex.Message, WarningType.Danger);
            }
        }
Beispiel #3
0
        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;
            }
        }
        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;
            }
        }
Beispiel #5
0
        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);
            }
        }