public void CargarDatos() { //datos var db = new Entities(); var config = ConfiguracionModel.GetConfig(); var cat = Categoria.Value.ToString(); var data = from i in db.IngresoFinanzas where i.fecha.Month == config.MesActual && i.fecha.Year == config.AnoActual group i by i.Cuentas.TipoMoneda into cuentaGroup select new { moneda = cuentaGroup.Key, importe = cuentaGroup.Sum(c => c.importe) }; DataSource = data.ToList(); this.monedaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "moneda") }); this.importeCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "importe") }); }
// // GET: /SalidaAlmacen/ public ActionResult Index() { var config = ConfiguracionModel.GetConfig(); var salidaalmacen = db.SalidaAlmacen.Include(s => s.Almacen).Include(s => s.TipoAyuda).Include(s => s.Usuario).Where(i => i.fecha.Month == config.MesActual && i.fecha.Year == config.AnoActual); return(View(salidaalmacen.ToList())); }
public ActionResult Cerrar() { var config = ConfiguracionModel.GetConfig(); config.CambiarMes(); return(RedirectToAction("Index", "Home")); }
// // GET: /Config/ public ActionResult Index() { try { var model = ConfiguracionModel.GetConfig(); //if (db.Cuentas.Any(c => c.TipoMoneda.siglas.ToUpper() == "CUC") || db.Cuentas.Any(c => c.TipoMoneda.siglas.ToUpper() == "MN")) //{ // return RedirectToAction("Create", "Cuenta"); //} var meses = new List <dynamic> { new { mes = "Enero", id = 1 }, new { mes = "Febrero", id = 2 } , new { mes = "Marzo", id = 3 }, new { mes = "Abril", id = 4 } , new { mes = "Mayo", id = 5 }, new { mes = "Junio", id = 6 } , new { mes = "Julio", id = 7 }, new { mes = "Agosto", id = 8 } , new { mes = "Septiembre", id = 9 }, new { mes = "Octubre", id = 10 } , new { mes = "Noviembre", id = 11 }, new { mes = "Diciembre", id = 12 } }; ViewBag.MesActual = new SelectList(meses, "id", "mes", model.MesActual); return(View(model)); } catch (Exception) { throw new Exception("No se encontro el fichero de configuracion"); } }
// // GET: /CompraProducto/ public ActionResult Index() { var config = ConfiguracionModel.GetConfig(); var compraproducto = db.CompraProducto.Include(c => c.Producto).Include(c => c.Usuario).Include(c => c.Cuentas).Where(i => i.fecha.Month == config.MesActual && i.fecha.Year == config.AnoActual); return(View(compraproducto.ToList())); }
// // GET: /IngresoFinanza/ public ActionResult Index() { var config = ConfiguracionModel.GetConfig(); var ingresofinanzas = db.IngresoFinanzas.Where(i => i.Cuentas.activo).Include(i => i.ConceptoIngreso).Include(i => i.Cuentas).Include(i => i.Usuario).Include(i => i.Persona).Where(i => i.fecha.Month == config.MesActual && i.fecha.Year == config.AnoActual); return(View(ingresofinanzas.ToList())); }
// // GET: /GastoFinanza/ public ActionResult Index() { var config = ConfiguracionModel.GetConfig(); var gastofinanzas = db.GastoFinanzas.Include(g => g.ConceptoGasto).Include(g => g.Cuentas).Include(g => g.Usuario).Include(g => g.SubconceptoGasto).Where(g => g.fecha.Month == config.MesActual && g.fecha.Year == config.AnoActual); return(View(gastofinanzas.ToList())); }
public Cumpleanos() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); this.mesLabel.Text = config.MesActual.ToString(); this.yearLabel.Text = config.AnoActual.ToString(); this.fechaLabel.Text = DateTime.Now.Date.ToShortDateString(); //fin Info de los parametros var db = new Entities(); var fechaInicio = Semana(); var fechaFin = fechaInicio.Add(new TimeSpan(6, 0, 0, 0, 0)); var data = from i in db.Persona where i.activo && i.fechaNacimiento.Month >= fechaInicio.Month && i.fechaNacimiento.Month <= fechaFin.Month && i.fechaNacimiento.Day >= fechaInicio.Day && i.fechaNacimiento.Day <= fechaFin.Day select new { persona = i, fecha = i.fechaNacimiento, edad = DateTime.Today.Year - i.fechaNacimiento.Year, categoria = i.CategoriaPersona, miembro = i.miembro?"SI":"NO" }; var result = new List <dynamic>(); foreach (var d in data) { result.Add(new { d.persona, fecha = Dia(d.fecha.AddYears(d.edad).DayOfWeek) + " " + d.fecha.Day, d.edad, d.categoria, d.miembro }); } DataSource = result; this.nombreCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "persona") }); this.fechaNacCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fecha") }); this.edadCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "edad") }); this.categoriaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "categoria") }); this.miembroCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "miembro") }); fechaInicioLabel.Text = fechaInicio.ToShortDateString(); fechaFinLabel.Text = fechaFin.ToShortDateString(); }
public void CargarDatos() { //datos var db = new Entities(); var config = ConfiguracionModel.GetConfig(); var fechaIni = (DateTime)FechaInicio.Value; var fechaFin = (DateTime)FechaFin.Value; var result = new List <dynamic>(); var lista = ListaConceptos.Value.ToString().Split(','); foreach (var s in lista) { if (s != "") { var id = int.Parse(s); var data = from i in db.IngresoFinanzas where i.fecha >= fechaIni && i.fecha <= fechaFin && i.ConceptoIngresoid == id orderby i.fecha, i.ConceptoIngresoid select new { i.fecha, i.importe, cuenta = i.Cuentas, i.ConceptoIngreso.concepto, descripcion = i.descripcion == null ? " Tramitado por: " + i.Usuario.nombreUsuario : i.descripcion + " Tramitado por: " + i.Usuario.nombreUsuario, }; result.AddRange(data); } } DataSource = result; this.fechaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fecha", "{0:dd/M/yyyy}") }); this.importeCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "importe") }); this.cuentaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "cuenta") }); this.conceptoCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "concepto") }); this.descripcionCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "descripcion") }); xrSubreport1.ReportSource = new SubreportTotalIngresosFecha(); }
public CumpleannosXFecha() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); this.mesLabel.Text = config.MesActual.ToString(); this.yearLabel.Text = config.AnoActual.ToString(); this.fechaLabel.Text = DateTime.Now.Date.ToShortDateString(); //fin Info de los parametros }
public JsonResult CheckFecha(string fecha) { var result = false; var l = fecha.Split('/'); var f = new DateTime(int.Parse(l[2]), int.Parse(l[1]), int.Parse(l[0])); var config = ConfiguracionModel.GetConfig(); if (f.Month == config.MesActual && f.Year == config.AnoActual) { result = true; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public Gastos() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); this.mesLabel.Text = config.MesActual.ToString(); this.yearLabel.Text = config.AnoActual.ToString(); this.fechaLabel.Text = DateTime.Now.Date.ToShortDateString(); //fin Info de los parametros //datos var db = new Entities(); var data = from i in db.GastoFinanzas where i.fecha.Month == config.MesActual && i.fecha.Year == config.AnoActual orderby i.fecha, i.ConceptoGastoid select new { i.fecha, i.importe, cuenta = i.Cuentas, concepto = i.SubconceptoGasto == null ? i.ConceptoGasto.concepto : i.ConceptoGasto.concepto + " - " + i.SubconceptoGasto.subconcepto, descripcion = i.descripcion == null?" Tramitado por: " + i.Usuario.nombreUsuario: i.descripcion + " Tramitado por: " + i.Usuario.nombreUsuario, }; DataSource = data.ToList(); this.fechaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fecha", "{0:dd/M/yyyy}") }); this.importeCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "importe") }); this.cuentaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "cuenta") }); this.conceptoCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "concepto") }); this.descripcionCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "descripcion") }); xrSubreport1.ReportSource = new SubreportGastoTotal(); }
public Miembros() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); this.mesLabel.Text = config.MesActual.ToString(); this.yearLabel.Text = config.AnoActual.ToString(); this.fechaLabel.Text = DateTime.Now.Date.ToShortDateString(); //fin Info de los parametros //datos var db = new Entities(); var data = from i in db.Persona where i.activo && i.miembro orderby i.CategoriaPersonaid select new { nombre = i, fechaNac = i.fechaNacimiento, fechaConv = i.fechaConversion, fechaBaut = i.fechaBautismo, i.CategoriaPersona.categoria, }; DataSource = data.ToList(); this.nombreCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "nombre") }); this.fechaNacimCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fechaNac", "{0:dd/M/yyyy}") }); this.fechaConvCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fechaConv", "{0:dd/M/yyyy}") }); this.fechaBautCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fechaBaut", "{0:dd/M/yyyy}") }); this.categoriaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "categoria") }); }
public PersonasAgrupadasXCategoria() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); this.mesLabel.Text = config.MesActual.ToString(); this.yearLabel.Text = config.AnoActual.ToString(); this.fechaLabel.Text = DateTime.Now.Date.ToShortDateString(); //fin Info de los parametros xrSubreport1.ReportSource = new SubreportPersonas(); }
public Compras() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); this.mesLabel.Text = config.MesActual.ToString(); this.yearLabel.Text = config.AnoActual.ToString(); this.fechaLabel.Text = DateTime.Now.Date.ToShortDateString(); //fin Info de los parametros var db = new Entities(); var data = from i in db.CompraProducto where i.fecha.Month == config.MesActual && i.fecha.Year == config.AnoActual select new { i.fecha, i.Producto, i.cantidad, importe = i.importe, i.Cuentas }; var result = new List <dynamic>(); foreach (var d in data) { result.Add(new { fecha = d.fecha.ToShortDateString(), d.Producto, cantidad = d.cantidad + " " + d.Producto.UnidadMedida.siglas, d.importe, d.Cuentas }); } DataSource = result; this.fechaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fecha") }); this.productoCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "Producto") }); this.cantidadCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "cantidad") }); this.importeCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "importe") }); this.cuentaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "Cuentas") }); }
public void CargarDatos() { //datos var db = new Entities(); var config = ConfiguracionModel.GetConfig(); var fechaIni = (DateTime)FechaInicio.Value; var fechaFin = (DateTime)FechaFin.Value; var result = new List <dynamic>(); var lista = Concepto.Value.ToString().Split(','); foreach (var s in lista) { if (s != "") { var id = int.Parse(s); var data = from i in db.IngresoFinanzas where i.fecha >= fechaIni && i.fecha <= fechaFin && i.ConceptoIngresoid == id orderby i.fecha, i.ConceptoIngresoid select new { i.Cuentas.TipoMoneda, i.importe }; result.AddRange(data); } } var resultFinal = from r in result group r by r.TipoMoneda into resulGroup select new { moneda = resulGroup.Key, importe = resulGroup.Sum(i => (decimal)i.importe) }; DataSource = resultFinal.ToList(); this.monedaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "moneda") }); this.importeCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "importe") }); }
public Salidas() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); this.mesLabel.Text = config.MesActual.ToString(); this.yearLabel.Text = config.AnoActual.ToString(); this.fechaLabel.Text = DateTime.Now.Date.ToShortDateString(); //fin Info de los parametros //datos var db = new Entities(); var data = from i in db.SalidaAlmacen where i.fecha.Month == config.MesActual && i.fecha.Year == config.AnoActual select new { i.fecha, producto = i.Almacen, i.cantidad, tipoAyuda = i.TipoAyuda }; DataSource = data.ToList(); this.fechaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fecha", "{0:dd/M/yyyy}") }); this.productoCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "producto") }); this.cantidadCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "cantidad") }); this.tipoAyudaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "tipoAyuda") }); }
public Diezmadores() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); this.mesLabel.Text = config.MesActual.ToString(); this.yearLabel.Text = config.AnoActual.ToString(); this.fechaLabel.Text = DateTime.Now.Date.ToShortDateString(); //fin Info de los parametros //datos var db = new Entities(); var data = from i in db.IngresoFinanzas where i.ConceptoIngreso.concepto == "Diezmo" && i.fecha.Month == config.MesActual && i.fecha.Year == config.AnoActual group i by i.Persona into personaGroup select new { persona = personaGroup.Key, importeMN = personaGroup.Any(p => p.Cuentas.TipoMoneda.siglas == "MN") ? personaGroup.Where(p => p.Cuentas.TipoMoneda.siglas == "MN").Sum(j => j.importe) : 0m, importeCUC = personaGroup.Any(p => p.Cuentas.TipoMoneda.siglas == "CUC") ? personaGroup.Where(p => p.Cuentas.TipoMoneda.siglas == "CUC").Sum(j => j.importe) : 0m }; DataSource = data.ToList(); this.nombreCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "persona") }); this.importeCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "importeMN") }); this.monedaCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "importeCUC") }); }
public void CargarDatos() { //Encabezado var config = ConfiguracionModel.GetConfig(); int trim = int.Parse(Trimestre.Value.ToString()); var primerDomingo = new DateTime(config.AnoActual, trim, 1); while (primerDomingo.DayOfWeek != DayOfWeek.Sunday) { primerDomingo = primerDomingo.AddDays(1); } var actualMes = primerDomingo.Month; var ultimoMes = primerDomingo.Month + 2; var nombreMes = 1; var nombreDom = 1; mes1Cell.Text = Mes(ultimoMes - 2); mes2Cell.Text = Mes(ultimoMes - 1); mes3Cell.Text = Mes(ultimoMes); while (primerDomingo.Month <= ultimoMes) { string nombreControl = "mes" + nombreMes + "Dom" + nombreDom + "Cell"; var control = FindControl(nombreControl, false); control.Text = primerDomingo.Day.ToString(); primerDomingo = primerDomingo.AddDays(7); if (actualMes != primerDomingo.Month) { actualMes++; nombreMes++; nombreDom = 1; } else { nombreDom++; } } //fin de encabezado //datos var db = new Entities(); var result = new List <dynamic>(); var lista = ListaCategoria.Value.ToString().Split(','); foreach (var s in lista) { if (s != "") { var id = int.Parse(s); var data = from i in db.Persona where i.activo && i.CategoriaPersonaid == id select new { nombre = i }; result.AddRange(data); } } DataSource = result; this.nombreCell.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "nombre") }); }
public SubreportPersonas() { InitializeComponent(); // Info de los parametros var config = ConfiguracionModel.GetConfig(); }