Пример #1
0
        public ActionResult Add(AccountDTO dto)
        {
            Helper.AddAccount(dto);

            return RedirectToAction("Details", new RouteValueDictionary(
                new { controller = "Home", action = "Details", Id = dto.CustomerId }));
        }
Пример #2
0
        public static void AddAccount(AccountDTO dto)
        {
            using (var db = new WebDBEntities())
            {
                var account = new Account
                {
                    AccountCode = dto.AccountCode,
                    CustomerId = dto.CustomerId
                };

                db.Accounts.Add(account);

                db.SaveChanges();
            }
        }