public ActionResult AddAccount(AddAccountViewModel model)
        {
            Account account = new Account()
            {
                AccountCode    = model.AccountCode,
                AccountName    = model.AccountName,
                AccountClassId = model.AccountClass,
                Description    = model.Description
            };

            _financialService.AddAccount(account);

            return(RedirectToAction("Accounts"));
        }
예제 #2
0
        public ActionResult AddAccount(AddAccountViewModel model)
        {
            Account account = new Account()
            {
                AccountCode     = model.AccountCode,
                AccountName     = model.AccountName,
                AccountClassId  = model.AccountClass,
                ParentAccountId = model.ParentAccountId == -1 ? null : model.ParentAccountId,
                CompanyId       = _administrationService.GetDefaultCompany().Id,
            };

            _financialService.AddAccount(account);

            return(RedirectToAction("Accounts"));
        }
        public ActionResult AddAccount(AddAccountViewModel model)
        {
            Account account = new Account()
            {
                AccountCode     = model.AccountCode,
                AccountName     = model.AccountName,
                AccountClassId  = model.AccountClass,
                ParentAccountId = model.ParentAccountId == -1 ? null : model.ParentAccountId,
                CreatedBy       = User.Identity.Name,
                ModifiedBy      = User.Identity.Name,
                CreatedOn       = DateTime.Now,
                ModifiedOn      = DateTime.Now
            };

            _financialService.AddAccount(account);

            return(RedirectToAction("Accounts"));
        }