예제 #1
0
 protected void btnModalEnviarTipoCargaATM_Click(object sender, EventArgs e)
 {
     if (txtModalNewTipoCargaATM.Text == "" || txtModalNewTipoCargaATM.Text == string.Empty)
     {
         txtAlerta1.Visible = true;
     }
     else
     {
         try
         {
             string vQuery = "SPSTEI_ATM 19, '" + Session["codtipocargaATM"] + "','" + txtModalNewTipoCargaATM.Text + "'";
             Int32  vInfo  = vConexionATM.ejecutarSQLATM(vQuery);
             if (vInfo == 1)
             {
                 txtAlerta1.Visible           = false;
                 txtModalNewTipoCargaATM.Text = string.Empty;
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "Pop", "closeModal();", true);
                 Mensaje("Tipo de carga ATM modificado con éxito", WarningType.Success);
                 UpdateGridView.Update();
                 cargarData();
             }
             else
             {
                 txtAlerta1.Text    = "No se pudo modificar el tipo de carga ATM";
                 txtAlerta1.Visible = true;
             }
         }
         catch (Exception Ex)
         {
             throw;
         }
     }
 }
예제 #2
0
        protected void btnModalModificarATM_Click(object sender, EventArgs e)
        {
            try
            {
                string vQuery = "STEISP_ATM_CrearATM 1,'" + txtcodATM.Text + "'," +
                                "" + DDLsucursalATM.SelectedValue + "," +
                                "" + DDLUbicacionATM.SelectedValue + "," +
                                "" + DDLModeloATM.SelectedValue + ", " + DDLTipoCarga.SelectedValue + "," +
                                "" + DDLProcesadorATM.SelectedValue + "," + DDLTecladoATM.SelectedValue + "," +
                                "'" + txtserieATM.Text + "','" + txtramATM.Text + " GB" + "', " + DDLso.SelectedValue + "," +
                                "'" + txtserieDisco.Text + "','" + txtcapacidadDisco.Text + " GB" + "'," + DDLmarca.SelectedValue + "," +
                                "'" + txtlatitud.Text + "','" + txtlongitud.Text + "'," +
                                "'" + txtdireccion.Text + "','" + Session["USUARIO"].ToString() + "','" + txtinventarioATM.Text + "'," +
                                "'" + DDLversionSw.SelectedValue + "','" + txtcodUbicacion.Text + "'";
                Int32 vInfo = vConexionATM.ejecutarSQLATM(vQuery);
                if (vInfo == 1)
                {
                    //IMAGENES1
                    String         vNombreDepot11   = String.Empty;
                    HttpPostedFile bufferDeposito11 = FUMapaATM.PostedFile;
                    byte[]         vFileDeposito11  = null;
                    string         vExtension11     = string.Empty;

                    if (bufferDeposito11 != null)
                    {
                        vNombreDepot11 = FUMapaATM.FileName;
                        Stream       vStream11 = bufferDeposito11.InputStream;
                        BinaryReader vReader11 = new BinaryReader(vStream11);
                        vFileDeposito11 = vReader11.ReadBytes((int)vStream11.Length);
                        vExtension11    = System.IO.Path.GetExtension(FUMapaATM.FileName);
                    }
                    String vArchivo = String.Empty;
                    if (vFileDeposito11 != null)
                    {
                        vArchivo = Convert.ToBase64String(vFileDeposito11);
                    }

                    if (FUMapaATM.HasFile != false)
                    {
                        string vQuery2 = "SPSTEI_ATM 34, '" + txtcodATM.Text + "','" + vArchivo + "'";
                        vConexionATM.ejecutarSQLATM(vQuery2);
                    }

                    string vCodUbicacion = "";

                    String    vQueryCod = "SPSTEI_ATM 1, '" + txtcodATM.Text + "'";
                    DataTable vDatosCod = vConexionATM.ObtenerTablaATM(vQueryCod);
                    foreach (DataRow item in vDatosCod.Rows)
                    {
                        vCodUbicacion = item["codUbicacion"].ToString();
                    }

                    if (vCodUbicacion == "")
                    {
                        //ACTUALIZAR UBICACIONES
                        string    IDUbi   = "5";
                        int       vEstado = 1;
                        String    vQuery3 = "STEISP_INVENTARIO_Ubicaciones 4, '" + Session["InvUbicacion"] + "','" + IDUbi + "', '" + DDLsucursalATM.SelectedValue + "','" + txtcodUbicacion.Text + "','" + txtdireccion.Text + "','" + vEstado + "','" + Session["USUARIO"].ToString() + "','" + txtnombreATM.Text + "'";
                        DataTable vDatos3 = vConexion.ObtenerTabla(vQuery3);
                    }
                    //VALIDA QUE ATM ESTE ACTIVO
                    //String vQuery2 = "STEISP_ATM_VERIFICACION 9, '" + txtcodATM.Text + "',1";
                    //DataTable vDatos2 = vConexion.ObtenerTabla(vQuery2);
                    //if (vInfo == 1)
                    //{
                    Limpiar();
                    cargarDataATM();
                    limpiarImagen();
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "Pop", "closeModal();", true);
                    Mensaje("ATM modificado con éxito", WarningType.Success);
                    Response.Redirect("update.aspx");
                }
                else
                {
                    Mensaje("No se pudo modificar el ATM", WarningType.Warning);
                }
            }
            catch (Exception Ex)
            {
                throw;
            }
        }