예제 #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
파일: Helper.cs 프로젝트: crowar/MVCDemo
        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();
            }
        }