public ActionResult DeleteConfirmed(long id)
        {
            CurrencyTypesPost currencytypes = _currencytypesService.GetPost(id);

            currencytypes.UserName = User.Identity.Name;
            _currencytypesService.Delete(currencytypes);
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit([Bind("ixCurrencyType,sCurrencyType,sCurrencyTypeCode")] CurrencyTypesPost currencytypes)
        {
            if (ModelState.IsValid)
            {
                currencytypes.UserName = User.Identity.Name;
                _currencytypesService.Edit(currencytypes);
                return(RedirectToAction("Index"));
            }

            return(View(currencytypes));
        }
        public ActionResult Edit(long id)
        {
            CurrencyTypesPost currencytypes = _currencytypesService.GetPost(id);

            if (currencytypes == null)
            {
                return(NotFound());
            }

            return(View(currencytypes));
        }
示例#4
0
        public Task Delete(CurrencyTypesPost currencytypesPost)
        {
            // Additional validations

            // Pre-process

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

            // Post-process

            return(Task.CompletedTask);
        }
示例#5
0
        public Task <Int64> Create(CurrencyTypesPost currencytypesPost)
        {
            // Additional validations

            // Pre-process

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

            // Post-process

            return(Task.FromResult(currencytypesPost.ixCurrencyType));
        }
 public void RegisterDelete(CurrencyTypesPost currencytypesPost)
 {
     _context.CurrencyTypesPost.Remove(currencytypesPost);
 }
 public void RegisterEdit(CurrencyTypesPost currencytypesPost)
 {
     _context.Entry(currencytypesPost).State = EntityState.Modified;
 }
 public void RegisterCreate(CurrencyTypesPost currencytypesPost)
 {
     _context.CurrencyTypesPost.Add(currencytypesPost);
 }