Example #1
0
        public string Insertar(int parCarp, string parConsecutivo, string parDepartamento, string parEstado, string parTipo, string parMedio, string parMotivo, string parMedicamento, string parCapitaEvento, string parMunicipioAplica, clsRemitente parObjRemitente)
        {
            try
            {
                clsSolicitud v = new clsSolicitud();
                if (true)
                {
                    clsSQLITE.ConectarBase();
                    //Escribimos la cadena sql

                    string        varComando   = "insert into Solicitud values(" + parCarp + ",'" + parConsecutivo + "','" + parDepartamento + "','" + parEstado + "','" + parTipo + "','" + parMedio + "','" + parMotivo + "','" + parMedicamento + "','" + parCapitaEvento + "','" + parMunicipioAplica + "'," + parObjRemitente.ObtenerId + ");";
                    SQLiteCommand varInsercion = new SQLiteCommand(varComando, clsSQLITE.atrConexion);
                    //y la ejecutamos
                    varInsercion.ExecuteNonQuery();
                    return("Solicitud Insertada con éxito");
                }
                else
                {
                    return("Ya existe una Solicitud con ese mismo CARP o el CARP insertado corresponde a un valor incorrecto");
                }
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
Example #2
0
 public clsPresenta(clsCliente parObjCliente, clsSolicitud parObjSolicitud, string parFecha, string parEnvioRespuesta, string parFechaEnvioRespuesta, string parEntregaMx, string parCumplimiento, string parJustificacion)
 {
     this.atrObjCliente          = parObjCliente;
     this.atrObjSolicitud        = parObjSolicitud;
     this.atrFecha               = parFecha;
     this.atrEnvioRespuesta      = parEnvioRespuesta;
     this.atrFechaEnvioRespuesta = parFechaEnvioRespuesta;
     this.atrEntregaMx           = parEntregaMx;
     this.atrCumplimiento        = parCumplimiento;
     this.atrJustificacion       = parJustificacion;
 }
Example #3
0
        public clsSolicitud Encontrar(int parCarp)
        {
            try
            {
                clsSQLITE.ConectarBase();
                //Escribimos la cadena sql
                string           varConsulta     = "select * from Solicitud where Carp=" + parCarp;
                SQLiteCommand    cmd             = new SQLiteCommand(varConsulta, clsSQLITE.atrConexion);
                SQLiteDataReader datos           = cmd.ExecuteReader();
                clsSolicitud     varObjSolicitud = new clsSolicitud();
                clsRemitente     varObjRemitente = new clsRemitente();
                int varId;

                while (datos.Read())
                {
                    this.atrCarp            = (int)datos[0];
                    this.atrConsecutivo     = Convert.ToString(datos[1]);
                    this.atrDepartamento    = Convert.ToString(datos[2]);
                    this.atrEstado          = Convert.ToString(datos[3]);
                    this.atrTipo            = Convert.ToString(datos[4]);
                    this.atrMedio           = Convert.ToString(datos[5]);
                    this.atrMotivo          = Convert.ToString(datos[6]);
                    this.atrMedicamento     = Convert.ToString(datos[7]);
                    this.atrCapitaEvento    = Convert.ToString(datos[8]);
                    this.atrMunicipioAplica = Convert.ToString(datos[9]);
                    varId = (int)datos[10];
                }
                this.atrObjRemitente = varObjRemitente.Encontrar((int)datos[9]);
                cmd.Dispose();
                if (varObjSolicitud.ObtenerCarp != 0)
                {
                    return(varObjSolicitud);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                return(null);
            }
        }
Example #4
0
        public clsPresenta Encontrar(long parCedula, int parCarp)
        {
            try
            {
                clsSQLITE.ConectarBase();
                //Escribimos la cadena sql
                string           varConsulta     = "select * from Presenta where (Cedula=" + parCedula + " and Carp=" + parCarp + ");";
                SQLiteCommand    cmd             = new SQLiteCommand(varConsulta, clsSQLITE.atrConexion);
                SQLiteDataReader datos           = cmd.ExecuteReader();
                clsPresenta      varObjPresenta  = new clsPresenta();
                clsSolicitud     varObjSolicitud = new clsSolicitud();
                clsCliente       varObjCliente   = new clsCliente();

                while (datos.Read())
                {
                    this.atrObjCliente          = varObjCliente.Encontrar((long)datos[0]);
                    this.atrObjSolicitud        = varObjSolicitud.Encontrar((int)datos[1]);
                    this.atrFecha               = Convert.ToString(datos[2]);
                    this.atrEnvioRespuesta      = Convert.ToString(datos[3]);
                    this.atrFechaEnvioRespuesta = Convert.ToString(datos[4]);
                    this.atrEntregaMx           = Convert.ToString(datos[5]);
                    this.atrCumplimiento        = Convert.ToString(datos[6]);
                    this.atrJustificacion       = Convert.ToString(datos[7]);
                }
                datos.Dispose();
                cmd.Dispose();


                if ((varObjPresenta.ObtenerCliente != null) && (varObjPresenta.ObtenerSolicitud != null))
                {
                    return(varObjPresenta);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                return(null);
            }
        }