public async Task <IEnumerable <SelectItemVM <int> > > GetValueByNemotecnic(string nemotecnico)
 {
     return(await _applicationDbContext.Set <T>()
            .Where(x => x.Nemotecnico.Equals(nemotecnico))
            .Select(x => SelectItemVM <int> .Create(x.Id, x.ShortDesc))
            .ToListAsync());
 }
예제 #2
0
 public async Task <IEnumerable <SelectItemVM <int> > > GetValidSupplierByNemotecnicoToView(string nemotecnico)
 {
     return(await _dbContext.Supplier.Where(x => x.IsActive.Equals(true) &&
                                            x.ProductType.Nemotecnico.Equals(nemotecnico))
            .Select(x => SelectItemVM <int> .Create(x.Id, x.Name))
            .ToListAsync());
 }
 public async Task <IEnumerable <SelectItemVM <int> > > GetGeneralEntityValidData()
 {
     return(await _applicationDbContext.Set <T>()
            .Where(x => x.IsActive.Equals(true))
            .Select(x => SelectItemVM <int> .Create(x.Id, x.ShortDesc))
            .ToListAsync());
 }
 public async Task <IEnumerable <SelectItemVM <int> > > GetValidEstatesByPersonId(int id)
 {
     return(await _dbContext.PersonsByEstate.Where(x => x.PersonId.Equals(id))
            .Include(x => x.Estate)
            .Select(x => SelectItemVM <int> .Create(x.EstateId, x.Estate.Alias))
            .ToListAsync());
 }
        public async Task <IEnumerable <SelectItemVM <int> > > GetValidWaterMeterToView()
        {
            var data = await _dbContext.WaterMeter.Where(x => x.IsActive.Equals(true))
                       .Select(x => SelectItemVM <int> .Create(x.Id, x.SerialNumber))
                       .ToListAsync();

            return(data);
        }
 public async Task <List <SelectItemVM <int> > > GetValidData()
 {
     return(await _dbContext.Contract.Include(x => x.PersonsByEstate)
            .ThenInclude(x => x.Estate)
            .Include(x => x.PersonsByEstate)
            .ThenInclude(x => x.Person)
            .Include(x => x.Meter)
            .Where(x => x.IsActive.Equals(true))
            .Select(x => SelectItemVM <int> .Create(x.Id, $"{x.PersonsByEstate.Person.FullName} / {x.PersonsByEstate.Estate.Alias} / {x.Meter.SerialNumber}"))
            .ToListAsync());
 }
예제 #7
0
        public IViewComponentResult Invoke(SelectItemVM <int>[] listPerson, SelectItemVM <int> personItemVM)
        {
            if (!listPerson.HasValue())
            {
                listPerson = Array.Empty <SelectItemVM <int> >();
            }


            Array.Resize(ref listPerson, listPerson.Length + 1);
            if (personItemVM.HasValue())
            {
                listPerson.SetValue(personItemVM, 0);
            }
            return(View(listPerson));
        }
예제 #8
0
 public new static SelectItemVM <int> Create(int value, string text)
 {
     return(SelectItemVM <int> .Create(value, text));
 }