public List <PRESUPUESTO_ANALITICOXUNIDAD> getPresupuestoAnaliticoXUnidad() { try { using (dbcontex = new SIENCHAFAEntities()) { return(dbcontex.PRESUPUESTO_ANALITICOXUNIDAD.OrderBy(x => x.UNIDADM).ThenBy(x => x.N_PROGRAMA).ThenBy(x => x.CLV_PARTID).ToList()); } } catch (Exception ex) { throw (ex); } }
public List <SPARTIDAS> getPresupuesto() { try { using (dbcontex = new SIENCHAFAEntities()) { return(dbcontex.SPARTIDAS.OrderBy(x => x.ID_PROYECTO).ThenBy(x => x.CLV_PARTID).ToList()); } } catch (Exception ex) { throw(ex); } }
public void UpdateAnalyticDatabase() { try { using (dbcontex = new SIENCHAFAEntities()) { dbcontex.UpdateAnalytic(); } } catch (Exception ex) { throw (ex); } }
public String Delete() { try { using (dbcontex = new SIENCHAFAEntities()) { //dbcontex.Database.ExecuteSqlCommand("DELETE FROM Atuevaluacion_demo"); dbcontex.Database.ExecuteSqlCommand("DELETE FROM DETALLEMOMENTOS"); return(""); } } catch (Exception ex) { throw(ex); } }
public List <CustomData> getPartid() { try { using (dbcontex = new SIENCHAFAEntities()) { return(dbcontex.Atuevaluacion_demo.Select(x => new CustomData { Key = x.CLV_PARTIDA, Description = x.PARTIDA }) .Distinct() .OrderBy(x => x.Description) .ToList()); } } catch (Exception ex) { throw(ex); } }
public List <CustomData> getCapitulo() { try { using (dbcontex = new SIENCHAFAEntities()) { return(dbcontex.Atuevaluacion_demo.Select(x => new CustomData { Key = x.CLV_CAPITULO, Description = x.CAPITULO }) .Distinct() .OrderBy(x => x.Key) .ToList()); } } catch (Exception ex) { throw (ex); } }
public List <CustomData> getProgPresupuest() { try { using (dbcontex = new SIENCHAFAEntities()) { List <CustomData> data = dbcontex.Atuevaluacion_demo.Select(x => new CustomData { Key = x.N_PROGRAMA, Description = x.PROG_PRESUP }) .Distinct() .OrderBy(x => x.Key) .ToList(); return(data); } } catch (Exception ex) { throw (ex); } }
public List <PRESUPUESTO_ANALITICOXUNIDAD> SearchPresupuestoAnaliticoXUnidad(List <int> Periodos, List <string> Unidades, List <string> Proyectos, List <int> Partidas, List <int> Fuentes, List <string> Recursos, List <string> Capitulos) { try { if (Periodos[0] == 0) { Periodos = this.getPeriodos(); } if (Unidades[0].Equals("0")) { Unidades = this.getUNIDADM().Select(x => x.Key).ToList(); } List <string> tempUnidades = new List <string>(); foreach (string row in Unidades) { if (row.Length == 1) { tempUnidades.Add("0" + row); } else { tempUnidades.Add(row); } } Unidades = tempUnidades; if (Proyectos[0] == "0") { Proyectos = this.getProgPresupuest().Select(x => x.Key).ToList(); } if (Partidas[0] == 0) { Partidas = this.getPartid().Select(x => int.Parse(x.Key)).ToList(); } if (Fuentes[0] == 0) { Fuentes = this.getFuente().Select(x => int.Parse(x.Key)).ToList(); } if (Recursos[0] == "0") { Recursos = this.getRecurso().Select(x => x.Key).ToList(); } if (Capitulos[0] == "0") { Capitulos = this.getCapitulo().Select(x => x.Key).ToList(); } List <PRESUPUESTO_ANALITICOXUNIDAD> LPresupuesto = new List <PRESUPUESTO_ANALITICOXUNIDAD>(); using (dbcontex = new SIENCHAFAEntities()) { LPresupuesto = dbcontex.PRESUPUESTO_ANALITICOXUNIDAD .Where(x => Proyectos.Contains(x.N_PROGRAMA) && Partidas.Contains(x.CLV_PARTID) && Unidades.Contains(x.CLV_UNIDADM) && Recursos.Contains(x.CLV_RECURSO) && Capitulos.Contains(x.CLV_CAPITU) ) .OrderBy(x => x.UNIDADM) .ThenBy(x => x.N_PROGRAMA) .ThenBy(x => x.CLV_PARTID) .ToList(); } return(LPresupuesto); } catch (Exception ex) { throw (ex); } }
public List <SPARTIDAS> SearchAnual(List <int> Periodos, List <string> Unidades, List <string> Proyectos, List <int> Partidas, List <int> Fuentes, List <int> Recursos, List <int> Capitulos) { try { if (Periodos[0] == 0) { Periodos = this.getPeriodos(); } if (Unidades[0].Equals("0")) { Unidades = this.getUNIDADM().Select(x => x.Key).ToList(); } if (Proyectos[0] == "0") { Proyectos = this.getProyect().Select(x => x.Key).ToList(); } if (Partidas[0] == 0) { Partidas = this.getPartid().Select(x => int.Parse(x.Key)).ToList(); } if (Fuentes[0] == 0) { Fuentes = this.getFuente().Select(x => int.Parse(x.Key)).ToList(); } if (Recursos[0] == 0) { Recursos = this.getRecurso().Select(x => int.Parse(x.Key)).ToList(); } if (Capitulos[0] == 0) { Capitulos = this.getCapitulo().Select(x => int.Parse(x.Key)).ToList(); } using (dbcontex = new SIENCHAFAEntities()) { PresupuestoModels presupuestoModels = new PresupuestoModels(); List <SPARTIDAS> Result = dbcontex.SPARTIDAS.Where(x => Proyectos.Contains(x.ID_PROYECTO) && Partidas.Contains(x.CLV_PARTID) && Unidades.Contains(x.CLV_UNIDADM) && Fuentes.Contains(x.CLV_FUENTE.Value) && Recursos.Contains(x.CLV_RECURSO.Value) && Capitulos.Contains(x.CLV_CAPITULO.Value) ) .OrderBy(x => x.ID_PROYECTO) .ThenBy(x => x.CLV_PARTID) .ToList(); return(Result); } } catch (Exception ex) { throw (ex); } }