Inheritance: System.Data.Objects.DataClasses.EntityObject
Exemplo n.º 1
0
 /// <summary>
 /// Create a new paciente object.
 /// </summary>
 /// <param name="cedula">Initial value of the cedula property.</param>
 /// <param name="centro_actual">Initial value of the centro_actual property.</param>
 /// <param name="expediente">Initial value of the expediente property.</param>
 /// <param name="fecha_ingreso">Initial value of the fecha_ingreso property.</param>
 /// <param name="fecha_nac">Initial value of the fecha_nac property.</param>
 /// <param name="nombres">Initial value of the nombres property.</param>
 /// <param name="prefijo">Initial value of the prefijo property.</param>
 /// <param name="primer_apellido">Initial value of the primer_apellido property.</param>
 /// <param name="segundo_apellido">Initial value of the segundo_apellido property.</param>
 /// <param name="sexo">Initial value of the sexo property.</param>
 public static paciente Createpaciente(global::System.String cedula, global::System.Int32 centro_actual, global::System.Int64 expediente, global::System.DateTime fecha_ingreso, global::System.DateTime fecha_nac, global::System.String nombres, global::System.Int32 prefijo, global::System.String primer_apellido, global::System.String segundo_apellido, global::System.Boolean sexo)
 {
     paciente paciente = new paciente();
     paciente.cedula = cedula;
     paciente.centro_actual = centro_actual;
     paciente.expediente = expediente;
     paciente.fecha_ingreso = fecha_ingreso;
     paciente.fecha_nac = fecha_nac;
     paciente.nombres = nombres;
     paciente.prefijo = prefijo;
     paciente.primer_apellido = primer_apellido;
     paciente.segundo_apellido = segundo_apellido;
     paciente.sexo = sexo;
     return paciente;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the pacientes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTopacientes(paciente paciente)
 {
     base.AddObject("pacientes", paciente);
 }
        public bool guardarPaciente()
        {
            if (isTheInfoComplete())
            {
                try
                {
                    DataAccess.paciente pac = new DataAccess.paciente();
                    pac.cedula = Cedula;
                    pac.direccion = Direccion;
                    pac.estado_civil = Estado;
                    pac.fecha_ingreso = FechaIngreso;
                    pac.fecha_nac = FechaNac;

                    pac.lugar_nac = LugarNac;
                    pac.nombres = Nombres;
                    pac.primer_apellido = PrimerApellido;
                    pac.segundo_apellido = SegundoApellido;
                    pac.sexo = Sexo;

                    pac.centro_actual = CentroActual;
                    pac.prefijo = CentroActual;
                    pac.expediente = Expediente;

                    pac.tipo_doc_alterno = "N/A";
                    pac.numero_doc_alt = "N/A";
                    pac.foto = Foto;

                    /*Modificado por Eliazar*/
                    pac.telefono_fijo = telefono;
                    pac.telefono_movil = movil;
                    pac.escolaridad = escolaridad;
                    pac.profesion = profesion;
                    pac.lugar_trabajo = lugarTrabajo;
                    pac.nombre_madre = nombreMadre;
                    pac.nombre_padre = nombrePadre;
                    pac.estructura_familiar = estructuraFamiliar;
                    pac.condicion_hogar = condicionHogar;
                    pac.recibio_rehabilitacion_antes = expectativa;
                    pac.ingreso_familiar = ingresos;
                    pac.expectativa = rehabilitacion;
                    pac.candidato_transporte = candidatoTransporte;
                    pac.se_entero_teleton = acercaDe;
                    pac.documentacion = docsAlternos;
                    pac.observaciones = observaciones;

                    entities.pacientes.AddObject(pac); //se guarda en la memoria
                    entities.SaveChanges(); //se guarda en la DB
                    return true;

                }
                catch (Exception ex)
                {
                    throw new Exception(ex.ToString() + "Pacientes.cs / guardarPaciente()");
                }
            }
            return false;
        }