public ActionResult DatosBancariosEdit(CuentaBancariasProveedorAlmacenModels IDCuentaBancoP)
        {
            _CatProveedorAlmacen_Datos ProveedorDatos = new _CatProveedorAlmacen_Datos();

            try
            {
                if (Token.IsTokenValid())
                {
                    if (ModelState.IsValid)
                    {
                        IDCuentaBancoP.Conexion = Conexion;
                        IDCuentaBancoP.Usuario  = User.Identity.Name;
                        IDCuentaBancoP.Opcion   = 2;
                        ProveedorDatos.ACDatosBancariosProveedorAlmacen(IDCuentaBancoP);
                        if (IDCuentaBancoP.Completado == true)
                        {
                            TempData["typemessage"] = "1";
                            TempData["message"]     = "Los datos se guardaron correctamente.";
                            Token.ResetToken();
                            return(RedirectToAction("DatosBancarios", new { id = IDCuentaBancoP.IDProveedorAlmacen }));
                        }
                        else
                        {
                            IDCuentaBancoP.ListaCmbBancos = ProveedorDatos.ObteneComboCatBancos(IDCuentaBancoP);
                            TempData["typemessage"]       = "2";
                            TempData["message"]           = "Ocurrió un error al intentar guardar los datos. Intente más tarde.";
                            return(View(IDCuentaBancoP));
                        }
                    }
                    else
                    {
                        IDCuentaBancoP.Conexion       = Conexion;
                        IDCuentaBancoP.ListaCmbBancos = ProveedorDatos.ObteneComboCatBancos(IDCuentaBancoP);
                        return(View(IDCuentaBancoP));
                    }
                }
                else
                {
                    return(RedirectToAction("DatosBancarios", new { id = IDCuentaBancoP.IDProveedorAlmacen }));
                }
            }
            catch (Exception)
            {
                IDCuentaBancoP.Conexion       = Conexion;
                IDCuentaBancoP.ListaCmbBancos = ProveedorDatos.ObteneComboCatBancos(IDCuentaBancoP);
                TempData["typemessage"]       = "2";
                TempData["message"]           = "Ocurrio un error al intentar guardar los datos. Contacte a soporte técnico.";
                return(View(IDCuentaBancoP));
            }
        }
 public ActionResult DatosBancariosCreate(string id)
 {
     try
     {
         Token.SaveToken();
         CuentaBancariasProveedorAlmacenModels Cuenta         = new CuentaBancariasProveedorAlmacenModels();
         _CatProveedorAlmacen_Datos            ProveedorDatos = new _CatProveedorAlmacen_Datos();
         Cuenta.IDProveedorAlmacen = id;
         Cuenta.Conexion           = Conexion;
         Cuenta.ListaCmbBancos     = ProveedorDatos.ObteneComboCatBancos(Cuenta);
         return(View(Cuenta));
     }
     catch (Exception)
     {
         CuentaBancariasProveedorAlmacenModels Cuenta = new CuentaBancariasProveedorAlmacenModels();
         Cuenta.IDProveedorAlmacen = id;
         TempData["typemessage"]   = "2";
         TempData["message"]       = "No se puede cargar la vista";
         return(View(Cuenta));
         //return RedirectToAction("DatosBancarios", new { id = Cuenta.IDProveedorAlmacen });
     }
 }