public ActionResult Create(CuentaBancariaVM cuentaBancariaVM) { CuentaBancaria cuentaBancaria = new CuentaBancaria(); //Valido que al menos tenga uno de estos campos if (cuentaBancariaVM.ClabeInterbancaria == null && cuentaBancariaVM.NumeroCuenta == null && cuentaBancariaVM.NumeroDeTarjeta == null) { ModelState.AddModelError("NumeroCuenta", "Debe de especificarse al menos un Número de Cuenta"); } if (ModelState.IsValid) { Mapper.Map(cuentaBancariaVM, cuentaBancaria); repository.Add(cuentaBancaria); repository.Save(); cuentaBancariaVM.CuentaId = cuentaBancaria.CuentaId; return PartialView("_Details", cuentaBancariaVM); } return PartialView(cuentaBancariaVM); }
/// <summary> /// Deprecated Method for adding a new object to the CuentaBancarias EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCuentaBancarias(CuentaBancaria cuentaBancaria) { base.AddObject("CuentaBancarias", cuentaBancaria); }
/// <summary> /// Create a new CuentaBancaria object. /// </summary> /// <param name="bancoId">Initial value of the BancoId property.</param> /// <param name="cuentaId">Initial value of the CuentaId property.</param> /// <param name="titular">Initial value of the Titular property.</param> /// <param name="fechaCreacion">Initial value of the FechaCreacion property.</param> /// <param name="baja">Initial value of the Baja property.</param> /// <param name="comprobante">Initial value of the Comprobante property.</param> public static CuentaBancaria CreateCuentaBancaria(global::System.Int32 bancoId, global::System.Int32 cuentaId, global::System.String titular, global::System.DateTime fechaCreacion, global::System.Boolean baja, global::System.Boolean comprobante) { CuentaBancaria cuentaBancaria = new CuentaBancaria(); cuentaBancaria.BancoId = bancoId; cuentaBancaria.CuentaId = cuentaId; cuentaBancaria.Titular = titular; cuentaBancaria.FechaCreacion = fechaCreacion; cuentaBancaria.Baja = baja; cuentaBancaria.Comprobante = comprobante; return cuentaBancaria; }