コード例 #1
0
        private async void CargarComboBanco()
        {
            try
            {
                List <BANCO> listaBanco;
                var          responseBanco = await servicio.BancoGetAllAsync();

                listaBanco          = responseBanco.Value;
                cboBanco.DataSource = listaBanco;

                BANCO banco = new BANCO
                {
                    Id_Banco = 0,
                    Nombre   = "--- Todos ---"
                };

                listaBanco.Insert(0, banco);
                cboBanco.DisplayMember = "Nombre";
                cboBanco.ValueMember   = "Id_Banco";
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocurrió un error " + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        public ActionResult FiltrarBanco(BANCO item)
        {
            try
            {
                // Executa a operação
                Int32        idAss    = (Int32)Session["IdAssinante"];
                List <BANCO> listaObj = new List <BANCO>();
                Int32        volta    = baseApp.ExecuteFilter(item.BANC_SG_CODIGO, item.BANC_NM_NOME, idAss, out listaObj);

                // Verifica retorno
                if (volta == 1)
                {
                    Session["MensBanco"] = 1;
                    ModelState.AddModelError("", OdontoWeb_Resources.ResourceManager.GetString("M0016", CultureInfo.CurrentCulture));
                    return(RedirectToAction("MontarTelaBanco"));
                }

                // Sucesso
                listaMasterBanco      = listaObj;
                Session["ListaBanco"] = listaObj;
                return(RedirectToAction("MontarTelaBanco"));
            }
            catch (Exception ex)
            {
                ViewBag.Message = ex.Message;
                return(RedirectToAction("MontarTelaBanco"));
            }
        }
コード例 #3
0
        private void dgvBanco_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int idBanco = Convert.ToInt32(dgvBanco.CurrentRow.Cells["Id_Banco"].Value);

            try
            {
                if (e.ColumnIndex == 1)
                {
                    BANCO       banco     = (BANCO)dgvBanco.CurrentRow.DataBoundItem;
                    EditarBanco formBanco = new EditarBanco(banco);
                    formBanco.ShowDialog();
                    CargarGrillaBanco();
                }
                else if (e.ColumnIndex == 2)
                {
                    if (servicio.BancoDelete(idBanco).IsValid)
                    {
                        MessageBox.Show("El banco se eliminó correctamente");
                        CargarGrillaBanco();
                    }
                    else
                    {
                        MessageBox.Show("Hubo inconvenientes al eliminar el banco, por favor intente nuevamente");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocurrió un error " + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        public void insertElement(object element, USUARIO u)
        {
            if (element != null)
            {
                using (var entity = new TAE2Entities())
                {
                    BANCO banco = (BANCO)element;

                    var validacion = (from cust in entity.BANCOes
                                      where cust.BANCO_NAME == banco.BANCO_NAME
                                      select cust).ToList();

                    if (validacion.Count == 0)
                    {
                        banco.UNID_BANCO = UNID.getNewUNID();
                        //Sync
                        banco.IS_MODIFIED        = true;
                        banco.LAST_MODIFIED_DATE = UNID.getNewUNID();
                        var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000);
                        modifiedSync.ACTUAL_DATE = UNID.getNewUNID();
                        entity.SaveChanges();
                        //
                        entity.BANCOes.AddObject(banco);
                        entity.SaveChanges();
                        //Master
                        UNID.Master(banco, u, -1, "Inserción");
                    }
                }
            }
        }
コード例 #5
0
        public void loadSync(object element)
        {
            if (element != null)
            {
                BANCO poco = (BANCO)element;
                using (var entity = new TAE2Entities())
                {
                    var query = (from cust in entity.BANCOes
                                 where poco.UNID_BANCO == cust.UNID_BANCO
                                 select cust).ToList();

                    //Actualización
                    if (query.Count > 0)
                    {
                        var aux = query.First();

                        if (aux.LAST_MODIFIED_DATE < poco.LAST_MODIFIED_DATE)
                        {
                            udpateElementSync((object)poco);
                        }
                    }
                    //Inserción
                    else
                    {
                        insertElementSync((object)poco);
                    }

                    var modifiedBanco = entity.BANCOes.First(p => p.UNID_BANCO == poco.UNID_BANCO);
                    modifiedBanco.IS_MODIFIED = false;
                    entity.SaveChanges();
                }
            }
        }
コード例 #6
0
 public DeleteBanco(BANCO banco)
 {
     this.UNID_BANCO = banco.UNID_BANCO;
     this.BANCO_NAME = banco.BANCO_NAME;
     this.IS_ACTIVE  = banco.IS_ACTIVE;
     this.IsChecked  = false;
 }
コード例 #7
0
 public CatalogBancoModel(IDataMapper dataMapper)
 {
     this._dataMapper    = new BancoDataMapper();
     this._banco         = new FixupCollection <DeleteBanco>();
     this._selectedBanco = new BANCO();
     this.loadBancos();
 }
コード例 #8
0
        public async Task <Response <BANCO> > BancoUpdateAsync(BANCO banco)
        {
            Response <BANCO> response = null;
            await Task.Run(() =>
            {
                response = bancoService.Update(banco);
            });

            return(response);
        }
コード例 #9
0
 public QUANLY()
 {
     //
     // TODO: Add constructor logic here
     //
     LuotDi         = -1;
     XiNgau         = -1;
     DangDoXiNgau   = false;
     BanCo          = new BANCO();
     m_arrNguoiChoi = new List <NGUOICHOI>();
     m_SoNguoiXem   = 0;
 }
コード例 #10
0
        public void Update(BANCO datos)
        {
            BaseRepository.dataBase.BANCOes.Attach(datos);
            var entry = BaseRepository.dataBase.Entry(datos);

            entry.State = EntityState.Modified;

            entry.Property(e => e.FechaCreacion).IsModified   = false;
            entry.Property(e => e.UsuarioCreacion).IsModified = false;

            BaseRepository.dataBase.SaveChanges();
        }
コード例 #11
0
        public List <BANCO> Listar()
        {
            List <BANCO> listaBanco = bancoRepository.GetAll().ToList();
            BANCO        obj        = new BANCO()
            {
                Id_Banco = 0,
                Nombre   = "Seleccione banco"
            };

            listaBanco.Insert(0, obj);
            return(listaBanco);
        }
コード例 #12
0
        public ActionResult MontarTelaBanco()
        {
            // Verifica se tem usuario logado
            if ((String)Session["Ativa"] == null)
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            Int32   idAss   = (Int32)Session["IdAssinante"];
            USUARIO usuario = new USUARIO();

            if ((USUARIO)Session["UserCredentials"] != null)
            {
                usuario = (USUARIO)Session["UserCredentials"];
            }
            else
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }

            // Carrega listas
            if (Session["ListaBanco"] == null)
            {
                listaMasterBanco      = baseApp.GetAllItens(idAss);
                Session["ListaBanco"] = listaMasterBanco;
            }
            ViewBag.Listas = (List <BANCO>)Session["ListaBanco"];
            ViewBag.Title  = "Bancos";

            // Indicadores
            ViewBag.Bancos = ((List <BANCO>)Session["ListaBanco"]).Count;
            ViewBag.Contas = contaApp.GetAllItens(idAss).Count;
            ViewBag.Perfil = usuario.PERFIL.PERF_SG_SIGLA;

            // Mensagem
            if ((Int32)Session["MensBanco"] == 1)
            {
                ModelState.AddModelError("", OdontoWeb_Resources.ResourceManager.GetString("M0016", CultureInfo.CurrentCulture));
            }
            if ((Int32)Session["MensBanco"] == 2)
            {
                ModelState.AddModelError("", OdontoWeb_Resources.ResourceManager.GetString("M0011", CultureInfo.CurrentCulture));
            }
            if ((Int32)Session["MensBanco"] == 4)
            {
                ModelState.AddModelError("", OdontoWeb_Resources.ResourceManager.GetString("M0039", CultureInfo.CurrentCulture));
            }

            // Abre view
            Session["MensBanco"] = 0;
            objetoBanco          = new BANCO();
            return(View(objetoBanco));
        }
コード例 #13
0
 public DeleteProveedorCuenta(PROVEEDOR_CUENTA proveedorCuenta)
 {
     this.UNID_PROVEEDOR_CUENTA = proveedorCuenta.UNID_PROVEEDOR_CUENTA;
     this.UNID_BANCO            = proveedorCuenta.UNID_BANCO;
     this.UNID_PROVEEDOR        = proveedorCuenta.UNID_PROVEEDOR;
     this.NUMERO_CUENTA         = proveedorCuenta.NUMERO_CUENTA;
     this.CLABE        = proveedorCuenta.CLABE;
     this.BENEFICIARIO = proveedorCuenta.BENEFICIARIO;
     this._banco       = proveedorCuenta.BANCO;
     this._proveedor   = proveedorCuenta.PROVEEDOR;
     this.IS_ACTIVE    = proveedorCuenta.IS_ACTIVE;
     this.IsChecked    = false;
 }
コード例 #14
0
 public ProgramadoresController()
 {
     this.EstadosRep                   = new EstadosRepository();
     this.HorariosRep                  = new HorariosRepository();
     this.ListaDeHorarios              = new List <HORARIOS>();
     this.ProgramadoresRep             = new ProgramadoresRepository();
     this.banco                        = new BANCO();
     this.BancosRep                    = new BancosRepository();
     this.conta                        = new CONTAS_BANCARIAS();
     this.horarios                     = new HORARIOS();
     this.horarios.ListaDeHorarios     = new List <HORARIOS>();
     this.TecnologiasRep               = new TecnologiasRepository();
     this.NivelConhecimentoTecnologias = new NIVEL_DE_CONHECIMENTO();
     this.NivelConhecimentoTecnologias.ListaDeNiveisDeConhecimento = new List <NIVEL_DE_CONHECIMENTO>();
 }
コード例 #15
0
        public void udpateElementTest()
        {
            BancoDataMapper target    = new BancoDataMapper(); // TODO: Inicializar en un valor adecuado
            object          element   = null;                  // TODO: Inicializar en un valor adecuado
            BANCO           testBanco = new BANCO();

            testBanco.UNID_BANCO = 0;
            testBanco.BANCO_NAME = "IXE";
            element = testBanco;
            target.udpateElement(element);
            object actual;

            actual = target.getElement(element);
            Assert.Inconclusive("Un método que no devuelve ningún valor no se puede comprobar.");
        }
コード例 #16
0
        public ActionResult EditarBanco(Int32 id)
        {
            // Verifica se tem usuario logado
            USUARIO usuario = new USUARIO();

            if ((String)Session["Ativa"] == null)
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            if ((USUARIO)Session["UserCredentials"] != null)
            {
                usuario = (USUARIO)Session["UserCredentials"];

                // Verfifica permissão
                if (usuario.PERFIL.PERF_SG_SIGLA != "ADM")
                {
                    Session["MensBanco"] = 2;
                    return(RedirectToAction("MontarTelaBanco", "Banco"));
                }
            }
            else
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            Int32 idAss = (Int32)Session["IdAssinante"];

            // Mensagem
            if ((Int32)Session["MensBanco"] == 2)
            {
                ModelState.AddModelError("", OdontoWeb_Resources.ResourceManager.GetString("M0011", CultureInfo.CurrentCulture));
            }
            if ((Int32)Session["MensBanco"] == 6)
            {
                ModelState.AddModelError("", OdontoWeb_Resources.ResourceManager.GetString("M0041", CultureInfo.CurrentCulture));
            }

            // Prepara view
            ViewBag.Filiais = new SelectList(filApp.GetAllItens(idAss), "FILI_CD_ID", "FILI_NM_NOME");
            BANCO item = baseApp.GetItemById(id);

            objetoBancoAntes   = item;
            Session["IdBanco"] = id;
            Session["Banco"]   = item;
            BancoViewModel vm = Mapper.Map <BANCO, BancoViewModel>(item);

            return(View(vm));
        }
コード例 #17
0
        public object getElement(object element)
        {
            object res = null;

            using (var entitie = new TAE2Entities())
            {
                BANCO banco = (BANCO)element;
                var   query = (from cust in entitie.BANCOes
                               where cust.UNID_BANCO == banco.UNID_BANCO
                               select cust).ToList();
                if (query.Count > 0)
                {
                    res = query;
                }
                return(res);
            }
        }
コード例 #18
0
        public ActionResult ExcluirBanco(Int32 id)
        {
            // Verifica se tem usuario logado
            USUARIO usuario = new USUARIO();

            if ((String)Session["Ativa"] == null)
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            if ((USUARIO)Session["UserCredentials"] != null)
            {
                usuario = (USUARIO)Session["UserCredentials"];

                // Verfifica permissão
                if (usuario.PERFIL.PERF_SG_SIGLA != "ADM")
                {
                    Session["MensBanco"] = 2;
                    return(RedirectToAction("MontarTelaBanco", "Banco"));
                }
            }
            else
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            Int32 idAss = (Int32)Session["IdAssinante"];

            // Executar
            BANCO item = baseApp.GetItemById(id);

            objetoBancoAntes   = (BANCO)Session["Banco"];
            item.BANC_IN_ATIVO = 0;
            item.ASSINANTE     = null;
            Int32 volta = baseApp.ValidateDelete(item, usuario);

            if (volta == 1)
            {
                Session["MensBanco"] = 4;
                ModelState.AddModelError("", OdontoWeb_Resources.ResourceManager.GetString("M0039", CultureInfo.CurrentCulture));
                return(RedirectToAction("MontarTelaBanco"));
            }
            listaMasterBanco      = new List <BANCO>();
            Session["ListaBanco"] = null;
            return(RedirectToAction("MontarTelaBanco"));
        }
コード例 #19
0
        public void insertElementSync(object element)
        {
            if (element != null)
            {
                using (var entity = new TAE2Entities())
                {
                    BANCO banco = (BANCO)element;

                    //Sync

                    var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000);
                    modifiedSync.ACTUAL_DATE = UNID.getNewUNID();
                    entity.SaveChanges();
                    //
                    entity.BANCOes.AddObject(banco);
                    entity.SaveChanges();
                }
            }
        }
コード例 #20
0
        public ActionResult IncluirConta()
        {
            // Verifica se tem usuario logado
            USUARIO usuario = new USUARIO();

            if ((String)Session["Ativa"] == null)
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            if ((USUARIO)Session["UserCredentials"] != null)
            {
                usuario = (USUARIO)Session["UserCredentials"];

                // Verfifica permissão
                if (usuario.PERFIL.PERF_SG_SIGLA != "ADM")
                {
                    Session["MensBanco"] = 2;
                    return(RedirectToAction("CarregarBase", "BaseAdmin"));
                }
            }
            else
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            Int32 idAss = (Int32)Session["IdAssinante"];
            BANCO banco = (BANCO)Session["Banco"];

            // Prepara listas
            ViewBag.Tipos   = new SelectList(tcApp.GetAllItens(), "TICO_CD_ID", "TICO_NM_NOME");
            ViewBag.Filiais = new SelectList(filApp.GetAllItens(idAss), "FILI_CD_ID", "FILI_NM_NOME");
            ViewBag.Banco   = banco.BANC_NM_NOME;

            // Prepara view
            CONTA_BANCO            item = new CONTA_BANCO();
            ContaBancariaViewModel vm   = Mapper.Map <CONTA_BANCO, ContaBancariaViewModel>(item);

            vm.BANC_CD_ID            = banco.BANC_CD_ID;
            vm.ASSI_CD_ID            = usuario.ASSI_CD_ID;
            vm.COBA_DT_ABERTURA      = DateTime.Today.Date;
            vm.COBA_VL_SALDO_INICIAL = 0;
            vm.COBA_IN_ATIVO         = 1;
            return(View(vm));
        }
コード例 #21
0
 public void udpateElementSync(object element)
 {
     if (element != null)
     {
         using (var entity = new TAE2Entities())
         {
             BANCO banco         = (BANCO)element;
             var   modifiedBanco = entity.BANCOes.First(p => p.UNID_BANCO == banco.UNID_BANCO);
             modifiedBanco.BANCO_NAME = banco.BANCO_NAME;
             modifiedBanco.IS_ACTIVE  = banco.IS_ACTIVE;
             //Sync
             modifiedBanco.IS_MODIFIED        = true;
             modifiedBanco.LAST_MODIFIED_DATE = UNID.getNewUNID();
             var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000);
             modifiedSync.ACTUAL_DATE = UNID.getNewUNID();
             entity.SaveChanges();
             //
         }
     }
 }
コード例 #22
0
        public Response <BANCO> Delete(int id)
        {
            Response <BANCO> response = new Response <BANCO>();

            try
            {
                BANCO banco = bancoRepository.GetById(id);
                if (banco == null)
                {
                    return(response.Error("Banco no encontrado"));
                }
                banco.Estado = "I";
                Update(banco);
                return(response);
            }
            catch (Exception e)
            {
                return(response.Error(e.Message));
            }
        }
コード例 #23
0
 public void deleteElement(object element, USUARIO u)
 {
     if (element != null)
     {
         using (var entity = new TAE2Entities())
         {
             BANCO banco         = (BANCO)element;
             var   modifiedBanco = entity.BANCOes.First(p => p.UNID_BANCO == banco.UNID_BANCO);
             modifiedBanco.IS_ACTIVE = false;
             //Sync
             modifiedBanco.IS_MODIFIED        = true;
             modifiedBanco.LAST_MODIFIED_DATE = UNID.getNewUNID();
             var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000);
             modifiedSync.ACTUAL_DATE = UNID.getNewUNID();
             entity.SaveChanges();
             //Master
             UNID.Master(banco, u, -1, "Emininación");
         }
     }
 }
コード例 #24
0
        public ActionResult IncluirBanco(BancoViewModel vm)
        {
            Int32 idAss = (Int32)Session["IdAssinante"];

            ViewBag.Filiais = new SelectList(filApp.GetAllItens(idAss), "FILI_CD_ID", "FILI_NM_NOME");
            if (ModelState.IsValid)
            {
                try
                {
                    // Executa a operação
                    BANCO   item          = Mapper.Map <BancoViewModel, BANCO>(vm);
                    USUARIO usuarioLogado = (USUARIO)Session["UserCredentials"];
                    Int32   volta         = baseApp.ValidateCreate(item, usuarioLogado);

                    // Verifica retorno
                    if (volta == 1)
                    {
                        Session["MensBanco"] = 3;
                        ModelState.AddModelError("", OdontoWeb_Resources.ResourceManager.GetString("M0038", CultureInfo.CurrentCulture));
                        return(View(vm));
                    }

                    // Sucesso
                    Session["Banco"]      = item;
                    listaMasterBanco      = new List <BANCO>();
                    Session["ListaBanco"] = null;
                    Session["VoltaConta"] = 1;
                    Session["IdBanco"]    = item.BANC_CD_ID;
                    return(RedirectToAction("IncluirConta"));
                }
                catch (Exception ex)
                {
                    ViewBag.Message = ex.Message;
                    return(View(vm));
                }
            }
            else
            {
                return(View(vm));
            }
        }
コード例 #25
0
        public Response <BANCO> GetById(int id)
        {
            Response <BANCO> response = new Response <BANCO>();

            try
            {
                BANCO banco = bancoRepository.GetById(id);

                if (banco == null)
                {
                    return(response.Error("Banco no encontrada"));
                }

                response.Value = banco;
                return(response);
            }
            catch (Exception e)
            {
                return(response.Error(e.Message));
            }
        }
コード例 #26
0
ファイル: BancoController.cs プロジェクト: dungeon2567/ATIMO
        public ActionResult ConfirmarEdit(BANCO banco)
        {
            #region Validações

            if (string.IsNullOrEmpty(banco.CODIGO))
            {
                return(Json(new { status = 100, ex = "Informe um código!" }));
            }

            if (string.IsNullOrEmpty(banco.DESCRICAO))
            {
                return(Json(new { status = 100, ex = "Informe uma descrição!" }));
            }

            if (string.IsNullOrEmpty(banco.SITUACAO))
            {
                return(Json(new { status = 100, ex = "Informe uma situação!" }));
            }

            #endregion

            #region Alterar Banco

            if (!string.IsNullOrEmpty(banco.CODIGO))
            {
                banco.CODIGO = banco.CODIGO.ToUpper();
            }

            if (!string.IsNullOrEmpty(banco.DESCRICAO))
            {
                banco.DESCRICAO = banco.DESCRICAO.ToUpper();
            }

            _db.Entry(banco).State = EntityState.Modified;
            _db.SaveChanges();

            #endregion

            return(Json(new { status = 200, msg = "Alterado com sucesso!" }));
        }
コード例 #27
0
ファイル: BancoController.cs プロジェクト: dungeon2567/ATIMO
        public ActionResult ConfirmarCreate(BANCO banco)
        {
            #region Validações

            if (string.IsNullOrEmpty(banco.CODIGO))
            {
                return(Json(new { status = 100, ex = "Informe um código!" }));
            }

            if (string.IsNullOrEmpty(banco.DESCRICAO))
            {
                return(Json(new { status = 100, ex = "Informe uma descrição!" }));
            }

            if (string.IsNullOrEmpty(banco.SITUACAO))
            {
                return(Json(new { status = 100, ex = "Informe uma situação!" }));
            }

            #endregion

            #region Incluir Banco

            if (!string.IsNullOrEmpty(banco.CODIGO))
            {
                banco.CODIGO = banco.CODIGO.ToUpper();
            }

            if (!string.IsNullOrEmpty(banco.DESCRICAO))
            {
                banco.DESCRICAO = banco.DESCRICAO.ToUpper();
            }

            _db.BANCO.Add(banco);
            _db.SaveChanges();

            #endregion

            return(Json(new { status = 200, msg = "Incluído com sucesso!" }));
        }
コード例 #28
0
        public ActionResult ReativarBanco(Int32 id)
        {
            // Verifica se tem usuario logado
            USUARIO usuario = new USUARIO();

            if ((String)Session["Ativa"] == null)
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            if ((USUARIO)Session["UserCredentials"] != null)
            {
                usuario = (USUARIO)Session["UserCredentials"];

                // Verfifica permissão
                if (usuario.PERFIL.PERF_SG_SIGLA != "ADM")
                {
                    Session["MensBanco"] = 2;
                    return(RedirectToAction("MontarTelaBanco", "Banco"));
                }
            }
            else
            {
                return(RedirectToAction("Login", "ControleAcesso"));
            }
            Int32 idAss = (Int32)Session["IdAssinante"];

            // Executar
            BANCO item = baseApp.GetItemById(id);

            objetoBancoAntes   = (BANCO)Session["Banco"];
            item.BANC_IN_ATIVO = 1;
            item.ASSINANTE     = null;
            Int32 volta = baseApp.ValidateReativar(item, usuario);

            listaMasterBanco      = new List <BANCO>();
            Session["ListaBanco"] = null;
            return(RedirectToAction("MontarTelaBanco"));
        }
コード例 #29
0
        private void creaBanco()
        {
            if (ValidarCampo())
            {
                try
                {
                    BANCO objBanco = new BANCO()
                    {
                        Nombre              = txtBanco.Text.ToString().ToUpper().Trim(),
                        UsuarioCreacion     = Session.CurrentSession.Usuario.Usuario1,
                        FechaCreacion       = DateTime.Now,
                        UsuarioModificacion = Session.CurrentSession.Usuario.Usuario1,
                        FechaModificacion   = DateTime.Now,
                        Estado              = "A"
                    };

                    var response = servicio.BancoInsert(objBanco);

                    if (response.IsValid)
                    {
                        MessageBox.Show("Proceso realizado correctamente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show(response.ErrorMensaje, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Ocurrió un error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Completar todos los campos", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #30
0
        public Response <BANCO> Update(BANCO datos)
        {
            Response <BANCO> response = new Response <BANCO>();

            try
            {
                if (datos.Nombre.IsNullOrEmpty())
                {
                    return(response.Error("El nombre es obligatorio"));
                }
                if (datos.Estado.IsNullOrEmpty())
                {
                    return(response.Error("El estado es obligatorio"));
                }
                datos.FechaModificacion = BaseRepository.GetServerDateTime();
                bancoRepository.Update(datos);
                return(response);
            }
            catch (Exception e)
            {
                return(response.Error(e.Message));
            }
        }