public ActionResult Register()
        {
            var licenseList = licenseRepository.GetAll();
            var model       = new RegisterViewModel();

            model.LicenseList = licenseList;
            //  model.Roles = CreateUserAllowedRoles;
            return(View(model));
        }
Exemplo n.º 2
0
        public IEnumerable <LicenseViewModel> Get()
        {
            var licenses = _licenseRepository.GetAll().OrderBy(x => x.DisplayLineNo);

            if (licenses != null)
            {
                var destination = Mapper.Map <IEnumerable <License_M>, IEnumerable <LicenseViewModel> >(licenses);
                return(destination);
            }
            return(null);
        }
Exemplo n.º 3
0
        public ActionResult Customers()
        {
            var customers = userRepository.GetCustomers();
            var companys  = companyService.GetCompanysByCompanyIds(customers.Select(m => m.CompanyId).ToArray());
            var licenses  = licenseRepository.GetAll();
            var usersInfo = customers.Select(m => new UserInfoViewModel()
            {
                Id        = m.Id,
                FirstName = m.FirstName,
                LastName  = m.LastName,
                Company   = companys.Where(c => c.Id == m.CompanyId).First(),
                License   = licenses.Where(l => l.Id == companys.Where(c => c.Id == m.CompanyId).First().LicenseId).First()
            });

            return(View(usersInfo));
        }
Exemplo n.º 4
0
        public IEnumerable <LicenseModel> GetAll()
        {
            var licenses = _licensesRepository.GetAll();
            // Create BL instances from DAL instances
            var result = new List <LicenseModel>();

            foreach (var license in licenses)
            {
                result.Add(new LicenseModel
                {
                    Id     = license.Id,
                    Number = license.Number,
                });
            }

            return(result);
        }
Exemplo n.º 5
0
 public IEnumerable <License> GetAll()
 {
     return(_licenseRepository.GetAll());
 }