示例#1
0
        public ActionResult CargaIngresos(int id)
        {
            var municipalidad = GetCurrentIdMunicipality();

            ViewBag.logo       = municipalidad.Nombre;
            ViewBag.cementerio = municipalidad.Cementerio;
            Gasto_Ano   gasto = db.Gasto_Ano.Find(id);
            Ingreso_Ano ingr  = db.Ingreso_Ano.First(r => r.Ano == gasto.Ano && r.Semestre == gasto.Semestre && r.IdMunicipalidad == gasto.IdMunicipalidad);

            ViewBag.aviso = ingr.Cargado;
            switch (ingr.Semestre)
            {
            case 1:
                ViewBag.ano = ingr.Ano + "a marzo";
                break;

            case 2:
                ViewBag.ano = ingr.Ano + "a junio";
                break;

            case 3:
                ViewBag.ano = ingr.Ano + "a septiembre";
                break;

            default:
                ViewBag.ano = ingr.Ano;
                break;
            }
            return(View());
        }
        public void LoadNivel1(GastoTransparenteMunicipalEntities db, int idMunicipality, string tipoGasto, int year)
        {
            Gasto_Ano gasto_Ano    = db.Gasto_Ano.Where(r => r.IdMunicipalidad == idMunicipality && r.IdAno == year).First();
            var       gasto_Nivel1 = db.Gasto_Nivel1.Where(r => r.IdAno == gasto_Ano.IdAno && r.Tipo == tipoGasto).ToList();

            Mapper.Map(gasto_Nivel1, this.Gasto_Nivel1);
            LoadJsonNivel1(this.Gasto_Nivel1);
        }
示例#3
0
        public JsonResult CargadosPost(int aux)
        {
            Gasto_Ano   gasto = db.Gasto_Ano.Find(aux);
            List <bool> lista = new List <bool>
            {
                gasto.Cargado,
                db.Ingreso_Ano.Any(r => r.Ano == gasto.Ano && r.Semestre == gasto.Semestre && r.IdMunicipalidad == gasto.IdMunicipalidad && r.Cargado == true),
                db.Proveedor_Ano.Any(r => r.Ano == gasto.Ano && r.Semestre == gasto.Semestre && r.IdMunicipalidad == gasto.IdMunicipalidad && r.Cargado == true),
                db.Subsidio_Ano.Any(r => r.Ano == gasto.Ano && r.Semestre == gasto.Semestre && r.IdMunicipalidad == gasto.IdMunicipalidad && r.Cargado == true),
                db.Corporacion_Ano.Any(r => r.Ano == gasto.Ano && r.Semestre == gasto.Semestre && r.IdMunicipalidad == gasto.IdMunicipalidad && r.Cargado == true),
                db.Personal_Ano.Any(r => r.Ano == gasto.Ano && r.Semestre == gasto.Semestre && r.IdMunicipalidad == gasto.IdMunicipalidad && r.Cargado == true)
            };
            var auxiliar = lista;

            return(Json(auxiliar, JsonRequestBehavior.AllowGet));
        }
        public ActionResult CargaInformeGasto(HttpPostedFileBase file)
        {
            XSSFWorkbook xssfwb;
            int          idMunicipality = GetCurrentIdMunicipality().IdMunicipalidad;
            int          year           = 2017;
            int          month          = 0;
            Gasto_Ano    gastoAno       = new Gasto_Ano {
                IdMunicipalidad = idMunicipality, Ano = year, Semestre = month, UpdatedOn = DateTime.Now
            };

            using (Stream fileStream = file.InputStream)
            {
                xssfwb = new XSSFWorkbook(fileStream);
                LoadReport loadReport = new LoadReport();
                var        result     = loadReport.LoadInformeGasto(xssfwb);
                db.GastoInforme.AddRange(result);
                db.Gasto_Ano.Add(gastoAno);

                db.SaveChanges();
                db.SP_InformeGasto(loadReport.IdGroupInforme, gastoAno.IdAno);
            }
            return(View());
        }