public void Fill(CargarDatosContext datacontext) { baseFill(datacontext); Edificio = datacontext.context.Edificio.FirstOrDefault(x => x.EdificioId == EdificioId); var gasto = datacontext.context.Gasto.FirstOrDefault(x => x.GastoId == GastoId); DescripcionUnidadMedida = gasto.UnidadTiempo.Descripcion.ToUpper(); this.Orden = datacontext.context.DetalleGasto.Where(x => x.GastoId == gasto.GastoId && x.Estado == ConstantHelpers.EstadoActivo).Max(x => x.Orden) + 1; detalles = new List <Tuple <string, string> >(); if (DetalleGastoId.HasValue) { DetalleGasto detallegasto = datacontext.context.DetalleGasto.FirstOrDefault(x => x.DetalleGastoId == DetalleGastoId.Value); if (detallegasto != null) { this.Concepto = detallegasto.Concepto; this.DetalleGastoId = detallegasto.DetalleGastoId; this.Monto = detallegasto.Monto; this.Estado = detallegasto.Estado; this.GastoId = detallegasto.GastoId; this.Pagado = detallegasto.Pagado; this.Ordinario = detallegasto.Ordinario; this.Orden = detallegasto.Orden; if (!String.IsNullOrWhiteSpace(detallegasto.Detalle)) { detalles.AddRange(detallegasto.Detalle.Split('|').Where(X => !String.IsNullOrWhiteSpace(X)).Select(X => new Tuple <String, String>(X.Split(';').First(), X.Split(';').Last())).ToList()); } } else { this.Pagado = true; this.Ordinario = true; } } }
public void fill(CargarDatosContext datacontext, Int32 EdificioId, Int32?UnidadTiempoId) { baseFill(datacontext); this.EdificioId = EdificioId; this.UnidadTiempoId = UnidadTiempoId; Edificio = datacontext.context.Edificio.First(X => X.EdificioId == EdificioId); LstComboUnidadTiempo = new List <SelectListItem>(); var lstunidadtiempo = datacontext.context.UnidadTiempo.OrderByDescending(x => x.Anio).OrderByDescending(x => x.Mes).Where(x => x.Estado == ConstantHelpers.EstadoActivo); foreach (var item in lstunidadtiempo) { LstComboUnidadTiempo.Add(new SelectListItem { Value = item.UnidadTiempoId.ToString(), Text = item.Descripcion.ToUpper() }); } if (UnidadTiempoId.HasValue) { var Archivo = datacontext.context.ReporteEdificioUnidadTiempo.FirstOrDefault(X => X.EdificioId == EdificioId && X.UnidadTiempoId == UnidadTiempoId.Value); if (Archivo == null) { RutaArchivo = ""; NombreArchivo = "No se ha subido ningún archivo"; } else { RutaArchivo = Archivo.Ruta; NombreArchivo = Archivo.Nombre; } } }
public void Fill(CargarDatosContext c, Int32?np, String direccion, String distrito, String cliente) { this.np = np ?? 1; this.Direccion = direccion; this.Distrito = distrito; this.Cliente = cliente; var query = c.context.ClienteCorretaje.Where(x => x.Estado == ConstantHelpers.EstadoActivo).AsQueryable(); if (!String.IsNullOrEmpty(this.Direccion)) { query = query.Where(x => x.Direccion.Contains(this.Direccion)); } if (!String.IsNullOrEmpty(this.Distrito)) { query = query.Where(x => x.Distrito.Contains(this.Distrito)); } if (!String.IsNullOrEmpty(this.Cliente)) { query = query.Where(x => x.Cliente.Contains(this.Cliente)); } query = query.OrderBy(x => x.Distrito); LstClienteCorretaje = query.ToPagedList(this.np ?? 1, ConstantHelpers.DEFAULT_PAGE_SIZE); }
public void Fill(CargarDatosContext c, Int32 edificioId, Int32?anio) { baseFill(c); EdifiId = edificioId; Anio = anio; if (!this.Anio.HasValue) { this.Anio = DateTime.Now.Year; } var anioMinimo = c.context.UnidadTiempo.Min(x => x.Anio); var anioActual = DateTime.Now.Year; for (int i = 0; i <= anioActual - anioMinimo; i++) { var value = (anioActual - i).ToString(); LstAnios.Add(new SelectListItem { Value = value, Text = value }); } if (this.Anio.HasValue) { LstDatos = c.context.DatoEdificio.Where(X => X.EdificioId == EdifiId && X.UnidadTiempo.Anio == this.Anio && X.Dato == X.Nombre).OrderBy(X => X.UnidadTiempo.Orden).ToList(); } else { LstDatos = c.context.DatoEdificio.Where(X => X.EdificioId == EdifiId && X.Dato == X.Nombre).OrderBy(X => X.UnidadTiempo.Orden).ToList(); } MaxOrden = (LstDatos.Max(x => x.Orden) ?? 0) + 1; }
public async System.Threading.Tasks.Task Fill(CargarDatosContext dataContext) { String Baseurl = ConstantHelpers.AddKey("urlbase"); var result = await ConstantHelpers.GetUrlAsync(Baseurl, "SAV/brands"); LstBrand = JsonConvert.DeserializeObject <List <BrandEntity> >(result.Data.ToString()); }
public void Fill(CargarDatosContext datosContext, Int32?customerId) { LstSex.Add(new Sex("M", "Masculino")); LstSex.Add(new Sex("F", "Femenino")); LstLocal = datosContext.context.Local.Where(x => x.Status == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.CustomerId = customerId; if (this.CustomerId.HasValue) { var customer = datosContext.context.Customer.FirstOrDefault(x => x.CustomerId == this.CustomerId); this.Names = customer.Names; this.LastNames = customer.Last_Names; this.Sex = customer.Sex; this.Identity_Document = customer.Identity_Document; this.DistrictId = customer.DistrictId; this.Birthdate = customer.Birthdate; this.Phone = customer.Phone; this.Email = customer.Email; this.ProvinceId = customer.District.ProvinceId; this.DepartmentId = customer.District.Province.DepartmentId; this.DepartmentIdHidden = customer.District.Province.DepartmentId; this.ProvinceIdHidden = customer.District.ProvinceId; this.DistrictIdHidden = customer.DistrictId; } }
public void Fill(CargarDatosContext datacontext, Int32 EdificioId, Int32?UnidadTiempoId) { baseFill(datacontext); this.EdificioId = EdificioId; this.UnidadTiempoId = UnidadTiempoId; LstTrabajadores = datacontext.context.Trabajador.Where(x => x.EdificioId == EdificioId && x.Estado == ConstantHelpers.EstadoActivo).ToList(); var lstunidadtiempo = datacontext.context.UnidadTiempo.OrderByDescending(x => x.Anio).OrderByDescending(x => x.Mes).Where(x => x.Estado == ConstantHelpers.EstadoActivo); foreach (var item in lstunidadtiempo) { LstComboUnidadTiempo.Add(new SelectListItem { Value = item.UnidadTiempoId.ToString(), Text = item.Descripcion.ToUpper() }); } Edificio = datacontext.context.Edificio.Find(EdificioId); foreach (var item in LstTrabajadores) { PlanillaQuincena p = datacontext.context.PlanillaQuincena.Where(x => x.TrabajadorId == item.TrabajadorId && x.UnidadTiempoId == UnidadTiempoId).FirstOrDefault(); LstPlanilla.Add(p); } }
public void Fill(CargarDatosContext datacontext, Int32 edificioId) { baseFill(datacontext); EdificioId = edificioId; var edificio = datacontext.context.Edificio.FirstOrDefault(X => X.EdificioId == edificioId); NombreEdificio = edificio.Nombre; //var lstPropietarios = edificio.Departamento.Where( x => x.Estado == ConstantHelpers.EstadoActivo).SelectMany(x => x.Propietario).Distinct().ToList(); var query = datacontext.context.Propietario.Where(x => x.Estado == ConstantHelpers.EstadoActivo && x.Departamento.EdificioId == edificioId).Distinct().ToList(); //List<Propietario> lstPropietarios = new List<Propietario>(); //List<String> Lstnombre = new List<String>(); //foreach (var item in query) //{ // if (!Lstnombre.Contains(item.Nombres)) // { // Lstnombre.Add(item.Nombres); // lstPropietarios.Add(item); // } //} lstDestinatario = new List <Destinatario>(); lstDestinatario.AddRange(query.Select(X => new Destinatario { dptoId = X.DepartamentoId, dpto = X.Departamento.Numero, nombre = X.Nombres + X.ApellidoPaterno, email = X.Email, id = X.PropietarioId.ToString() }).ToList()); lstDestinatario.AddRange(query.SelectMany(X => X.Inquilino.Where(Y => Y.Estado == ConstantHelpers.EstadoActivo).Select(Y => new Destinatario { dptoId = Y.Propietario.DepartamentoId, dpto = Y.Propietario.Departamento.Numero, nombre = Y.Nombres, email = Y.Email, id = "i" + Y.InquilinoId.ToString(), EsInquilino = true }).ToList())); lstDestinatario = lstDestinatario.OrderBy(x => x.dptoId).ToList(); check = new List <bool>(); }
public void Fill(CargarDatosContext c, Int32 edificioId, Int32?cronogramaId, Int32?anio) { baseFill(c); this.EdificioId = edificioId; this.CronogramaId = cronogramaId; this.Anio = anio ?? DateTime.Now.Year; try { this.Orden = c.context.Cronograma.Where(x => x.EdificioId == this.EdificioId && x.Anio == this.Anio).Max(x => x.Orden) + 1; } catch (Exception ex) { this.Orden = 1; } if (this.CronogramaId.HasValue) { var cronograma = c.context.Cronograma.FirstOrDefault(x => x.CronogramaId == this.CronogramaId); this.Orden = cronograma.Orden; this.Nombre = cronograma.Nombre; this.Anio = cronograma.Anio; } //var anioMinimo = c.context.UnidadTiempo.Min(x => x.Anio); var anioMinimo = 2017; var anioActual = DateTime.Now.Year; for (int i = 0; i <= anioActual - anioMinimo; i++) { var value = (anioActual - i).ToString(); LstAnios.Add(new SelectListItem { Value = value, Text = value }); } }
public void Fill(CargarDatosContext c, Int32 usuarioId) { UsuarioId = usuarioId; var usuario = c.context.Usuario.FirstOrDefault(x => x.UsuarioId == UsuarioId); ContrasenaAntigua = usuario.Password; }
public void Fill(CargarDatosContext c, Int32?cuotaId, Int32 edificioId, Int32 unidadTiempoId) { baseFill(c); this.EdificioId = edificioId; this.UnidadTiempoId = unidadTiempoId; this.CuotaId = cuotaId; LstEstado.Add(new SelectListItem { Text = "Sin Pagar", Value = "0" }); LstEstado.Add(new SelectListItem { Text = "Pagado", Value = "1" }); NombreEdificio = c.context.Edificio.FirstOrDefault(x => x.EdificioId == this.EdificioId).Nombre; NombreUnidadTiempo = c.context.UnidadTiempo.FirstOrDefault(x => x.UnidadTiempoId == this.UnidadTiempoId).Descripcion; LstDepartamento = c.context.Departamento.Where(x => x.EdificioId == this.EdificioId && x.Estado == ConstantHelpers.EstadoActivo).ToList(); if (this.CuotaId.HasValue) { var cuota = c.context.Cuota.FirstOrDefault(x => x.CuotaId == this.CuotaId); //this.EdifiId = cuota.Departamento.EdificioId; FechaPago = cuota.FechaPagado == null ? String.Empty : cuota.FechaPagado.Value.ToShortDateString(); Mora = cuota.Mora; Leyenda = cuota.Leyenda; Estado = (cuota.Pagado == false ? "0" : "1").ToString(); MontoExtraordinaria = cuota.CuotaExtraordinaria; } }
public void Fill(CargarDatosContext c, Int32?page, String invoiceDescription, Int32?familyId, Int32?subFamilyId, Int32?fatherId) { this.Page = page ?? 1; this.InvoiceDescription = invoiceDescription; this.FamilyId = familyId; this.SubFamilyId = subFamilyId; this.LstFamily = c.context.Family.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.LstSubFamily = c.context.SubFamily.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.FatherId = fatherId; var query = c.context.Product.Where(x => x.State.Equals(ConstantHelpers.ESTADO.ACTIVO)).AsQueryable(); if (!String.IsNullOrEmpty(this.InvoiceDescription)) { query = query.Where(x => x.InvoiceDescription.Equals(this.InvoiceDescription)); } if (this.FamilyId.HasValue) { query = query.Where(x => x.SubFamily.Family.FamilyId == this.FamilyId); } if (this.SubFamilyId.HasValue) { query = query.Where(x => x.SubFamilyId == this.SubFamilyId); } this.LstProduct = query.OrderBy(x => x.InvoiceDescription).ToPagedList(this.Page.Value, ConstantHelpers.DEFAULT_PAGE_SIZE); }
public void Fill(CargarDatosContext datacontext) { baseFill(datacontext); Trabajador = datacontext.context.Trabajador.FirstOrDefault(x => x.TrabajadorId == TrabajadorId); Edificio = datacontext.context.Edificio.FirstOrDefault(x => x.EdificioId == EdificioId); if (PlanillaId.HasValue) { Planilla planilla = datacontext.context.Planilla.FirstOrDefault(x => x.PlanillaId == PlanillaId.Value); this.TrabajadorId = planilla.TrabajadorId; this.UnidadTiempoId = planilla.UnidadTiempoId; this.HorasExtras = planilla.HorasExtras; this.Feriado = planilla.Feriado; this.AdelantoQuincena = planilla.AdelantoQuincena; this.SegundaQuincena = planilla.SegundaQuincena; this.ESSALUD = planilla.ESSALUD; this.AporteObligatorio = planilla.AporteObligatorio; this.PrimaSeguro = planilla.PrimaSeguro; this.ComisionAFP = planilla.ComisionAFP; this.TotalDescuentos = planilla.TotalDescuentos; this.SueldoTotalNeto = planilla.SueldoTotalNeto; this.SegundaQuincenaNeto = planilla.SegundaQuincenaNeto; this.CTSMes = planilla.CTSMes; this.ReemplazoVacaciones = planilla.ReemplazoVacaciones; } }
public void Fill(CargarDatosContext c, Int32?supplierId) { this.SupplierId = supplierId; this.LstCountry = c.context.Country.Where(x => x.State.Equals(ConstantHelpers.ESTADO.ACTIVO)).ToList(); if (this.SupplierId.HasValue) { var supplier = c.context.Supplier.FirstOrDefault(x => x.SupplierId == this.SupplierId); this.CountryId = supplier.CountryId; this.Code = supplier.Code; this.RUC = supplier.RUC; this.BussinessName = supplier.BussinessName; this.MethodPayment = supplier.MethodPayment; this.IsActive = supplier.IsActive; this.Provenance = supplier.Provenance; this.Origin = supplier.Origin; this.Address = supplier.Address; this.ZipCode = supplier.ZipCode; this.Retention = supplier.Retention; this.Detraction = supplier.Detraction; this.Perception = supplier.Perception; this.State = supplier.State; } }
public void Fill(CargarDatosContext c, Int32 cuotaId) { LstEstado.Add(new SelectListItem { Text = "Pagado", Value = "1" }); LstEstado.Add(new SelectListItem { Text = "Sin Pagar", Value = "0" }); LstAdelantado.Add(new SelectListItem { Text = "SÍ", Value = "1" }); LstAdelantado.Add(new SelectListItem { Text = "NO", Value = "0" }); this.CuotaId = cuotaId; var cuota = c.context.Cuota.FirstOrDefault(x => x.CuotaId == this.CuotaId); this.EdifiId = cuota.Departamento.EdificioId; FechaPago = cuota.FechaPagado == null ? String.Empty : cuota.FechaPagado.Value.ToShortDateString(); Mora = cuota.Mora; Leyenda = cuota.Leyenda; Estado = (cuota.Pagado == false ? "0" : "1").ToString(); EsAdelantado = cuota.EsAdelantado.HasValue ? (cuota.EsAdelantado.Value == true ? "1" : "0") : "0"; NoEsVisibleMorosidad = cuota.NoEsVisibleMorosidad.HasValue ? (cuota.NoEsVisibleMorosidad.Value == true ? "0" : "1") : "1"; }
public void Fill(CargarDatosContext datacontext) { baseFill(datacontext); var Edificio = datacontext.context.Edificio.FirstOrDefault(x => x.EdificioId == EdificioId); NombreEdificio = Edificio.Nombre; DesfaseRecibos = Edificio.DesfaseRecibos; CantidadReporte = Edificio.CantidadReporte; this.Identificador = Edificio.Identificador; AcronimoEdificio = Edificio.Acronimo; LstDepartamentos = datacontext.context.Departamento.Where(x => x.EdificioId == EdificioId).ToList(); long utRecibo = 0; foreach (var item in LstDepartamentos) { try { utRecibo = item.UnidadTiempoReciboDepartamento.Where(x => item.DepartamentoId == x.DepartamentoId).Max(x => x.NumeroRecibo); } catch { utRecibo = 0; } DicNumeroRecibo.Add(item.DepartamentoId, utRecibo.ToString().PadLeft(6, '0')); } }
public void Fill(CargarDatosContext c, Int32?outputNoteId, Int32?fatherId) { this.FatherId = fatherId; this.OutputNoteId = outputNoteId; this.LstStore = c.context.Store.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.LstMovementType = c.context.MovementType.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO && x.Type == "OUT").ToList(); this.LstDocumentType = c.context.DocumentType.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); if (this.OutputNoteId.HasValue) { var outputNote = c.context.OutputNote.FirstOrDefault(x => x.OutputNoteId == this.OutputNoteId); this.Date = outputNote.Date; this.Time = outputNote.Time; this.Code = outputNote.Code; this.MovementTypeId = outputNote.MovementTypeId; this.DestinationStoreId = outputNote.DestinationStoreId; this.OriginalStoreId = outputNote.OriginalStoreId; this.DocumentId = outputNote.DocumentId; this.DepartureDate = outputNote.DepartureDate; this.Other = outputNote.Other; this.IsOfficeGuide = outputNote.IsOfficeGuide; this.IsTransferGuide = outputNote.IsTransferGuide; //this.DocumentCode = outputNote.DocumentCode; this.LstOutputNoteDetail = c.context.OutputNoteDetail.Where(x => x.OutputNoteId == this.OutputNoteId && x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.LstProduct = c.context.StockProductDetail.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO && x.OutputNoteId == this.OutputNoteId).Select(x => x.StockProduct.ProductId).Distinct().ToList(); } }
public async System.Threading.Tasks.Task Fill(CargarDatosContext dataContext, Int32?productBrandId) { String Baseurl = ConstantHelpers.AddKey("urlbase"); var result = await ConstantHelpers.GetUrlAsync(Baseurl, "SAV/entryexitproducs/" + productBrandId.ToString()); LstEntryExitProduct = JsonConvert.DeserializeObject <List <EntryExitProductEntity> >(result.Data.ToString()); }
public void Fill(CargarDatosContext c, Int32?page, String code, String orderDate, Int32?supplierId, Int32?fatherId) { this.Page = page ?? 1; this.FatherId = fatherId; this.Code = code; this.OrderDate = orderDate; this.SupplierId = supplierId; LstSupplier = c.context.Supplier.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); var query = c.context.PurcherseOrder.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).AsQueryable(); if (!String.IsNullOrEmpty(this.Code)) { query = query.Where(x => x.Code.Contains(this.Code)); } if (!String.IsNullOrEmpty(this.OrderDate)) { var dtOrderDate = this.OrderDate.ToDateTime(); query = query.Where(x => x.OrderDate.Year == dtOrderDate.Year && x.OrderDate.Month == dtOrderDate.Month && x.OrderDate.Day == dtOrderDate.Day); } if (this.SupplierId.HasValue) { query = query.Where(x => x.PrePurcherseOrder.SupplierId == this.SupplierId); } LstPO = query.OrderByDescending(x => x.PurcherseOrderId).ToPagedList(this.Page.Value, ConstantHelpers.DEFAULT_PAGE_SIZE); }
public void Fill(CargarDatosContext dataContext, Int32?p) { this.p = p ?? 1; var query = dataContext.context.Product.Where(x => x.Status == ConstantHelpers.ESTADO.ACTIVO).AsQueryable(); LstProduct = query.OrderBy(x => x.ProductId).ToPagedList(this.p, ConstantHelpers.DEFAULT_PAGE_SIZE); }
public void Fill(CargarDatosContext datacontext) { baseFill(datacontext); Departamento = datacontext.context.Departamento.FirstOrDefault(x => x.DepartamentoId == DepartamentoId); Edificio = datacontext.context.Edificio.FirstOrDefault(x => x.EdificioId == EdificioId); var cuotaAnterior = datacontext.context.Cuota.OrderByDescending(x => x.FechaRegistro).FirstOrDefault(x => x.DepartamentoId == DepartamentoId); this.LecturaAguaAnterior = cuotaAnterior != null ? cuotaAnterior.LecturaAgua : 0; if (CuotaId.HasValue) { Cuota cuota = datacontext.context.Cuota.FirstOrDefault(x => x.CuotaId == CuotaId.Value); this.LecturaAgua = cuota.LecturaAgua; this.ConsumoAgua = cuota.ConsumoAgua; this.Monto = cuota.ConsumoMes; this.Estado = cuota.Estado; this.Monto = cuota.Monto; this.Mora = cuota.Mora; this.Total = cuota.Total; this.Estado = cuota.Estado; this.UnidadTiempoId = cuota.UnidadTiempoId; this.FechaRegistro = cuota.FechaRegistro; this.ConsumoSoles = cuota.ConsumoSoles; this.AreaComun = cuota.AreaComun; this.Alcantarillado = cuota.Alcantarillado; this.CargoFijo = cuota.CargoFijo; this.IGV = cuota.IGV; this.ConsumoAguaTotal = cuota.ConsumoAguaTotal; } }
public void Fill(CargarDatosContext c, Int32?entryNoteId, Int32?fatherId) { this.FatherId = fatherId; this.EntryNoteId = entryNoteId; this.LstMovementType = c.context.MovementType.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO && x.Type == "ENT").ToList(); this.LstStore = c.context.Store.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.LstDocumentType = c.context.DocumentType.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); if (this.EntryNoteId.HasValue) { var entryNote = c.context.EntryNote.FirstOrDefault(x => x.EntryNoteId == this.EntryNoteId); this.Date = entryNote.Date; this.Time = entryNote.Time; this.Code = entryNote.Code; this.MovementTypeId = entryNote.MovementTypeId; this.DestinationStoreId = entryNote.DestinationStoreId; this.SupplierGuideNumber = entryNote.SupplierGuideNumber; this.DocumentId = entryNote.DocumentId; this.TransportGuideNumber = entryNote.TransportGuideNumber; this.Seal = entryNote.Seal; this.TransportTime = entryNote.TransportTime; this.DestinationStoreId = entryNote.DestinationStoreId; this.SupplierId = entryNote.SupplierId; this.DocumentCode = entryNote.DocumentCode; this.NombreProveedor = entryNote.Supplier.BussinessName; this.LstEntryNoteDetail = c.context.EntryNoteDetail.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO && x.EntryNoteId == this.EntryNoteId).ToList(); this.LstProduct = LstEntryNoteDetail.Select(x => x.PrePurcherseOrderDetail.ProductId).Distinct().ToList(); } }
public void Fill(CargarDatosContext datacontext, Int32?_np, Int32?anio) { baseFill(datacontext); np = _np ?? 1; this.Anio = anio; if (!this.Anio.HasValue) { this.Anio = DateTime.Now.Year; } var anioMinimo = datacontext.context.UnidadTiempo.Min(x => x.Anio); var anioActual = DateTime.Now.Year; for (int i = 0; i <= anioActual - anioMinimo; i++) { var value = (anioActual - i).ToString(); LstAnios.Add(new SelectListItem { Value = value, Text = value }); } Departamento = datacontext.context.Departamento.FirstOrDefault(x => x.DepartamentoId == DepartamentoId); Edificio = datacontext.context.Edificio.FirstOrDefault(x => x.EdificioId == EdificioId); //var query = datacontext.context.Gasto.OrderBy(x => x.FechaRegistro).Where(x => x.Estado == ConstantHelpers.EstadoActivo).AsQueryable(); var query = datacontext.context.Gasto.OrderByDescending(x => x.FechaRegistro).Where(x => x.Estado == ConstantHelpers.EstadoActivo && x.EdificioId == Edificio.EdificioId).AsQueryable(); if (this.Anio.HasValue) { query = query.Where(x => x.UnidadTiempo.Anio == this.Anio); } LstGasto = query.ToPagedList(np.Value, ConstantHelpers.DEFAULT_PAGE_SIZE); }
public async System.Threading.Tasks.Task FillAdd(CargarDatosContext dataContext) { var localId = dataContext.session.GetLocalId(); var userId = dataContext.session.GetUserId(); String Baseurl = ConstantHelpers.AddKey("urlbase"); LstSaleDetail = new List <SaleDetailEntity>(); var resultLocal = await ConstantHelpers.GetUrlAsync(Baseurl, "SAV/locals"); LstLocal = JsonConvert.DeserializeObject <List <LocalEntity> >(resultLocal.Data.ToString()); var resultUser = await ConstantHelpers.GetUrlAsync(Baseurl, "SAV/users"); LstUser = JsonConvert.DeserializeObject <List <UserEntity> >(resultUser.Data.ToString()); var resultSale = await ConstantHelpers.GetUrlAsync(Baseurl, "SAV/sales"); var LstSale = JsonConvert.DeserializeObject <List <SaleEntity> >(resultSale.Data.ToString()); var resultCustomer = await ConstantHelpers.GetUrlAsync(Baseurl, "SAV/customers"); LstCustomer = JsonConvert.DeserializeObject <List <CustomerEntity> >(resultCustomer.Data.ToString()); var resultProductBrand = await ConstantHelpers.GetUrlAsync(Baseurl, "SAV/productbrands"); LstProductBrand = JsonConvert.DeserializeObject <List <ProductBrandEntity> >(resultProductBrand.Data.ToString()); CodeVoucher = NumberVoucher(LstSale); }
public void Fill(CargarDatosContext dataContext, Int32?p) { this.p = p ?? 1; var query = dataContext.context.Brand.Where(x => x.Status == ConstantHelpers.ESTADO.ACTIVO); LstBrand = query.OrderBy(x => x.BrandId).ToPagedList(this.p, ConstantHelpers.DEFAULT_PAGE_SIZE); }
public void Fill(CargarDatosContext datacontext, Int32?_np) { baseFill(datacontext); np = _np ?? 1; Edificio = datacontext.context.Edificio.FirstOrDefault(x => x.EdificioId == EdificioId); var query = datacontext.context.DetalleGasto .Include(x => x.Gasto) .Include(x => x.Gasto.Edificio) .OrderByDescending(x => x.FechaRegistro) .Where(x => x.Estado == ConstantHelpers.EstadoActivo && x.Gasto.Edificio.EdificioId == EdificioId) .AsQueryable(); if (GastoId.HasValue) { DescripcionUnidadMedida = datacontext.context.Gasto.FirstOrDefault(x => x.GastoId == GastoId).UnidadTiempo.Descripcion.ToUpper(); query = query.Where(x => x.GastoId == GastoId.Value); } int ContOrden = query.Count(x => x.Orden.HasValue == false); if (ContOrden == 0) { LstDetalleGasto = query.OrderBy(x => x.Orden).ToList(); } else { LstDetalleGasto = query.ToList();//(np.Value, ConstantHelpers.DEFAULT_PAGE_SIZE); } }
public void Fill(CargarDatosContext c, Int32?page, String state, String date, Int32?movementTypeId, String code, Int32?fatherId) { this.FatherId = fatherId; this.Page = page ?? 1; this.State = state; this.Date = date; this.Code = code; this.MovementTypeId = movementTypeId; this.LstMovementType = c.context.MovementType.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO && x.Type == "OUT").ToList(); var query = c.context.OutputNote.AsQueryable(); if (!String.IsNullOrEmpty(this.State)) { query = query.Where(x => x.State == this.State); } if (!String.IsNullOrEmpty(this.Date)) { var dtDate = this.Date.ToDateTime(); query = query.Where(x => x.Date.Day == dtDate.Day && x.Date.Month == dtDate.Month && x.Date.Year == dtDate.Year); } if (this.MovementTypeId.HasValue) { query = query.Where(x => x.MovementTypeId == this.MovementTypeId); } if (!String.IsNullOrEmpty(this.Code)) { query = query.Where(x => x.Code == this.Code); } LstOutPutNote = query.OrderByDescending(x => x.OutputNoteId).ToPagedList(this.Page.Value, ConstantHelpers.DEFAULT_PAGE_SIZE); }
public void Fill(CargarDatosContext c, Int32?clienteCorretajeId, String flagVer) { this.FlagVer = flagVer; this.ClienteCorretajeId = clienteCorretajeId; if (this.ClienteCorretajeId.HasValue) { var cliente = c.context.ClienteCorretaje.FirstOrDefault(x => x.ClienteCorretajeId == this.ClienteCorretajeId); this.TipoServicio = cliente.TipoServicio; this.TipoInmueble = cliente.TipoInmueble; this.Direccion = cliente.Direccion; this.Distrito = cliente.Distrito; this.Area = cliente.Area; this.Dormitorios = cliente.Dormitorios; this.Estacionamientos = cliente.Estacionamientos; this.Deposito = cliente.Deposito; this.Antiguedad = cliente.Antiguedad; this.CantidadPiso = cliente.CantidadPiso; this.Precio = cliente.Precio; this.CostoMantenimiento = cliente.CostoMantenimiento; this.Cliente = cliente.Cliente; this.Numero = cliente.Numero; this.Correo = cliente.Correo; this.Otros = cliente.Otros; this.CantidadInmuebles = CantidadInmuebles; } }
public void Fill(CargarDatosContext c, Int32?inquilinoId, Int32?propietarioId, Int32 departamentoId, Int32 edificioId) { baseFill(c); this.PropietarioId = propietarioId; this.DepartamentoId = departamentoId; this.EdificioId = edificioId; this.InquilinoId = inquilinoId; if (this.InquilinoId.HasValue) { Inquilino inq = c.context.Inquilino.FirstOrDefault(X => X.InquilinoId == this.InquilinoId); if (inq != null) { this.NombresInq = inq.Nombres; this.CelularInq = inq.Celular; this.TelefonoInq = inq.Telefono; this.EmailInq = inq.Email; this.ContactoInquilino = inq.Contacto; this.DniInquilino = inq.Dni; this.RUCInq = inq.RUC; this.RazonSocialInq = inq.RazonSocial; this.MostrarRUCInq = inq.MostrarRUC.Value; } } }
public void Fill(CargarDatosContext c, Int32?prePurcherseOrderId, Int32?fatherId) { this.FatherId = fatherId; var fecha = DateTime.Now; this.Registration = fecha.ToString("dd/MM/yyyy HH:mm:ss"); this.RegistrationDate = fecha.ToString("dd/MM/yyyy"); this.RegistrationTime = fecha.ToString("HH:mm:ss"); this.PrePurcherseOrderId = prePurcherseOrderId; //this.LstSupplier = c.context.Supplier.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.LstCountry = c.context.Country.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.LstMeasureUnit = c.context.MeasureUnit.Where(x => x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); if (this.PrePurcherseOrderId.HasValue) { var prepo = c.context.PrePurcherseOrder.FirstOrDefault(x => x.PrePurcherseOrderId == this.PrePurcherseOrderId); this.LstPrePODetail = c.context.PrePurcherseOrderDetail.Where(x => x.PrePurcherseOrderId == this.PrePurcherseOrderId && x.State == ConstantHelpers.ESTADO.ACTIVO).ToList(); this.Code = prepo.Code; this.DateOrder = prepo.DateOrder.ToString("dd/MM/yyyy"); this.Registration = prepo.RegistrationDate.ToString("dd/MM/yyyy HH:mm:ss"); this.SupplierId = prepo.SupplierId; this.CountryId = prepo.CountryId; this.ShipmentDate = prepo.ShipmentDate.ToString("dd/MM/yyyy"); this.RegistrationDate = prepo.RegistrationDate.ToString("dd/MM/yyyy"); this.RegistrationTime = prepo.RegistrationDate.ToString("HH:mm:ss"); this.Text = prepo.Text; this.SendSupply = prepo.SendSupply; this.SupplierCode = prepo.Supplier.Code; this.AddressSupplier = prepo.Supplier.Address; this.SupplierBussinessName = prepo.Supplier.BussinessName; } }