private void Button_Click(object sender, RoutedEventArgs e)
 {
     State  = AppMAnager.STATE_INSERT;
     entity = new genero();
     clearForm();
     showForm();
 }
 private void BeforeSave()
 {
     refreshGrid();
     clearForm();
     hideForm();
     entity = null;
 }
 public datos(string _nombre, string _apellido, DateTime _fechaNac, estadoCivil _estadoCivil, genero _genero, DateTime _fechaIngreso, float _sueldo, cargo _cargo)
 {
     nombre          = _nombre;
     apellido        = _apellido;
     fechaNacimiento = _fechaNac;
     estado          = _estadoCivil;
     gen             = _genero;
     fechaIngreso    = _fechaIngreso;
     sueldo          = _sueldo;
     carg            = _cargo;
 }
        public PGeneros()
        {
            InitializeComponent();

            repo = new GenerosRepository();

            refreshGrid();
            lNombre.Tag = "Nombre";
            hideForm();
            State  = AppMAnager.STATE_NULL;
            entity = null;
        }
        private void BtnUpdate_Click(object sender, RoutedEventArgs e)
        {
            int id = (int)((Button)sender).CommandParameter;

            if (id > 0)
            {
                entity = repo.FindById(id);
                if (entity != null)
                {
                    tbNombre.Text = entity.nombre;
                    State         = AppMAnager.STATE_UPDATE;
                    showForm();
                }
            }
        }
Ejemplo n.º 6
0
            public int jubilacion(genero _genere, DateTime FechaNac)
            {
                int añosfaltantes;
                int edad = tiempo(FechaNac);

                if (_genere == 0)
                {
                    añosfaltantes = 60 - edad;
                }
                else
                {
                    añosfaltantes = 65 - edad;
                }
                return(añosfaltantes);
            }
Ejemplo n.º 7
0
 public ActionResult Insert(GenderTableViewModel model)
 {
     try
     {
         using (var data = new BD_NETLINKEntities1())
         {
             genero objGender = new genero();
             objGender.nombre = model.genero;
             data.genero.Add(objGender);
             data.SaveChanges();
         }
         Session["insert"] = "success";
         return(View());
     }
     catch {
         Session["insert"] = "failed";
         return(View());
     }
 }
Ejemplo n.º 8
0
 public int Grabar(genero item)
 {
     return item.GrabarObjetoT(x => x.id);
 }
Ejemplo n.º 9
0
 public int Borrar(genero item)
 {
     return item.BorrarObjetoT();
 }
Ejemplo n.º 10
0
 protected void btnSincronizar_Click(object sender, EventArgs e)
 {
     try
     {
         List <Int64> Personas = new List <Int64>();
         DocumentacionDemoLocalEntities contextoL = new DocumentacionDemoLocalEntities();
         var resultado = from p in contextoL.vw_consultaCasoDocumentacion.AsNoTracking()
                         where p.regModificado == true
                         select p;
         foreach (var elemento in resultado)
         {
             DocumentacionDemoEntities contextoR = new DocumentacionDemoEntities();
             procesoDocumentacion      registro  = contextoR.procesoDocumentacion.FirstOrDefault(X => X.uniqueIdentifier == elemento.uniqueIdentifier);
             //Informacion del caso
             tipoDocumento TipoDocumento = contextoR.tipoDocumento.FirstOrDefault(X => X.descripcionDocumento == elemento.tipoDocumentoDestinatario);
             genero        Genero        = contextoR.genero.FirstOrDefault(X => X.descripcionGenero == elemento.GeneroDestinatario);
             parentesco    Parentesco    = contextoR.parentesco.FirstOrDefault(X => X.nombreParentesco == elemento.nombreParentesco);
             registro.parentesco          = Parentesco.idPerentesco;
             registro.porcentaje          = elemento.porcentaje;
             registro.usuarioModificacion = elemento.usuarioModificacion;
             registro.fechaModificacion   = elemento.fechaModificacion;
             registro.regModificado       = true;
             //Informacion de la persona
             registro.persona1.primerNombre    = elemento.primerNombreDestinatario;
             registro.persona1.segundoNombre   = elemento.segundoNombreDestinatario;
             registro.persona1.primerApellido  = elemento.primerApellidoDestinatario;
             registro.persona1.segundoApellido = elemento.segundoApellidoDestinatario;
             registro.persona1.tipoDocumento   = TipoDocumento.idTipoDocumento;
             registro.persona1.noDocumento     = elemento.noDocumentoDestinatario;
             registro.persona1.fechaNacimiento = elemento.fechaNacimientoDestinatario;
             registro.persona1.genero          = Genero.idGenero;
             contextoR.SaveChanges();
             var soportesXradicado = from p in contextoL.soporteXRadicado.AsNoTracking()
                                     where p.rad == elemento.rad && p.idPersona == elemento.idPersonaDestinatario
                                     select p;
             if (soportesXradicado != null)
             {
                 foreach (var soporte in soportesXradicado)
                 {
                     soporteXRadicado NvoSoporteRadicado = new soporteXRadicado();
                     NvoSoporteRadicado.idSoporte              = soporte.idSoporte;
                     NvoSoporteRadicado.idPersona              = soporte.idPersona;
                     NvoSoporteRadicado.rad                    = soporte.rad;
                     NvoSoporteRadicado.estadoSoporte          = soporte.estadoSoporte;
                     NvoSoporteRadicado.rutaSoporte            = soporte.rutaSoporte;
                     NvoSoporteRadicado.usuarioCreacionSoporte = soporte.usuarioCreacionSoporte;
                     NvoSoporteRadicado.fechaCreacionSoporte   = soporte.fechaCreacionSoporte;
                     contextoR.soporteXRadicado.Add(NvoSoporteRadicado);
                     contextoR.SaveChanges();
                 }
             }
         }
         foreach (var item in resultado)
         {
             procesoDocumentacion objeto = contextoL.procesoDocumentacion.FirstOrDefault(X => X.uniqueIdentifier == item.uniqueIdentifier);
             eliminaregistros(objeto);
             Personas.Add(objeto.idPersonaDestinatario);
         }
         var personasEliminar = from P in contextoL.persona
                                where Personas.Contains(P.idPersona)
                                select P;
         foreach (var item in personasEliminar)
         {
             persona Persona = contextoL.persona.FirstOrDefault(X => X.idPersona == item.idPersona);
             Script = "delete from persona where idPersona = '" + Persona.idPersona + "'";
             c.ConsultaAUX(Script);
         }
         panelMensajes.CssClass = "alert alert-success";
         Label textoError = new Label();
         textoError.Text = "Se ha realizado la migración del caso al sistema remoto y se ha vaciado la informacion de la base local";
         panelMensajes.Controls.Add(textoError);
         panelMensajes.Visible = true;
         dgvConsultaCasosDocumentacionLocal.DataBind();
     }
     catch (SystemException ex)
     {
         panelMensajes.CssClass = "alert alert-danger";
         Label textoError = new Label();
         textoError.Text = "Error: se ha presentado un error durante la sincronizacion con el sistema Remoto, detalle del error: " + ex.ToString();
         panelMensajes.Controls.Add(textoError);
         panelMensajes.Visible = true;
     }
 }