Ejemplo n.º 1
0
        private void Add_Button_Click(object sender, EventArgs e)
        {
            //czysci porjekty przy zamknieciu okienka
            //spr null tag
            //albo chowaj przy nie obslugiwanych
            //rozszerza się na role tak czy tak
            var curtab = tabControl.SelectedTab;
            //char tabtag = Convert.ToChar(curtab.Tag);
            TabTagData tabtabtag = curtab.Tag as TabTagData;
            //null check
            char tabtag = tabtabtag.Mode;
            int? optID  = tabtabtag.optionalID;

            switch (tabtag)
            {
            case 'u': UserForm newUserForm = new UserForm(); newUserForm.ShowDialog(); break;

            case 'r': RoleForm newRoleForm = new RoleForm(); newRoleForm.ShowDialog(); break;

            case 'p': ProjectForm newProjectForm = new ProjectForm(); newProjectForm.ShowDialog(); break;

            case 's': SprintForm newSprintForm = new SprintForm(optID); newSprintForm.ShowDialog(); break;

            case 'f': PhaseForm newPhaseForm = new PhaseForm(); newPhaseForm.ShowDialog(); break;

            case 't': TaskForm newTaskForm = new TaskForm(optID); newTaskForm.ShowDialog(); break;
            }
            //curtab.Controls.Remove;
            //coś tutaj spr
            //dataTable.TableDataMode = tabtag; //czy potrzeba?

            //pozostalosc ostatniego
            //nie działa
            //dataTable.RefreshTable();
        }
Ejemplo n.º 2
0
        private void Edit_Button_Click(object sender, EventArgs e)
        {
            //gdy rekordu brak nie rób nic
            var curtab = tabControl.SelectedTab;

            TabTagData tabtabtag = curtab.Tag as TabTagData;
            char       tabtag    = tabtabtag.Mode;
            int?       optID     = tabtabtag.optionalID;

            switch (tabtag)
            {
            case 'u': UserForm newUserForm = new UserForm(); newUserForm.ShowDialog(); break;

            case 'r': RoleForm newRoleForm = new RoleForm(); newRoleForm.ShowDialog(); break;

            case 'p': ProjectForm newProjectForm = new ProjectForm(dataTable.someMiscTempVarThatShoudntBeHereInTheFirstPlaceToBeginWith); newProjectForm.ShowDialog(); break;

            case 's': SprintForm newSprintForm = new SprintForm(optID); newSprintForm.ShowDialog(); break;

            case 'f': PhaseForm newPhaseForm = new PhaseForm(); newPhaseForm.ShowDialog(); break;

            case 't': TaskForm newTaskForm = new TaskForm(optID); newTaskForm.ShowDialog(); break;
            }
            dataTable.TableDataMode = tabtag;
            //nie działa
            //dataTable.RefreshTable();
        }