Пример #1
0
        protected void GuardarButton_Click(object sender, EventArgs e)
        {
            Ventas    ven = new Ventas();
            Articulos ar  = new Articulos();

            if (DetalleGridView.Rows.Count == 0)
            {
                Utilitarios.ShowToastr(this, "Error", "Mensaje", "error");
            }
            else
            {
                ObtenerDatos(ven, ar);
                ar.AfectarExistencia();
                if (string.IsNullOrWhiteSpace(BuscarTextBox.Text))
                {
                    if (ven.Insertar())
                    {
                    }
                }
                else
                {
                    if (ven.Actualizar())
                    {
                    }
                }
                Utilitarios.ShowToastr(this, "Guardado", "Mensaje", "success");
            }
        }