Exemple #1
0
 private void Selection_changed()
 {
     try {
         Start_timer_button.Enabled = true;
         if (NewIssueSelectionAvailability)
         {
             CurrentIssueName = Convert.ToString(Issue_list_GridView.SelectedRows[0].Cells[1].Value);
             CurrentIssueId   = Convert.ToInt32(Issue_list_GridView.SelectedRows[0].Cells[0].Value);
             BuisinessLogicClass.SuperIssueId = CurrentIssueId;
             CurrentIssueDataGridRowId        = Issue_list_GridView.SelectedRows[0].Index;
             DataStructureClass.DataStructure data = BuisinessLogicClass.GetOneIssue(CurrentIssueId);
             TimerTicks = data._notCommittedWorkingTime;
             UpdateTimerLabel();
         }
         for (int i = 0; i < 5; i++)
         {
             Issue_list_GridView.Rows[MouseSelectedRow].Cells[i].Style.BackColor = Color.WhiteSmoke;
         }
         MouseSelectedRow = Issue_list_GridView.SelectedRows[0].Index;
         Issue_list_GridView.BackgroundColor = Color.WhiteSmoke;
         for (int i = 0; i < 5; i++)
         {
             Issue_list_GridView.Rows[CurrentIssueDataGridRowId].Cells[i].Style.BackColor = Color.DarkGray;
         }
     }
     catch { }
 }
Exemple #2
0
        public EditIssueForm()
        {
            InitializeComponent();
            if (BuisinessLogicClass.EditIssueId == -1234)
            {
                TypeCreate = true;
                Text       = "Creat issue";
            }
            OldStructure = BuisinessLogicClass.GetOneIssue(BuisinessLogicClass.EditIssueId);

            {
                string[,] projects = BuisinessLogicClass.GetVariables(1);
                ProjectSelectComboBox.Items.Clear();

                BindingList <KeyValuePair <string, int> > items = new BindingList <KeyValuePair <string, int> >();

                int x = 0;
                while (x < projects.GetLength(0))
                {
                    items.Add(new KeyValuePair <string, int>(projects[x, 0], Convert.ToInt32(projects[x, 1])));
                    x++;
                }
                ProjectSelectComboBox.DisplayMember = "Key";
                ProjectSelectComboBox.ValueMember   = "Value";
                ProjectSelectComboBox.DataSource    = items;
                ProjectSelectComboBox.Text          = OldStructure._projectName;
            } // projects

            {
                string[,] trackers = BuisinessLogicClass.GetVariables(2);
                TrackerComboBox.Items.Clear();

                BindingList <KeyValuePair <string, int> > items = new BindingList <KeyValuePair <string, int> >();

                int x = 0;
                while (x < trackers.GetLength(0))
                {
                    items.Add(new KeyValuePair <string, int>(trackers[x, 0], Convert.ToInt32(trackers[x, 1])));
                    x++;
                }
                TrackerComboBox.DisplayMember = "Key";
                TrackerComboBox.ValueMember   = "Value";
                TrackerComboBox.DataSource    = items;
                TrackerComboBox.Text          = OldStructure._tracker;
            } // trackers

            {
                // сделать зависимость от типа пользователя.
                string[,] statuses = BuisinessLogicClass.GetVariables(3);
                StatusComboBox.Items.Clear();
                BindingList <KeyValuePair <string, int> > items = new BindingList <KeyValuePair <string, int> >();
                if ((OldStructure._statusId != 7 || OldStructure._statusId != 2) & OldStructure._statusId != 0)
                {
                    items.Add(new KeyValuePair <string, int>(OldStructure._status, OldStructure._statusId));
                }
                else if (OldStructure._statusId == 7 || OldStructure._statusId == 2)
                {
                    int x = 0;
                    while (x < statuses.GetLength(0))
                    {
                        if (OldStructure._status == statuses[x, 0])
                        {
                            items.Add(new KeyValuePair <string, int>(statuses[x, 0], Convert.ToInt32(statuses[x, 1])));
                            items.Add(new KeyValuePair <string, int>(statuses[x + 1, 0], Convert.ToInt32(statuses[x + 1, 1])));
                        }
                        x++;
                    }
                }
                else
                {
                    items.Add(new KeyValuePair <string, int>(statuses[0, 0], Convert.ToInt32(statuses[0, 1])));
                    items.Add(new KeyValuePair <string, int>(statuses[1, 0], Convert.ToInt32(statuses[1, 1])));
                }

                StatusComboBox.DisplayMember = "Key";
                StatusComboBox.ValueMember   = "Value";
                StatusComboBox.DataSource    = items;
                TrackerComboBox.Text         = OldStructure._tracker;
            } // statuses

            {
                string[,] prioritys = BuisinessLogicClass.GetVariables(4);
                PrioritycomboBox.Items.Clear();
                BindingList <KeyValuePair <string, int> > items = new BindingList <KeyValuePair <string, int> >();

                int x = 0;
                while (x < prioritys.GetLength(0))
                {
                    items.Add(new KeyValuePair <string, int>(prioritys[x, 0], Convert.ToInt32(prioritys[x, 1])));
                    x++;
                }
                PrioritycomboBox.DisplayMember = "Key";
                PrioritycomboBox.ValueMember   = "Value";
                PrioritycomboBox.DataSource    = items;
                PrioritycomboBox.Text          = OldStructure._priority;
            } // prioritys

            {
                string[,] users = BuisinessLogicClass.GetVariables(6);
                AssignedToComboBox.Items.Clear();

                BindingList <KeyValuePair <string, int> > items = new BindingList <KeyValuePair <string, int> >();

                int x = 0;
                while (x < users.GetLength(0))
                {
                    items.Add(new KeyValuePair <string, int>(users[x, 0], Convert.ToInt32(users[x, 1])));
                    x++;
                }
                AssignedToComboBox.DisplayMember = "Key";
                AssignedToComboBox.ValueMember   = "Value";
                AssignedToComboBox.DataSource    = items;
                AssignedToComboBox.Text          = OldStructure._assignedTo;

                AssignedToComboBox.Text = OldStructure._assignedTo;
            } // users

            if (!TypeCreate)
            {
                Fill_data();
            }
        }