예제 #1
0
 private void FormJobReviewEdit_Load(object sender, EventArgs e)
 {
     _listReviewers = Userods.GetUsersByJobRole(JobPerm.Writeup, false);
     _listReviewers.ForEach(x => comboReviewer.Items.Add(x.UserName));
     comboReviewer.SelectedIndex = _listReviewers.FindIndex(x => x.UserNum == _jobReviewCur.ReviewerNum);
     Enum.GetNames(typeof(JobReviewStatus)).ToList().ForEach(x => comboStatus.Items.Add(x));
     comboStatus.SelectedIndex = (int)_jobReviewCur.ReviewStatus;
     CheckPermissions();
     if (!_jobReviewCur.IsNew)
     {
         textDateLastEdited.Text = _jobReviewCur.DateTStamp.ToShortDateString();
     }
     textDescription.Text = _jobReviewCur.Description;
     textReviewTime.Text  = _jobReviewCur._Minutes.ToString();
 }
예제 #2
0
 private void FormJobReviewEdit_Load(object sender, EventArgs e)
 {
     _listReviewers = Userods.GetUsersByJobRole(JobPerm.Writeup, false);
     _listReviewers.ForEach(x => comboReviewer.Items.Add(x.UserName));
     comboReviewer.SelectedIndex = _listReviewers.FindIndex(x => x.UserNum == _jobReviewCur.ReviewerNum);
     //TimeLogs are used for storing job time rather than reviews so we remove it as an option here.
     _listReviewStatusNames = Enum.GetNames(typeof(JobReviewStatus)).Where(x => x != "TimeLog").ToList();
     _listReviewStatusNames.ForEach(x => comboStatus.Items.Add(x));
     comboStatus.SelectedIndex = (int)_jobReviewCur.ReviewStatus;
     CheckPermissions();
     if (!_jobReviewCur.IsNew)
     {
         textDateLastEdited.Text = _jobReviewCur.DateTStamp.ToShortDateString();
     }
     textDescription.Text = _jobReviewCur.Description;
     textReviewTime.Text  = _jobReviewCur.TimeReview.TotalMinutes.ToString();
 }
예제 #3
0
        private void FormJobDashboard_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            Color color0    = Color.DarkSlateGray;
            Color color1    = Color.LightSlateGray;
            bool  useColor0 = true;

            foreach (Userod user in Userods.GetUsersByJobRole(JobPerm.Engineer, false).OrderByDescending(x => x.UserName))
            {
                JobManagerUserOverview jobManage;
                if (useColor0)
                {
                    jobManage = new JobManagerUserOverview(color0);
                    useColor0 = false;
                }
                else
                {
                    jobManage = new JobManagerUserOverview(color1);
                    useColor0 = true;
                }
                jobManage.User = user;
                jobManage.Dock = DockStyle.Top;
                this.Controls.Add(jobManage);
            }
            //Fills all in memory data from the DB on a seperate thread and then refills controls.
            ODThread thread = new ODThread((o) => {
                _listJobsAll = Jobs.GetAll();
                Jobs.FillInMemoryLists(_listJobsAll);
                FillDashboard();
            });

            thread.AddExceptionHandler((ex) => {
                MessageBox.Show(ex.Message);
            });
            thread.Start(true);
            _baseFont = Font;
            _baseSize = Size;
        }