示例#1
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));
        }