コード例 #1
0
        protected void GuardarCoordenada(object sender, EventArgs e)
        {
            double lat;
            double lon;

            try
            {
                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('.', ',')));
                DataRow dat       = ord.ConsultarIdservicio(valosal).Rows[0];
                DataRow puntoedit = punto.ConsultarPuntosEdit(dat["idservicio"].ToString()).Rows[0];
                if (punto.ActualizarPuntoAvanzado(puntoedit["estadocol"].ToString(), puntoedit["direcioncol"].ToString(), lat.ToString(), lon.ToString(), puntoedit["barrios_idbarrioscol"].ToString(), puntoedit["tipocol"].ToString(), puntoedit["idservicioscol"].ToString(), puntoedit["referenciascol"].ToString(), puntoedit["idpuntoscol"].ToString()))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "ErrorPunto('ACTUALIZACION EXITOSA!','Punto Geografico Actualizado correctamente','success');", true);
                    bandera = 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);
                    bandera = false;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "ErrorPunto('ACTUALIZACION FALLIDA','" + ex.Message + "','error');", true);
                bandera = false;
            }
        }
コード例 #2
0
        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);
            }
        }