public ActionResult DeleteConfirmed(long id)
        {
            CountryLocationsPost countrylocations = _countrylocationsService.GetPost(id);

            countrylocations.UserName = User.Identity.Name;
            _countrylocationsService.Delete(countrylocations);
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit([Bind("ixCountryLocation,sCountryLocation,ixCountrySubDivision,sLocationCode,sNameWithoutDiacritics,sLatitude,sLongitude")] CountryLocationsPost countrylocations)
        {
            if (ModelState.IsValid)
            {
                countrylocations.UserName = User.Identity.Name;
                _countrylocationsService.Edit(countrylocations);
                return(RedirectToAction("Index"));
            }
            ViewBag.ixCountrySubDivision = new SelectList(_countrylocationsService.selectCountrySubDivisions().Select(x => new { x.ixCountrySubDivision, x.sCountrySubDivision }), "ixCountrySubDivision", "sCountrySubDivision", countrylocations.ixCountrySubDivision);

            return(View(countrylocations));
        }
        public ActionResult Edit(long id)
        {
            CountryLocationsPost countrylocations = _countrylocationsService.GetPost(id);

            if (countrylocations == null)
            {
                return(NotFound());
            }
            ViewBag.ixCountrySubDivision = new SelectList(_countrylocationsService.selectCountrySubDivisions().Select(x => new { x.ixCountrySubDivision, x.sCountrySubDivision }), "ixCountrySubDivision", "sCountrySubDivision", countrylocations.ixCountrySubDivision);

            return(View(countrylocations));
        }
        public Task Delete(CountryLocationsPost countrylocationsPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._countrylocationsRepository.RegisterDelete(countrylocationsPost);
            try
            {
                this._countrylocationsRepository.Commit();
            }
            catch (Exception ex)
            {
                this._countrylocationsRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.CompletedTask);
        }
        public Task <Int64> Create(CountryLocationsPost countrylocationsPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._countrylocationsRepository.RegisterCreate(countrylocationsPost);
            try
            {
                this._countrylocationsRepository.Commit();
            }
            catch (Exception ex)
            {
                this._countrylocationsRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.FromResult(countrylocationsPost.ixCountryLocation));
        }
 public void RegisterCreate(CountryLocationsPost countrylocationsPost)
 {
     _context.CountryLocationsPost.Add(countrylocationsPost);
 }
 public void RegisterDelete(CountryLocationsPost countrylocationsPost)
 {
     _context.CountryLocationsPost.Remove(countrylocationsPost);
 }
 public void RegisterEdit(CountryLocationsPost countrylocationsPost)
 {
     _context.Entry(countrylocationsPost).State = EntityState.Modified;
 }