Ejemplo n.º 1
0
        public DocenteDecreto(string cedula):base(cedula) {
            DecretoDocente decret;

            foreach (tdocente docente in this){

                docente.Calculando_MontoDecretoCalculado();
                decret = new DecretoDocente(docente);

                if (decret.Docentes != null){
                    if(decret.Docentes.Count > 0)
                    {

                        docente.Decretos = decret.Docentes[0].Decretos;
                        if (docente.DecretoActual.Decreto.Id != 0){
                            docente.EstadoLaboral = docente.DecretoActual.Estado;
                        }
                        else{
                            docente.EstadoLaboral = Empresa.RHH.EstadoLaboral.GetInstance()[1];
                        }

                    }
                    else{
                        docente.Decretos = new ObservableCollection<TDecretoDocente>();
                        docente.EstadoLaboral = Empresa.RHH.EstadoLaboral.GetInstance()[1];
                    }

                }
                else
                {
                    docente.Decretos = new ObservableCollection<TDecretoDocente>();
                    docente.EstadoLaboral = Empresa.RHH.EstadoLaboral.GetInstance()[1];
                }
                docente.Comentarios = new Comun.Comentario(docente.Cedula, docente.Tipo.Id).Lista;
            }//en for
        }
Ejemplo n.º 2
0
        public DocenteDecreto(Empresa.Docente.TDecreto item){
           Empresa.Docente.DecretoDocente Decredocente = new DecretoDocente(item);


           foreach (tdocente itemdecre in Decredocente.Docentes){
               //itemdecre.Calculando_MontoDecretoCalculado();
               this.Add(itemdecre);
           }

       }
Ejemplo n.º 3
0
       public Docentes(List<string> arg):base(arg){
               DecretoDocente decretos = new DecretoDocente(this);
               foreach (Empresa.Docente.tdocente itemdecre in decretos.Docentes)
               {
                   foreach (Empresa.Docente.tdocente itemdocen in this)
                   {
                       if (itemdecre.Cedula.Equals(itemdocen.Cedula))
                       {
                           itemdocen.Decretos = itemdecre.Decretos;
                           //Asignado, Estado Laboral.
                           if (itemdocen.Decretos == null){
                               //Estado laboral si no se encuentra, pension o jubilación
                               itemdocen.EstadoLaboral = Empresa.RHH.EstadoLaboral.GetInstance()[1];
                           }
                           else{
                               
                               if(itemdocen.Decretos.Count == 0){
                                   itemdocen.EstadoLaboral = itemdocen.DecretoActual.Estado;
                               }
                               else{
                                   itemdocen.EstadoLaboral = Empresa.RHH.EstadoLaboral.GetInstance()[1];
                               }
                           }

                       }
                   }
               }


               Familiares fami = new Familiares(this);
               foreach (tdocente item in this){
                   foreach (TFamiliares itemf in fami.Diccionario.Values){
                       if (itemf.Docente.Cedula.Equals(item.Cedula)){
                           item.Familiares.Add(itemf);
                           item.Familiares.ReglaCalculo();
                           item.Calculo_FechasPension_Familiar();
                           item.Calculo_Edad_Familiar();
                       }
                   }
               }
           }
Ejemplo n.º 4
0
       public Docentes()
       {

           SSData.Servicios consulta = new SSData.Servicios(SSData.Servicios.Proveedor.SQL);
           tdocente docente;
           string temp = string.Empty;

           //Empresa.Comun.Direcciones dire = new Empresa.Comun.Direcciones(false);
           System.Data.DataSet ds = consulta.Execute.Dataset("[dbo].[ViewCed_ViewDecretosPadron_ActivosFallecidos]", System.Data.CommandType.StoredProcedure);

           foreach(System.Data.DataRow fila in ds.Tables[0].Rows){
               docente = new tdocente();

               docente.Nombres = fila["pdr_nombres"].ToString();
               docente.Apellidos = fila["pdr_apellido1"].ToString() + fila["pdr_apellido2"].ToString();
               docente.NombreCompleto = fila["pdr_NombreCompleto"].ToString();
               docente.Cedula = fila["pdr_cedula"].ToString();
               docente.EsMasculino = Convert.ToBoolean(fila["pdr_sexo"]);
               docente.EsFallecido = Convert.ToBoolean(fila["pdr_esfallecido"]);

               docente.FechaFallecido = fila["pdr_ffallecido"] == DBNull.Value ? DateTime.MinValue : (DateTime)fila["pdr_ffallecido"];
               docente.FechaIngresoEducacion = fila["pdr_fingreso"] == DBNull.Value ? DateTime.MinValue : (DateTime)fila["pdr_fingreso"];
               docente.FechaNacimiento = (DateTime)fila["pdr_FechaNac"];
               
               DecretoDocente decret = new DecretoDocente(docente);

               if(decret.Docentes != null){
                   
                   if(decret.Docentes.Count > 0){
                       docente.Decretos = decret.Docentes[0].Decretos;
                       //docente.EstadoLaboral = docente.DecretoActual.Estado;
                   }
                   else {
                       docente.Decretos = new ObservableCollection<TDecretoDocente>();
                       docente.EstadoLaboral = Empresa.RHH.EstadoLaboral.GetInstance()[1];
                   }

               }
               else{
                   docente.Decretos = new ObservableCollection<TDecretoDocente>();
                   docente.EstadoLaboral = Empresa.RHH.EstadoLaboral.GetInstance()[1];
               }

               if(docente.EsFallecido){
                   docente.EsInabima = fila["docf_esinabima"] == DBNull.Value ? true : Convert.ToBoolean(fila["docf_esinabima"]);
                   if (docente.EsInabima){
                       //Por decreto.
                       docente.DecretoBeneficiarios = Empresa.Docente.Decreto.GetInstnace().GetItem(Convert.ToInt32(fila["fech_id"]));
                       docente.FechaPrimerPago = docente.DecretoBeneficiarios.FechaEP;
                   }
                   else{
                       //Por la aseguradora.
                       docente.Aseguradora = new Comun.Suplidor(Convert.ToInt32(fila["sup_id"]))[0];
                      // docente.FechaPrimerPago = fila["pdr_fprimerpagoaseguradora"] == DBNull.Value ? DateTime.MinValue : (DateTime)fila["pdr_fprimerpagoaseguradora"];
                   }
               }

               this.Add(docente);
           }

           Familiares fami = new Familiares(this);

           foreach (tdocente item in this){
               foreach (TFamiliares itemf in fami.Diccionario.Values){
                   if (itemf.Docente.Cedula.Equals(item.Cedula)){
                       item.Familiares.Add(itemf);
                       item.Familiares.ReglaCalculo();
                       item.Calculo_FechasPension_Familiar();
                       item.Calculo_Edad_Familiar();
                   }
               }
           }
       }