Exemplo n.º 1
0
        public HttpResponseMessage GetClassificationsCat(string lang)
        {
            var classifications          = ClassificationRepository.GetAllClassificationsLang(lang);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, classifications);

            return(response);
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            if (string.IsNullOrEmpty(User.Identity.Name))
            {
                return(RedirectToAction("Login", "Account"));
            }

            using (UserRepository user = new UserRepository())
            {
                ViewBag.IsAdmin = user.IsAdmin(User.Identity.Name);
            }

            ViewBag.Title = "Customer List";

            CustomerViewModel model = new CustomerViewModel();

            using (GenderRepository gender = new GenderRepository())
                model.Genders = gender.GetAll();

            using (RegionRepository region = new RegionRepository())
                model.Regions = region.GetAll();

            using (CityRepository city = new CityRepository())
                model.Cities = city.GetAll();

            using (ClassificationRepository classification = new ClassificationRepository())
                model.Classifications = classification.GetAll();

            using (UserRepository user = new UserRepository())
                model.Sellers = user.GetAll();

            return(View(model));
        }
Exemplo n.º 3
0
        public HttpResponseMessage PostClassificationById2([FromBody] int id)
        {
            var classifications          = ClassificationRepository.GetClassification(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, classifications);

            return(response);
        }
        public JsonResult GetClassificationsByType(string name)
        {
            var classificationRepo = new ClassificationRepository();
            List <Classification> classifications = classificationRepo.GetClassificationsByType(name);

            List <ClassificationViewModel> lstClassificationViewModel = new List <ClassificationViewModel>();

            lstClassificationViewModel = Mapper.Map <List <Classification>, List <ClassificationViewModel> >(classifications);

            return(Json(lstClassificationViewModel, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 5
0
        private UnitOfWork()
        {
            _context = new CarRentalAppContext();

            Bills                 = new BillRepository(_context);
            Cars                  = new CarRepository(_context);
            Clients               = new ClientRepository(_context);
            Classifications       = new ClassificationRepository(_context);
            Rents                 = new RentRepository(_context);
            Roles                 = new RoleRepository(_context);
            Users                 = new UserRepository(_context);
            _context.Database.Log = AppLogger.LogSqlInFile;
        }
        public void LoadDropDownFiltersBag()
        {
            IGenderRepository genderRepository = new GenderRepository(_connectionString);
            var genderApp = new GenderApplication(genderRepository);

            ViewBag.Genders = genderApp.GetAll().Select(g => new SelectListItem()
            {
                Text  = g.Name,
                Value = g.Id.ToString()
            }).ToList();

            ICityRepository cityRepository = new CityRepository(_connectionString);
            var             cityApp        = new CityApplication(cityRepository);

            ViewBag.Cities = cityApp.GetAll().Select(g => new SelectListItem()
            {
                Text  = g.Name,
                Value = g.Id.ToString()
            }).ToList();

            IRegionRepository regionRepository = new RegionRepository(_connectionString);
            var regionApp = new RegionApplication(regionRepository);

            ViewBag.Regions = regionApp.GetAll().Select(g => new SelectListItem()
            {
                Text  = g.Name,
                Value = g.Id.ToString()
            }).ToList();

            IClassificationRepository classificationRepository = new ClassificationRepository(_connectionString);
            var classificationApp = new ClassificationApplication(classificationRepository);

            ViewBag.Classifications = classificationApp.GetAll().Select(g => new SelectListItem()
            {
                Text  = g.Name,
                Value = g.Id.ToString()
            }).ToList();

            IUserSysRepository userRepository = new UserSysRepository(_connectionString);
            var userApp = new UserApplication(userRepository);

            ViewBag.Sellers = userApp.GetAll().Select(g => new SelectListItem()
            {
                Text  = g.Login,
                Value = g.Id.ToString()
            }).ToList();
        }
Exemplo n.º 7
0
        public JsonResult GetClassificationsByType(string type)
        {
            var classification = new ClassificationRepository();

            return(Json(classification.GetClassificationsByType(type), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 8
0
 public static List <classification> GetClassifications()
 {
     return(ClassificationRepository.GetClassifications());
 }
Exemplo n.º 9
0
 public static void UpdateClassification(int id, string name) => ClassificationRepository.Update(id, name);
Exemplo n.º 10
0
 public static void DeleteClassification(int id) => ClassificationRepository.Delete(id);
Exemplo n.º 11
0
 public static void InsertClassification(string name) => ClassificationRepository.Insert(name);
Exemplo n.º 12
0
 public static Classification GetSingleClassification(int id) => ClassificationRepository.GetSingle(id);
Exemplo n.º 13
0
 public static List <Classification> GetAllClassifications() => ClassificationRepository.GetAll();
Exemplo n.º 14
0
 public OfferClassController(ClassificationRepository classificationRepository) : base(classificationRepository)
 {
 }