コード例 #1
0
        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"));
        }
コード例 #3
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,
                CreatedBy       = User.Identity.Name,
                ModifiedBy      = User.Identity.Name,
                CreatedOn       = DateTime.Now,
                ModifiedOn      = DateTime.Now
            };

            _financialService.AddAccount(account);

            return(RedirectToAction("Accounts"));
        }