103 lines
4.1 KiB
C#
103 lines
4.1 KiB
C#
using bdHerramientaCACOA.db;
|
|
using bdHerramientaCACOA.HerramientaUrban;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing.Imaging;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using static bdHerramientaCACOA.CASA;
|
|
|
|
namespace bdHerramientaCACOA.HerramientaURBAN
|
|
{
|
|
public partial class URBAN {
|
|
public class EnumeradosURBAN
|
|
{
|
|
public List<puntosinformacion> PuntosInformacion { get; set; } = new List<puntosinformacion>();
|
|
|
|
public List<FasesURBAN> FasesTrabajo { get; set; } = new List<FasesURBAN>();
|
|
public List<enumeracionesCASA> ListaInstrumentos { get; set; } = new List<enumeracionesCASA>();
|
|
public List<enumeracionesCASA> Periodos { get; set; } = new List<enumeracionesCASA>();
|
|
|
|
public List<enumeracionesCASA> TiposDeDocumentos { get; set; } = new List<enumeracionesCASA>();
|
|
|
|
public List<tipoproyectosURBAN> TiposProyecto { get; set; } = new List<tipoproyectosURBAN>();
|
|
|
|
public List<tipoproyecto_documentacionURBAN> TipoProy_Documentacion { get; set; } = new List<tipoproyecto_documentacionURBAN>();
|
|
|
|
public List<DocumentacionURBAN> documentacion { get; set; } = new List<DocumentacionURBAN>();
|
|
|
|
public List<tipoproyectosURBAN> ProyectosPorTipo(int idTipoDocumento)
|
|
{
|
|
return TiposProyecto.Where(x => x.idTipoDocumento == idTipoDocumento).ToList();
|
|
}
|
|
|
|
|
|
public List<enumeracionesCASA> ListaCostesVariables { get; set; } = new List<enumeracionesCASA>();
|
|
}
|
|
|
|
public List<DocumentacionURBAN> DocumentacionMinima(int idTipoProyecto)
|
|
{
|
|
|
|
List<tipoproyecto_documentacionURBAN> lista = Enumerados.TipoProy_Documentacion.Where(x => x.idtipoproyecto == idTipoProyecto && x.esMinima == true).ToList();
|
|
List<DocumentacionURBAN> ldm = new List<DocumentacionURBAN>();
|
|
|
|
foreach (tipoproyecto_documentacionURBAN tpd in lista)
|
|
{
|
|
DocumentacionURBAN d = Enumerados.documentacion.First(x => x.iddocumentacion == tpd.iddocumentacion);
|
|
ldm.Add(d);
|
|
}
|
|
|
|
return ldm;
|
|
}
|
|
public List<DocumentacionURBAN> DocumentacionOpcional(int idTipoProyecto)
|
|
{
|
|
|
|
List<tipoproyecto_documentacionURBAN> lista = Enumerados.TipoProy_Documentacion.Where(x => x.idtipoproyecto == idTipoProyecto && x.esOpcional == true).ToList();
|
|
List<DocumentacionURBAN> ldm = new List<DocumentacionURBAN>();
|
|
|
|
foreach (tipoproyecto_documentacionURBAN tpd in lista)
|
|
{
|
|
DocumentacionURBAN d = Enumerados.documentacion.First(x => x.iddocumentacion == tpd.iddocumentacion);
|
|
ldm.Add(d);
|
|
}
|
|
|
|
return ldm;
|
|
}
|
|
public List<DocumentacionURBAN> DatosNecesarios(int idTipoProyecto)
|
|
{
|
|
|
|
List<tipoproyecto_documentacionURBAN> lista = Enumerados.TipoProy_Documentacion.Where(x => x.idtipoproyecto == idTipoProyecto && x.esNecesario == true).ToList();
|
|
List<DocumentacionURBAN> ldm = new List<DocumentacionURBAN>();
|
|
|
|
foreach (tipoproyecto_documentacionURBAN tpd in lista)
|
|
{
|
|
DocumentacionURBAN d = Enumerados.documentacion.First(x => x.iddocumentacion == tpd.iddocumentacion);
|
|
ldm.Add(d);
|
|
}
|
|
|
|
return ldm;
|
|
}
|
|
private List<DocumentacionURBAN> documentacionAUrban(List<documentacion> lista)
|
|
{
|
|
var listaDoc = new List<DocumentacionURBAN>();
|
|
foreach (var documentacion in lista)
|
|
{
|
|
var d = new DocumentacionURBAN();
|
|
d.iddocumentacion = documentacion.iddocumentacion;
|
|
d.Descripcion = documentacion.Descripcion.ToString();
|
|
if (documentacion.CoeficienteHoras.HasValue)
|
|
{
|
|
d.CoefHoras = (double)documentacion.CoeficienteHoras;
|
|
}
|
|
d.esCheckbox = documentacion.Checkeable;
|
|
listaDoc.Add(d);
|
|
}
|
|
|
|
return listaDoc;
|
|
}
|
|
}
|
|
|
|
}
|