Exemple #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            TaxesPost taxes = _taxesService.GetPost(id);

            taxes.UserName = User.Identity.Name;
            _taxesService.Delete(taxes);
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public ActionResult Edit([Bind("ixTax,sTax,ixCountry,ixCountrySubDivision,nRate")] TaxesPost taxes)
        {
            if (ModelState.IsValid)
            {
                taxes.UserName = User.Identity.Name;
                _taxesService.Edit(taxes);
                return(RedirectToAction("Index"));
            }
            ViewBag.ixCountry            = new SelectList(_taxesService.selectCountries().Select(x => new { x.ixCountry, x.sCountry }), "ixCountry", "sCountry", taxes.ixCountry);
            ViewBag.ixCountrySubDivision = new SelectList(_taxesService.selectCountrySubDivisions().Select(x => new { x.ixCountrySubDivision, x.sCountrySubDivision }), "ixCountrySubDivision", "sCountrySubDivision", taxes.ixCountrySubDivision);

            return(View(taxes));
        }
Exemple #3
0
        public ActionResult Edit(long id)
        {
            TaxesPost taxes = _taxesService.GetPost(id);

            if (taxes == null)
            {
                return(NotFound());
            }
            ViewBag.ixCountry            = new SelectList(_taxesService.selectCountries().Select(x => new { x.ixCountry, x.sCountry }), "ixCountry", "sCountry", taxes.ixCountry);
            ViewBag.ixCountrySubDivision = new SelectList(_taxesService.selectCountrySubDivisions().Select(x => new { x.ixCountrySubDivision, x.sCountrySubDivision }), "ixCountrySubDivision", "sCountrySubDivision", taxes.ixCountrySubDivision);

            return(View(taxes));
        }
Exemple #4
0
        public Task Delete(TaxesPost taxesPost)
        {
            // Additional validations

            // Pre-process

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

            // Post-process

            return(Task.CompletedTask);
        }
Exemple #5
0
        public Task <Int64> Create(TaxesPost taxesPost)
        {
            // Additional validations

            // Pre-process

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

            // Post-process

            return(Task.FromResult(taxesPost.ixTax));
        }
 public void RegisterDelete(TaxesPost taxesPost)
 {
     _context.TaxesPost.Remove(taxesPost);
 }
 public void RegisterEdit(TaxesPost taxesPost)
 {
     _context.Entry(taxesPost).State = EntityState.Modified;
 }
 public void RegisterCreate(TaxesPost taxesPost)
 {
     _context.TaxesPost.Add(taxesPost);
 }