Пример #1
0
        public void Elimina(TablaBE pItem)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    TablaDL         Tabla         = new TablaDL();
                    TablaElementoDL TablaElemento = new TablaElementoDL();

                    List <TablaElementoBE> pListaTablaElemento = null;
                    pListaTablaElemento = new TablaElementoBL().ListaTodosActivo(pItem.IdEmpresa, pItem.IdTabla);

                    //Eliminar los elementos de la tabla
                    foreach (var item in pListaTablaElemento)
                    {
                        TablaElemento.Elimina(item);
                    }

                    Tabla.Elimina(pItem);

                    ts.Complete();
                }
            }
            catch (Exception ex)
            { throw ex; }
        }
Пример #2
0
 public void Elimina(TablaElementoBE pItem)
 {
     try
     {
         TablaElementoDL TablaElemento = new TablaElementoDL();
         TablaElemento.Elimina(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
Пример #3
0
 public void Actualiza(TablaElementoBE pItem)
 {
     try
     {
         TablaElementoDL TablaElemento = new TablaElementoDL();
         TablaElemento.Actualiza(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
Пример #4
0
 public Int32 Inserta(TablaElementoBE pItem)
 {
     try
     {
         TablaElementoDL TablaElemento = new TablaElementoDL();
         return(TablaElemento.Inserta(pItem));
     }
     catch (Exception ex)
     { throw ex; }
 }
Пример #5
0
 public List <TablaElementoBE> ListaTodosActivo(int IdRegional, int IdTabla)
 {
     try
     {
         TablaElementoDL TablaElemento = new TablaElementoDL();
         return(TablaElemento.ListaTodosActivo(IdRegional, IdTabla));
     }
     catch (Exception ex)
     { throw ex; }
 }
Пример #6
0
 public TablaElementoBE SeleccionaDescripcion(int IdTabla, string DescTablaElemento)
 {
     try
     {
         TablaElementoDL TablaElemento = new TablaElementoDL();
         TablaElementoBE objEmp        = TablaElemento.SeleccionaDescripcion(IdTabla, DescTablaElemento);
         return(objEmp);
     }
     catch (Exception ex)
     { throw ex; }
 }
Пример #7
0
        public List <ReporteCapacitacionBE> ListadoHorasMensualClasificacion(int Periodo, int IdEmpresaResponsable)
        {
            try
            {
                List <TablaElementoBE>       lstClasificacionCapacitacion;
                List <ReporteCapacitacionBE> lstHorasMensualClasificacion;

                lstClasificacionCapacitacion = new TablaElementoDL().ListaTodosActivo(0, Parametros.intTblClasificacionCapacitacion);
                lstHorasMensualClasificacion = new ReporteCapacitacionDL().ListadoHorasMensualClasificacion(Periodo, IdEmpresaResponsable);

                List <string> lstMes = new List <string>();
                foreach (var item in lstHorasMensualClasificacion)
                {
                    var Buscar = lstMes.Where(x => x.Contains(item.Mes)).ToList();
                    if (Buscar.Count == 0)
                    {
                        lstMes.Add(item.Mes);
                    }
                }

                foreach (string strMes in lstMes)
                {
                    foreach (var ItemClasificacion in lstClasificacionCapacitacion)
                    {
                        var Buscar = lstHorasMensualClasificacion.Where(oB => oB.Mes == strMes && oB.DescClasificacionCapacitacion == ItemClasificacion.DescTablaElemento).ToList();
                        if (Buscar.Count == 0)
                        {
                            ReporteCapacitacionBE objE_ReporteCapacitacion = new ReporteCapacitacionBE();
                            objE_ReporteCapacitacion.Periodo = Periodo.ToString();
                            objE_ReporteCapacitacion.Mes     = strMes;
                            objE_ReporteCapacitacion.DescClasificacionCapacitacion = ItemClasificacion.DescTablaElemento;
                            objE_ReporteCapacitacion.Horas = 0;
                            lstHorasMensualClasificacion.Add(objE_ReporteCapacitacion);
                        }
                    }
                }

                return(lstHorasMensualClasificacion);
            }
            catch (Exception ex)
            { throw ex; }
        }