Exemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();

            // TODO: Add constructor code after the InitializeComponent() call.
            dataManager = DataManager.Singleton;
            dataManager.Initialize();

            headers = new ColumnHeaders();
            headers.Read();

            fixtures = new FieldFixtures();
            fixtures.Read();

            columnSelectionForm = new ColumnSelectionForm(headers, dataManager);

            personelGridView.AutoGenerateColumns = false;

            foreach(string colName in headers.headers.Keys)
            {
                int colidx = personelGridView.Columns.Add(colName, headers.Get(colName));
                personelGridView.Columns[colidx].DataPropertyName = colName;
                personelGridView.Columns[colidx].SortMode = DataGridViewColumnSortMode.Automatic;
            }

            SyncVisibleColumns();

            List<SoldierRecord> soldierList = dataManager.ReadSoldiers();
            soldiersBindingList = new SortableBindingList<SoldierRecord>(soldierList);
            bindingSource1.DataSource = soldiersBindingList;
        }
Exemplo n.º 2
0
        public SoldierDetailsForm(SoldierRecord soldier, FieldFixtures fixtures)
        {
            // The InitializeComponent() call is required for Windows Forms designer support.
            InitializeComponent();

            // TODO: Add constructor code after the InitializeComponent() call.
            //
            RecIdValueLabel.DataBindings.Add(new Binding("Text", soldier, "Id") );
            OnomaTextBox.DataBindings.Add(new Binding("Text", soldier, "Onoma") );
            EpithetoTextBox.DataBindings.Add(new Binding("Text", soldier, "Epitheto") );
            ASMTextBox.DataBindings.Add(new Binding("Text", soldier, "Asm") );
            KlasiTextBox.DataBindings.Add(new Binding("Text", soldier, "Klasi") );
            SeiraTextBox.DataBindings.Add(new Binding("Text", soldier, "Seira") );
            PolitikiTaytotitaTextBox.DataBindings.Add(new Binding("Text", soldier, "ArithmosPolitikisTaytotitas") );
            ImerominiaGeniseosDateTimePicker.DataBindings.Add(new Binding("Text", soldier, "ImerominiaGenniseos") );

            BathmosComboBox.DataSource = fixtures.Get("Bathmos");
            BathmosComboBox.DataBindings.Add( new Binding("Text", soldier, "Bathmos"));
            IdikotitaComboBox.DataSource = fixtures.Get("Idikotita");
            IdikotitaComboBox.DataBindings.Add( new Binding("Text", soldier, "Idikotita"));
            IneEfedrosComboBox.DataSource = fixtures.Get("IneEfedros");
            IneEfedrosComboBox.DataBindings.Add( new Binding("Text", soldier, "EinaiEfedros"));

            TilefonoOikiasTextBox.DataBindings.Add(new Binding("Text", soldier, "Til_oikias") );
            TilefonoErgasiasTextBox.DataBindings.Add(new Binding("Text", soldier, "Til_ergasias") );
            TilefonoKinitoTextBox.DataBindings.Add(new Binding("Text", soldier, "Til_kinito") );
            DieythinsiSpitiouTextBox.DataBindings.Add(new Binding("Text", soldier, "DieythinsiSpitiou") );
            DieythinsiErgasiasTextBox.DataBindings.Add(new Binding("Text", soldier, "DieythinsiErgasias") );

            Group1TextBox.DataBindings.Add( new Binding("Text",soldier, "Group1") );
            Group2TextBox.DataBindings.Add( new Binding("Text",soldier, "Group2") );
            Group3TextBox.DataBindings.Add( new Binding("Text",soldier, "Group3") );
            Group4TextBox.DataBindings.Add( new Binding("Text",soldier, "Group4") );
            Group5TextBox.DataBindings.Add( new Binding("Text",soldier, "Group5") );
            KathikontaTextBox.DataBindings.Add( new Binding("Text",soldier, "Kathikonta") );

            ArithmosOplouTextBox.DataBindings.Add(new Binding("Text", soldier, "ArithmosOplou") );
            ArithmosKsifologxisTextBox.DataBindings.Add(new Binding("Text", soldier, "ArithmosXyfoloxis") );
            AllosOplismosTextBox.DataBindings.Add(new Binding("Text", soldier, "AllosOplismos") );

            SxoliaTextBox.DataBindings.Add(new Binding("Text", soldier, "Sxolia") );
            LoipaStoixiaTextBox.DataBindings.Add(new Binding("Text", soldier, "LoipaStoixia") );
            CreationDateTextBox.DataBindings.Add(new Binding("Text", soldier, "CreationDate") );
            LastUpdateDateTextBox.DataBindings.Add(new Binding("Text", soldier, "LastUpdateDate") );
        }