public PartialViewResult CreateWithSelectedAddress( SelectedAddressInput model ) { if ( ModelState.IsValid ) { PaymentMethod PaymentMethod = new PaymentMethod ( model.CardHolderName, db.CardTypes.Find( model.CardTypeID ), model.CardNumber, new DateTime( model.Year, model.Month, 1 ), model.CCV, db.Addresses.Find(model.AddressID) ); Account.PaymentMethods.Add( PaymentMethod ); db.SaveChanges(); return PartialView( "_PaymentMethods", Account.PaymentMethods ); } return PartialView(); }
public PartialViewResult NewAddress( SelectedAddressInput model ) { if ( ModelState.IsValid ) { return PartialView( "_BillingAddressSelector", model as PaymentMethodInput as NewAddressInput ); } return PartialView(); }