Ejemplo n.º 1
0
        /////////////////////////////////////////////////////////////////////////////
        ///<summary>
        /// On button clicked from the main left-down panel
        ///</summary>
        void OnBtnClicked(object o, EventArgs e)
        {
            string element = ((Gtk.Button)o).Name;

            labelModName.Text = ((Gtk.Button)o).Label ;

            // Empty module container (right)
            if (modContainerHbox.Children.Length > 0)
                modContainerHbox.Remove(modContainerHbox.Children[0]);
            try
            {
               	// Get treeview columns from xml
                ArrayList columns = new ArrayList();
                Column col;

                nodeSelectedTreevwModule = null;
                XmlNodeList childs = nodeTreeview.ChildNodes;
                foreach (XmlNode node in childs)
                {
                    if (node.Name == "column")
                    {
                        col.type = node.Attributes["value"].Value;
                        col.view = bool.Parse(node.Attributes["visible"].Value);
                        col.name = node.Attributes["name"].Value;
                        columns.Add(col);
                    }
                    else
                        if (node.Name == "module")
                            if (node.Attributes["name"].Value.ToUpper() == element.ToUpper())
                                nodeSelectedTreevwModule = node;
                }

                // Clean treeview before load new data
                GuiTreeview.RemoveColumns(treevwModule);
                // Create a new treeview
                GuiTreeview gui_tvw = new GuiTreeview();
                gui_tvw.NewTreeView (columns, ref treevwModule);
                // Load data
                if (nodeSelectedTreevwModule != null)
                    gui_tvw.BuildTree(nodeSelectedTreevwModule, TreeIter.Zero);
            }
            catch (ArgumentNullException ex)
            {
                new PermissionException();
            //	throw ex;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error:{0}", ex);
                //throw ex;
            }
        }
Ejemplo n.º 2
0
 /////////////////////////////////////////////////////////////////////////////
 ///<summary>
 ///Load data widgets from server; Fill combos and so on.
 ///</summary>
 public override void SetWidgetsData()
 {
     try
     {
         DataSet ds = adminFacade.GetEnterprisesList(sid, 0,0);
         GuiTreeview guiTvw = new GuiTreeview();
         guiTvw.StoreDataSet(ds, ref treevwEnterprises);
     }
     catch (Exception ex)
     {
         ClientMessages.ShowException(ex);
     }
 }
Ejemplo n.º 3
0
        /////////////////////////////////////////////////////////////////////////////
        void OnTreevwGroupsCursorChanged(object o, EventArgs e)
        {
            TreeModel model;                    //Datos del treeview
            TreeIter iter;                      //Fila seleccionada del treeview
            int groupId = 0;
            try
            {
                if (treevwGroups.Selection.GetSelected (out model, out iter))
                {
                    groupId = int.Parse((string) treevwGroups.Model.GetValue (iter, 0));
                }

                DataSet ds = adminFacade.GetUsersList(sid, groupId, 0, 0);
                GuiTreeview guiTvw = new GuiTreeview();
                guiTvw.StoreDataSet(ds, ref treevwUsers);
            }
            catch (Exception ex)
            {
                ClientMessages.ShowException(ex);
            }
        }
Ejemplo n.º 4
0
        /////////////////////////////////////////////////////////////////////////////////
        void OnTreevwEnterprisesCursorChanged(object o, EventArgs e)
        {
            try
            {
                TreeModel model;                    //Datos del treeview
                TreeIter iter;                      //Fila seleccionada del treeview
                int epriseId = 0;

                GuiTreeview.RemoveColumns(treevwGroups);
             				if (treevwEnterprises.Selection.GetSelected (out model, out iter))
                {
                    epriseId = int.Parse((string) treevwEnterprises.Model.GetValue (iter, 0));
                }
                DataSet ds = adminFacade.GetGroupsListById(sid, epriseId, 0, 0);
                GuiTreeview guiTvw = new GuiTreeview();
                guiTvw.StoreDataSet(ds, ref treevwGroups);
            }
            catch (Exception ex)
            {
                ClientMessages.ShowException(ex);
            }
        }
Ejemplo n.º 5
0
        /////////////////////////////////////////////////////////////////////////////
        void OnCombobEprisesChanged(object o, EventArgs e)
        {
            try
            {
                GuiTreeview.RemoveColumns(treevwUsers);
                GuiTreeview.RemoveColumns(treevwGroups);
                ComboBox combob = (ComboBox) o;
                TreeIter iter;
                string epriseName = "";
                if (combob.GetActiveIter (out iter))
                    epriseName = (string) combob.Model.GetValue (iter, 0);
                DataSet ds = adminFacade.GetIconGroupsList(sid, epriseName, 0, 0);

                XmlDocument doc = new XmlDocument();
                doc.Load(Boxerp.Defines.GUI_DIR + "treeviews.xml");
                XmlNodeList xmlNode = doc.GetElementsByTagName("groups");

                GuiTreeview guiTvw = new GuiTreeview();
                guiTvw.StoreDataSet(ds, xmlNode.Item(0), ref treevwGroups);
                GuiTreeview.RemoveColumns(treevwUsers);
            }
            catch (Exception ex)
            {
                ClientMessages.ShowException(ex);
            }
        }