Exemple #1
0
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                var modelAccount = new Models.Account
                {
                    AcctNumber  = Convert.ToInt32(collection["AcctNumber"]),
                    AcctType    = collection["AcctType"],
                    AcctBalance = Convert.ToDecimal(collection["AcctBalance"]),
                    AcctHolder  = new Models.Person
                    {
                        FName    = "New",
                        LName    = "Person",
                        Address1 = "111 Main St",
                        Address2 = "Apt 42",
                        City     = "Any City",
                        State    = "WI",
                        Zip      = "12345",
                        Country  = "USA",
                    }
                };

                Domain.AccountManager.AddBankAccount(modelAccount.Map());

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public void FromModel()
        {
            var model = new Models.Account { AccountTypeName = "Asset" };
            var account = model.Map<HomeTrack.Account>();

            account.Type.Should().Be(AccountType.Asset);
        }