Esempio n. 1
0
        public MainView(Personne man)
            : base(Gtk.WindowType.Toplevel)
        {
            employe.id = man.id;
            employe.prenom = man.prenom;
            employe.nom = man.nom;
            employe.login = man.login;
            employe.password = man.password;
            employe.idPoste = man.idPoste;

            this.Build ();
            // affiche le nom et prénom de la personne connecté dans la Status bar
            labelSessionPersonne.Text = man.prenom + " " + man.nom;
            labelDateDuJour.Text = DateTime.Now.ToString ("dd/MM/yyyy");

            List<Operation> operations = ConnectionBdd.getOperationsFromIdPoste (man.idPoste);
            foreach (Operation operation in operations) {
                action = new Gtk.Button ();
                actions.Add (action);
                Label labelOperation = new Label ();
                NodeView nodeViewOperation = new NodeView ();
                VBox vbox54 = new VBox ();
                HBox hbox54 = new HBox ();
                Fixed boucheTrou = new Fixed ();

                nodeViewOperation.AppendColumn ("Date et Heure", new Gtk.CellRendererText (), "text", 0);
                nodeViewOperation.AppendColumn ("Numero Traçabilité", new Gtk.CellRendererText (), "text", 1);
                nodeViewOperation.AppendColumn ("Prenom", new Gtk.CellRendererText (), "text", 2);
                nodeViewOperation.AppendColumn ("Nom", new Gtk.CellRendererText (), "text", 3);
                nodeViewOperation.AppendColumn ("Dernière Operation", new Gtk.CellRendererText (), "text", 4);
                nodeViewOperation.AppendColumn ("Numero Fiche", new Gtk.CellRendererText (), "text", 5);
                nodeViewOperation.AppendColumn ("Numero Operation", new Gtk.CellRendererText (), "text", 6);

                nodeViewOperation.NodeStore = ConnectionBdd.getFicheNodeStoreFromIdOperation (operation.id);

                labelOperation.Name = operation.libelleOperation;
                labelOperation.LabelProp = operation.libelleOperation.ToUpper ();
                notebookOperation.Add (vbox54);
                notebookOperation.SetTabLabel (vbox54, labelOperation);
                action.Label = operation.libelleAction;
                action.Name = operation.id.ToString ();
                action.Sensitive = false;

                if (operation.ordre == 1) {
                    vbox54.Add (hbox54);
                    hbox54.Add (action);
                    Box.BoxChild v1 = (Box.BoxChild)vbox54 [hbox54];
                    v1.Fill = false;
                    Box.BoxChild h1 = (Box.BoxChild)hbox54 [action];
                    h1.Fill = false;
                    action.WidthRequest = 200;
                    action.HeightRequest = 80;

                } else {
                    vbox54.Add (nodeViewOperation);
                    vbox54.Add (hbox54);
                    hbox54.Add (boucheTrou);
                    hbox54.Add (action);
                    Box.BoxChild v2 = (Box.BoxChild)vbox54 [hbox54];
                    v2.Expand = false;
                    v2.Padding = 5;
                    Box.BoxChild h1 = (Box.BoxChild)hbox54 [boucheTrou];
                    h1.Position = 0;
                    Box.BoxChild h2 = (Box.BoxChild)hbox54 [action];
                    h2.Position = 1;
                    h2.Expand = false;

                }

                action.Clicked += delegate (object sender, EventArgs e) {
                    Button btn = (Gtk.Button)sender;
                    FicheView ficheView = new FicheView (ConnectionBdd.getOperation (btn.Name));
                    ficheView.ShowAll ();
                    ficheView.init ();
                };

                nodeViewOperation.NodeSelection.Changed += nodeSelectedChange;

            }
        }
Esempio n. 2
0
 protected void OnActionBtnClicked(object sender, EventArgs e)
 {
     FicheView ficheView = new FicheView ();
     ficheView.ShowAll ();
     ficheView.init ();
 }