public List<SparepartViewModel> GetSparepartLookupList()
        {
            List<Sparepart> result = _sparepartRepository.GetMany(sp => sp.Status == (int)DbConstant.DefaultDataStatus.Active).ToList();
            List<SparepartViewModel> mappedResult = new List<SparepartViewModel>();

            return Map(result, mappedResult);
        }
Exemplo n.º 2
0
        public List <SparepartViewModel> GetAllSparepart()
        {
            List <Sparepart>          result       = _sparepartRepository.GetMany(c => c.Status == (int)DbConstant.DefaultDataStatus.Active).ToList();
            List <SparepartViewModel> mappedResult = new List <SparepartViewModel>();

            return(Map(result, mappedResult));
        }
        public List<Sparepart> SearchSparepart(int categoryReferenceId, string name)
        {
            List<Sparepart> result = null;

            if (categoryReferenceId > 0)
            {
                result = _sparepartRepository.GetMany(sp => sp.Status == (int)DbConstant.DefaultDataStatus.Active &&
                    sp.CategoryReferenceId == categoryReferenceId && sp.Name.Contains(name)).ToList();
            }
            else
            {
                result = _sparepartRepository.GetMany(sp => sp.Status == (int)DbConstant.DefaultDataStatus.Active && sp.Name.Contains(name)).ToList();
            }

            return result;
        }
        public bool IsSparepartWheel(int sparepartId)
        {
            Sparepart wheelSparepart = _sparepartRepository.GetMany(w => w.Id == sparepartId && w.Status == (int)DbConstant.DefaultDataStatus.Active && w.IsSpecialSparepart).FirstOrDefault();

            return(wheelSparepart != null);
        }