Esempio n. 1
0
        // metodo para validar las modificaciones
        private bool ModificarDatos()
        {
            this.reportes = ObtenerModificaciones();
            try
            {
                if (ValidarTextbox() == true)
                {
                    controlReportes.modificarReportes(this.reportes);
                    cargarDatos();
                    MessageBox.Show("Datos Correctamente Modificados", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al Modificar los Datos", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Console.WriteLine(ex.Message);
                return(false);

                throw;
            }
        }
Esempio n. 2
0
        // metodos para retornar los datos en una modificacion
        private clsReporte ObtenerModificaciones()
        {
            clsReporte auxReporte = new clsReporte();

            auxReporte.SNombre    = txtNombre.Text;
            auxReporte.SRuta      = txtRuta.Text;
            auxReporte.IIdReporte = iIDAux;
            return(auxReporte);
        }
Esempio n. 3
0
        // metodo para retornar los datos
        private clsReporte llenarCampos()
        {
            clsReporte auxReporte = new clsReporte();

            auxReporte.SNombre = txtNombre.Text;
            auxReporte.SRuta   = txtRuta.Text;
            auxReporte.IEstado = 1;
            return(auxReporte);
        }
Esempio n. 4
0
 // metodos para modificar datos en el reporte
 public void modificarReportes(clsReporte reporte)
 {
     try
     {
         string sComando = string.Format("UPDATE REPORTE SET nombre_reporte='{1}', ruta_reporte='{2}' WHERE pk_id_reporte={0};", reporte.IIdReporte, reporte.SNombre, reporte.SRuta);
         this.sentencia.ejecutarQuery(sComando);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Modificar Datos", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Console.WriteLine(ex.Message);
     }
 }
Esempio n. 5
0
        private int iIDRuta;                         //Toma valor de ID reporte

        // Metodo para insertar datos en reporte
        public void insertarReportes(clsReporte reporte)
        {
            try
            {
                string sComando = string.Format("INSERT INTO REPORTE(nombre_reporte, ruta_reporte, estado_reporte) VALUES ('{0}','{1}',{2});", reporte.SNombre, reporte.SRuta, reporte.IEstado);
                this.sentencia.ejecutarQuery(sComando);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al Ingresar Datos", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Console.WriteLine(ex.Message);
            }
        }
Esempio n. 6
0
 private bool guardarDatos()
 {
     this.reportes = llenarCampos();
     try
     {
         controlReportes.insertarReportes(this.reportes);
         cargarDatos();
         MessageBox.Show("Datos Correctamente Guardados", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar los Datos", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Console.WriteLine(ex.Message);
         return(false);
     }
 }
Esempio n. 7
0
        public string ReportePorBarrio(string stObj)
        {
            JObject    Jobj;
            clsReporte objClsReporte;

            try
            {
                Jobj = JObject.Parse(stObj);
                string fechaDesde = Jobj["rec_fechaDesde"].ToString();
                string fechaHasta = Jobj["rec_fechaHasta"].ToString();
                int    top        = Convert.ToInt32(Jobj["inTop"]);

                objClsReporte = new clsReporte();
                return(JsonConvert.SerializeObject(objClsReporte.ReportePorBarrio(fechaDesde, fechaHasta, top)));
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
            }
        }
Esempio n. 8
0
        public string ReporteReclamoPorEstado(string stObj)
        {
            JObject    Jobj;
            clsReporte objClsReporte;

            try
            {
                Jobj = JObject.Parse(stObj);
                int    top            = Convert.ToInt32(Jobj["inTop"]);
                string fechaDesde     = Jobj["rec_fechaDesde"].ToString();
                string fechaHasta     = Jobj["rec_fechaHasta"].ToString();
                int    IDAreaServicio = Convert.ToInt32(Jobj["IDAreaServicio"]);

                objClsReporte = new clsReporte();
                return(JsonConvert.SerializeObject(objClsReporte.ReporteReclamoPorEstado(top, fechaDesde, fechaHasta, IDAreaServicio)));
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
            }
        }