public CategoriaController(Categoria categoria, CategoriaView categoriaView)
        {
            categoriaView.Nombre = categoria.Nombre;

            categoriaView.SaveActionDelegate = delegate {
                categoria.Nombre = categoriaView.Nombre;
                Categoria.Save(categoria);
            };
        }
Exemple #2
0
        public CategoriaController(Categoria categoria, CategoriaView categoriaView)
        {
            this.categoria = categoria;
            this.categoriaView = categoriaView;
            categoriaView.Nombre = categoria.Nombre;

            categoriaView.SaveAction.Activated += delegate{
                saveActionHandler ();
            };
        }
Exemple #3
0
        public CategoriaListView()
        {
            TreeViewHelper treeViewHelper = new TreeViewHelper(treeView, App.Instance.DbConnection, "select id, nombre from categoria");

            Gtk.Action refreshAction = new Gtk.Action("refreshAction", null, null, Stock.Refresh);
            refreshAction.Activated += delegate {
                treeViewHelper.Refresh ();
            };
            actionGroup.Add (refreshAction);

            Gtk.Action editAction = new Gtk.Action("editAction", null, null, Stock.Edit);
            editAction.Activated += delegate {
                Categoria categoria = Categoria.Load (treeViewHelper.Id);
                CategoriaView categoriaView = new CategoriaView();
                new CategoriaController(categoria,CategoriaView);
                categoriaView.Show();

            };
            actionGroup.Add (editAction);
        }