Ejemplo n.º 1
0
        public ActionResult Add(AccountDTO dto)
        {
            Helper.AddAccount(dto);

            return RedirectToAction("Details", new RouteValueDictionary(
                new { controller = "Home", action = "Details", Id = dto.CustomerId }));
        }
Ejemplo n.º 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();
            }
        }