Beispiel #1
0
 protected void BUSCAR_ServerClick(object sender, EventArgs e)
 {
     try
     {
         casos    = Validar.ConvertVarchar(caso.SelectedValue);
         fecha1   = Validar.ConvertDate(fechainicio.Text);
         fecha2   = Validar.ConvertDate(fechafin.Text);
         estad    = Validar.ConvertVarchar(estado.SelectedValue);
         sald     = Validar.ConvertNumber(saldo.Text);
         barr     = Validar.ConvertNumber(barrio.SelectedValue);
         pla      = Validar.ConvertNumber(plan.SelectedValue);
         tip      = Validar.ConvertVarchar(tipo.SelectedValue);
         metenvio = Validar.ConvertVarchar(methenvio.SelectedValue);
         data     = report.ConsultaAvanzada(casos, fecha1, fecha2, estad, sald, barr, pla, tip, metenvio);
         repetidors.DataSource = data;
         repetidors.DataBind();
         Alerta.Visible = false;
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }
Beispiel #2
0
 protected void RegistrarInventario(object sender, EventArgs e)
 {
     ClientScript.RegisterStartupScript(GetType(), "alerta", "panel2();", true);
     try
     {
         invent.serial      = Validar.ConvertVarchar(serial_.Value);
         invent.mac         = Validar.ConvertVarchar(mac_.Value);
         invent.descripcion = Validar.validarlleno(descripcion_.Value);
         invent.tipoproducto_idtipoproducto = Validar.validarselected(tipoproducto_inv.SelectedValue);
         invent.vidautil        = Validar.validarlleno(vidautil_.Value);
         invent.estado          = Validar.validarselected(estado_.SelectedValue);
         invent.modelo_idmodelo = Validar.validarselected(modelo_inv.SelectedValue);
         invent.compra_idcompra = valuecontrato;
         if (invent.RegistrarInventario(invent))
         {
             textError.InnerHtml = "Elemento registrado correctamente";
             Alerta.CssClass     = "alert alert-success";
             Alerta.Visible      = true;
             cargardatosqueseusanentodolado();
             datosdeldetalle();
         }
         else
         {
             textError.InnerHtml = "No se pudo registrar el elemento";
             Alerta.CssClass     = "alert alert-error";
             Alerta.Visible      = true;
         }
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }
Beispiel #3
0
        protected void consultar_ServerClick(object sender, EventArgs e)
        {
            string    Valor2 = Validar.ConvertVarchar(serial_.Value);
            DataTable dtinve = invent.inventseril(Valor2);

            GridView1.DataSource = dtinve;
            GridView1.DataBind();
            ScriptManager.RegisterStartupScript(this, this.GetType(), "pop", "openModaldesc();", true);
        }
 protected void btnRegistrarpago(object sender, EventArgs e)
 {
     try
     {
         Terceros ter = (Terceros)Session["tercero"];
         if (Convert.ToInt32(textpagado.Text) > 0)
         {
             pago.pagado = textpagado.Text;
             pago.terceros_idterceros = ter.idterceros;
             pago.factura_idfactura   = idfactura.InnerHtml;
             pago.tipopago_idtipopago = DropDownListtipopago.SelectedValue;
             pago.banco_idbanco       = Validar.ConvertNumber(DropDownListbanco.SelectedValue);
             pago.referencia          = Validar.ConvertVarchar(TextBoxnumreferencia.Text);
             string ipprivada = GetLocalIPAddress();
             string ippublica = GetPublicIPAddress();
             if (int.Parse(textretencion.Value) >= 0)
             {
                 DataRow dat = pago.RegistrarPago(pago, ter.identificacion + ": " + ter.nombre + " " + ter.apellido, GetLocalIPAddress() + "-" + GetRemoteNameDNS() + "-" + GetPublicIPAddress(), textretencion.Value).Rows[0];
                 if (dat["pr_insertar_pagos"].ToString() != null)
                 {
                     btnimprimir.Visible = true;
                     textError.InnerHtml = "Pago registrado correctamente";
                     Alerta.CssClass     = "alert alert-success";
                     Alerta.Visible      = true;
                     idpago.InnerHtml    = dat["pr_insertar_pagos"].ToString();
                     ConsularDatos(cod.InnerHtml);
                     btnpago.Visible     = false;
                     btnimprimir.Visible = true;
                     textretencion.Value = "0";
                 }
             }
         }
         else
         {
             textError.InnerHtml = "Esta Ingresando un valor negativo o letras";
             Alerta.CssClass     = "alert alert-error";
             Alerta.Visible      = true;
         }
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }
        protected void btn_actualizara_ServerClick(object sender, EventArgs e)
        {
            try
            {
                Validar.validarselected(estadoserv.SelectedValue);
                Validar.validarselected(barrio_.SelectedValue);
                Validar.validarselected(tipo.SelectedValue);
                Validar.validarlleno(direcciont_.Text);
                Validar.ConvertVarchar(referencia_.Text);
                double lat;
                double lon;
                if (latitud_.Text.Equals("") && longitud_.Text.Equals(""))
                {
                    lat = Validar.ObtenerLatitud(Convert.ToInt32(latgrados.Value), Convert.ToInt32(latminut.Value), Convert.ToDouble(latsegun.Value.Replace('.', ',')));
                    lon = Validar.ObtenerLongitud(Convert.ToInt32(longrados.Value), Convert.ToInt32(lonminut.Value), Convert.ToDouble(lonsegun.Value.Replace('.', ',')));
                }
                else
                {
                    lat = Convert.ToDouble(latitud_.Text.Replace('.', ','));
                    lon = Convert.ToDouble(longitud_.Text.Replace('.', ','));
                }
                if (punto.ActualizarPuntoAvanzado(estadoserv.SelectedValue, direcciont_.Text, lat.ToString(), lon.ToString(), barrio_.SelectedValue, tipo.SelectedValue, idserv.Text, referencia_.Text, idpuntoac.Text))
                {
                    punt = punto.consultarpuntosdelservicio(idserv.Text);
                    estadoserv.SelectedValue = "Seleccione";
                    direcciont_.Text         = "";
                    barrio_.SelectedValue    = "Seleccione";
                    tipo.SelectedValue       = "Seleccione";
                    idserv.Text      = "";
                    referencia_.Text = "";
                    idpuntoac.Text   = "";

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "ErrorPunto('ACTUALIZACION EXITOSA!','Punto Geografico Actualizado correctamente','success');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "ErrorPunto('ACTUALIZACION FALLIDA','Verifique que los espacios se encuentren correctamente diligenciados, recuerde seleccionar el servicio a modificar!','error');", true);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "ErrorPunto('ACTUALIZACION FALLIDA','" + ex.Message + "','error');", true);
            }
        }
Beispiel #6
0
 protected void confimarregistro_Click(object sender, EventArgs e)
 {
     try
     {
         invent.serial = Validar.ConvertVarchar(txtserial.Text);
         invent.mac    = Validar.ConvertVarchar(txtmac.Text);
         if (droptipoproduc.SelectedItem.Text.Equals("RADIO") || droptipoproduc.SelectedItem.Text.Equals("ONU") || droptipoproduc.SelectedItem.Text.Equals("ROUTER"))
         {
             dtc.registrarproducto(invent.serial, txtdescripcion.Text, droptipoproduc.SelectedValue, txtvidautil.Text, dropmodelo.SelectedValue, invent.mac, txtcantidad.Text, valuecontrato);
             cargardatosqueseusanentodolado();
             datosdeldetalle();
             divcaracteristicaequipo.Visible = false;
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "swal('ERROR AL REGISTRAR!', 'Fallo en registar ', 'error');", true);
     }
 }
 protected void RegistrarTercero(object sender, EventArgs e)
 {
     ClientScript.RegisterStartupScript(GetType(), "alerta", "panel3();", true);
     try
     {
         if (activacion)//si es true se activa la actualizacion de lo contrario solo registra
         {
             terc.idterceros        = codigo.InnerHtml;
             terc.identificacion    = Validar.validarlleno(identificacion_.Value);
             terc.nombre            = Validar.validarlleno(nombre_.Value).ToUpper();
             terc.apellido          = Validar.ConvertVarchar(apellido_.Value).ToUpper();
             terc.direccion         = Validar.ConvertVarchar(Direccion_.Value).ToUpper();
             terc.correo            = Validar.ConvertVarchar(correo_.Value).ToUpper();
             terc.estrato           = Validar.ConvertVarchar(estrato_.SelectedValue);
             terc.estado            = Validar.validarselected(estado_.SelectedValue).ToUpper();
             terc.tipodoc_idtipodoc = Validar.validarselected(tipodoc_.SelectedValue);
             terc.tiporesidencia_idtiporesidencia = Validar.ConvertNumber(tiporesident_.SelectedValue);
             terc.tipofactura_idtipofactura       = Validar.ConvertNumber(tipofact_.SelectedValue);
             terc.barrios_idbarrios = Validar.validarselected(barrio_.SelectedValue);
             terc.fechanatcimiento  = Validar.ConvertDate(fecnac_.Value);
             terc.rh = Validar.ConvertVarchar(rh_.SelectedValue).ToUpper();
             Validar.validartelefono(listtelefono);
             if (terc.ActualizarTercero(terc))
             {
                 tlf.terceros_idterceros = terc.identificacion;
                 tlf.EliminarTelefono(tlf);
                 foreach (DataRow item in listtelefono.Rows)
                 {
                     tlf.telefono            = item["telefono"].ToString();
                     tlf.terceros_idterceros = terc.identificacion;
                     tlf.RegistrarTelefono(tlf);
                 }
                 ct.identificacion = terc.identificacion;
                 ct.EliminarCargoTercero(ct);
                 foreach (DataRow item in tabletipo.Rows)
                 {
                     ct.tercero_idtercero         = terc.identificacion;
                     ct.tipotercero_idtipotercero = item[0].ToString();
                     ct.Registrarcargotercero(ct);
                 }
                 textError.InnerHtml = "Actualizado correctamente";
                 Alerta.CssClass     = "alert alert-success";
                 Alerta.Visible      = true;
             }
             else
             {
                 textError.InnerHtml = "Error al Actualizar";
                 Alerta.CssClass     = "alert alert-error";
                 Alerta.Visible      = true;
             }
         }
         else
         {
             terc.identificacion = Validar.validarlleno(identificacion_.Value);
             if (terc.ConsultarPersonaIdentifall(terc).Rows.Count > 0)
             {
                 textError.InnerHtml = "El usuario ya se encuentra registrado";
                 Alerta.CssClass     = "alert alert-error";
                 Alerta.Visible      = true;
             }
             else
             {
                 terc.identificacion    = Validar.validarlleno(identificacion_.Value);
                 terc.nombre            = Validar.validarlleno(nombre_.Value).ToUpper();
                 terc.apellido          = Validar.ConvertVarchar(apellido_.Value).ToUpper();
                 terc.direccion         = Validar.validarlleno(Direccion_.Value).ToUpper();
                 terc.correo            = Validar.validarlleno(correo_.Value).ToUpper();
                 terc.estrato           = Validar.ConvertVarchar(estrato_.SelectedValue);
                 terc.estado            = Validar.validarselected(estado_.SelectedValue).ToUpper().ToUpper();
                 terc.tipodoc_idtipodoc = Validar.validarselected(tipodoc_.SelectedValue);
                 terc.tiporesidencia_idtiporesidencia = Validar.ConvertNumber(tiporesident_.SelectedValue);
                 terc.tipofactura_idtipofactura       = Validar.ConvertNumber(tipofact_.SelectedValue);
                 terc.barrios_idbarrios = Validar.validarselected(barrio_.SelectedValue);
                 terc.fechanatcimiento  = Validar.ConvertDate(fecnac_.Value);
                 terc.rh = Validar.ConvertVarchar(rh_.SelectedValue).ToUpper();
                 //Validar.validartelefono(listtelefono);
                 if (terc.RegistrarTerceroGeneral(terc))
                 {
                     foreach (DataRow item in listtelefono.Rows)
                     {
                         tlf.telefono            = item["telefono"].ToString();
                         tlf.terceros_idterceros = terc.identificacion;
                         tlf.RegistrarTelefono(tlf);
                     }
                     foreach (DataRow item in tabletipo.Rows)
                     {
                         ct.identificacion            = identificacion_.Value;
                         ct.tipotercero_idtipotercero = item[0].ToString();
                         ct.Registrarcargotercero(ct);
                     }
                     Limpiar();
                     textError.InnerHtml = "Se ha registrado con exito";
                     Alerta.CssClass     = "alert alert-success";
                     Alerta.Visible      = true;
                 }
                 else
                 {
                     textError.InnerHtml = "Error al registrar el usuario";
                     Alerta.CssClass     = "alert alert-error";
                     Alerta.Visible      = true;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }