private void btnEliminar_Click(object sender, EventArgs e)
        {
            var rs = Delete();

            if (rs > 0)
            {
                Mensajes.EliminadoConExito();
            }
            else
            {
                Mensajes.OcurrioUnError();
            }
        }
        private async void btnEliminar_Click(object sender, EventArgs e)
        {
            var id = int.Parse(txtID.Text);

            if (id > 0)
            {
                var rs = await _controller.DeleteUsuarioAsync(id);

                if (rs > 0)
                {
                    Mensajes.EliminadoConExito();
                }
            }
        }
        private async void btnEliminar_Click(object sender, EventArgs e)
        {
            var id = int.Parse(txtID.Text);
            var rs = await _controller.DeleteProducto(id);

            if (rs > 0)
            {
                Mensajes.EliminadoConExito();
                mostrarDatos();
            }
            else
            {
                Mensajes.OcurrioUnError();
            }
        }
Example #4
0
        private async void btnCrear_Click(object sender, EventArgs e)
        {
            var nombre   = txtNombre.Text;
            var apellido = txtApellido.Text;
            var username = txtUsername.Text;

            if (string.IsNullOrEmpty(nombre))
            {
                Mensajes.EmptyFields();
                txtNombre.Focus();
            }
            else if (string.IsNullOrEmpty(apellido))
            {
                Mensajes.EmptyFields();
                txtApellido.Focus();
            }
            else if (string.IsNullOrEmpty(username) || string.IsNullOrWhiteSpace(username))
            {
                Mensajes.EmptyFields();
                txtUsername.Focus();
            }
            else
            {
                _usuario.nombre   = nombre;
                _usuario.apellido = apellido;
                _usuario.username = username;
                _usuario.pass     = Encriptar.encriptarPassword(nombre + apellido + "123");

                var rs = await _controller.AddUsuarioAsync(_usuario);

                if (rs > 0)
                {
                    Mensajes.AgregadoConExito();
                    limpiar();
                }
                else
                {
                    Mensajes.EliminadoConExito();
                }
            }
        }
        private async void button3_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrWhiteSpace(textBox1.Text))
            {
                Mensajes.EmptyFields();
            }
            else
            {
                var id  = int.Parse(textBox1.Text);
                var res = await _controller.DeleteTipoProducto(id);

                if (res > 0)
                {
                    Mensajes.EliminadoConExito();
                }
                else
                {
                    Mensajes.OcurrioUnError();
                }
            }
        }
Example #6
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrWhiteSpace(textBox1.Text))
            {
                Mensajes.EmptyFields();
            }
            else
            {
                var id  = Convert.ToInt32(textBox1.Text);
                var res = _controller.DeleteProveedor(id);

                if (res > 0)
                {
                    Mensajes.EliminadoConExito();
                }
                else
                {
                    Mensajes.OcurrioUnError();
                }
            }
        }