Example #1
0
        private void JobView4_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dsComments.comments' table. You can move, or remove it, as needed.
            // this.commentsTableAdapter1.Fill(this.dsComments.comments);
            // TODO: This line of code loads data into the 'ds_Comments.comments' table. You can move, or remove it, as needed.
            // this.commentsTableAdapter.Fill(this.ds_Comments.comments);

            //  commentsTableAdapter.fillComments(dsComments.comments, strJobNumber);
            try
            {
                commentsTableAdapter1.fillComments(this.dsComments.comments, strJobNumber);
                this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("id");
                this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("baseid");
                this.gridGroupingControl1.Appearance.AlternateRecordFieldCell.BackColor = Color.LightGray;

                this.gridGroupingControl1.TableOptions.ColumnHeaderRowHeight = 20;
                this.gridGroupingControl1.TableOptions.RecordRowHeight       = 40;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }


            using (var db = new TestEntities())
            {
                ImportantDate idate   = db.ImportantDates.Find(strJobNumber);
                picture       findpic = db.pictures.Find(strJobNumber);
                // Margin_Over_time mot = db.Margin_Over_time.Find(strJobNumber);

                // rbcMain

                if (findpic != null)
                {
                    using (var bmpTemp = new Bitmap(findpic.Path))
                    {
                        image = new Bitmap(bmpTemp);
                        //  is3.Images.Add(image);
                        is3.BackgroundImage       = image;
                        is3.BackgroundImageLayout = ImageLayout.Stretch;

                        //   is1.SlideShow = false;
                        //  dscomments
                        //    is1.

                        is3.ImageCollection.ImageSize.Height.Equals(512);
                        is3.ImageCollection.ImageSize.Width.Equals(512);
                    }
                }
                else
                {
                    Image i2 = Image.FromFile(@"r:\wippictures\na.jpg");



                    is3.Images.Add(i2);
                }



                Team jobteam1 = new Team();
                bool check1   = db.Teams.Any(u => u.JobNumber == strJobNumber);


                #region LabelChecks

                string strJob = strJobNumber.Replace("/", "_").Replace(" ", "");
                string path   = "R:\\wipviewer2017\\jobfiles\\" + strJob + "\\riskassessment.xlsx";

                if (File.Exists(path) == true)
                {
                }
                else
                {
                    btnRA.BackColor = Color.Red;
                    btnRA.Enabled   = false;
                }

                path = "R:\\wipviewer2017\\jobfiles\\" + strJob + "\\aqp.xlsx";

                if (File.Exists(path) == true)
                {
                }
                else
                {
                    btnAQP.BackColor = Color.Red;
                    btnAQP.Enabled   = false;
                }

                if (check1 == true)
                {
                    jobteam1 = db.Teams.Find(strJobNumber);

                    if (jobteam1.ProgramManager != null)
                    {
                        lblPm.Text = "Program Manager: " + jobteam1.ProgramManager;
                    }
                    else
                    {
                        lblPm.Text = "PM NOT SET";
                    }

                    if (jobteam1.Processor != null)
                    {
                        lblProcessor.Text = "Processor: " + jobteam1.Processor;
                    }
                    else
                    {
                        lblProcessor.Text = "PROCESSOR NOT SET";
                    }

                    if (jobteam1.BuildLeader != null)
                    {
                        lblBl.Text = "Build Leader: " + jobteam1.BuildLeader;
                    }
                    else
                    {
                        lblBl.Text = "BUILD LEADER NOT SET";
                    }



                    if (jobteam1.PODate != null)
                    {
                        lblPO.Text = "PO Date: " + jobteam1.PODate.Value.ToString("MM-dd-yyyy");
                    }
                    else
                    {
                        lblPO.Text = "PO DATE NOT ENTERED";
                    }

                    #endregion



                    ActiveJob aj1 = db.ActiveJobs.Find(strJobNumber);



                    this.Text = strJobNumber;
                }
            }
        }
Example #2
0
        private void testjobview_Load(object sender, EventArgs e)
        {
            using (var db = new TestEntities())
            {
                ImportantDate idate   = db.ImportantDates.Find(strJobNumber);
                picture       findpic = db.pictures.Find(strJobNumber);
                // Margin_Over_time mot = db.Margin_Over_time.Find(strJobNumber);

                // rbcMain

                if (findpic != null)
                {
                    using (var bmpTemp = new Bitmap(findpic.Path))
                    {
                        image = new Bitmap(bmpTemp);
                        //  is3.Images.Add(image);
                        is3.BackgroundImage       = image;
                        is3.BackgroundImageLayout = ImageLayout.Stretch;

                        //   is1.SlideShow = false;
                        //  dscomments
                        //    is1.

                        is3.ImageCollection.ImageSize.Height.Equals(512);
                        is3.ImageCollection.ImageSize.Width.Equals(512);
                    }
                }
                else
                {
                    Image i2 = Image.FromFile(@"r:\wippictures\na.jpg");



                    is3.Images.Add(i2);
                }



                Team jobteam1 = new Team();
                bool check1   = db.Teams.Any(u => u.JobNumber == strJobNumber);


                #region LabelChecks

                string strJob = strJobNumber.Replace("/", "_").Replace(" ", "");
                string path   = "R:\\wipviewer2017\\jobfiles\\" + strJob + "\\riskassessment.xlsx";

                if (File.Exists(path) == true)
                {
                }
                else
                {
                    btnRA.BackColor = Color.Red;
                    btnRA.Enabled   = false;
                }

                path = "R:\\wipviewer2017\\jobfiles\\" + strJob + "\\aqp.xlsx";

                if (File.Exists(path) == true)
                {
                }
                else
                {
                    btnAQP.BackColor = Color.Red;
                    btnAQP.Enabled   = false;
                }

                if (check1 == true)
                {
                    jobteam1 = db.Teams.Find(strJobNumber);

                    if (jobteam1.ProgramManager != null)
                    {
                        lblPm.Text = "Program Manager: " + jobteam1.ProgramManager;
                    }
                    else
                    {
                        lblPm.Text = "PM NOT SET";
                    }

                    if (jobteam1.Processor != null)
                    {
                        lblProcessor.Text = "Processor: " + jobteam1.Processor;
                    }
                    else
                    {
                        lblProcessor.Text = "PROCESSOR NOT SET";
                    }

                    if (jobteam1.BuildLeader != null)
                    {
                        lblBl.Text = "Build Leader: " + jobteam1.BuildLeader;
                    }
                    else
                    {
                        lblBl.Text = "BUILD LEADER NOT SET";
                    }



                    if (jobteam1.PODate != null)
                    {
                        lblPO.Text = "PO Date: " + jobteam1.PODate.Value.ToString("MM-dd-yyyy");
                    }
                    else
                    {
                        lblPO.Text = "PO DATE NOT ENTERED";
                    }

                    #endregion



                    ActiveJob aj1 = db.ActiveJobs.Find(strJobNumber);
                    #region agechecks


                    if (aj1.age1 <= 30)
                    {
                        DateTime testdate  = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Min());
                        DateTime testdate2 = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Max());
                        cc1.PrimaryXAxis.DateTimeRange = new Syncfusion.Windows.Forms.Chart.ChartDateTimeRange(testdate, testdate2, 5, Syncfusion.Windows.Forms.Chart.ChartDateTimeIntervalType.Days);
                    }

                    if (aj1.age1 > 30 && aj1.age1 <= 60)
                    {
                        DateTime testdate  = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Min());
                        DateTime testdate2 = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Max());
                        cc1.PrimaryXAxis.DateTimeRange = new Syncfusion.Windows.Forms.Chart.ChartDateTimeRange(testdate, testdate2, 10, Syncfusion.Windows.Forms.Chart.ChartDateTimeIntervalType.Days);
                    }

                    if (aj1.age1 > 60 && aj1.age1 <= 150)
                    {
                        DateTime testdate  = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Min());
                        DateTime testdate2 = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Max());
                        cc1.PrimaryXAxis.DateTimeRange = new Syncfusion.Windows.Forms.Chart.ChartDateTimeRange(testdate, testdate2, 1, Syncfusion.Windows.Forms.Chart.ChartDateTimeIntervalType.Months);
                    }

                    if (aj1.age1 > 150 && aj1.age1 <= 365)
                    {
                        DateTime testdate  = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Min());
                        DateTime testdate2 = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Max());
                        cc1.PrimaryXAxis.DateTimeRange = new Syncfusion.Windows.Forms.Chart.ChartDateTimeRange(testdate, testdate2, 2, Syncfusion.Windows.Forms.Chart.ChartDateTimeIntervalType.Months);
                    }

                    if (aj1.age1 > 365)
                    {
                        DateTime testdate  = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Min());
                        DateTime testdate2 = Convert.ToDateTime(db.Margin_Over_time.Where(cc4 => cc4.BaseID == strJobNumber).Select(cc4 => cc4.BatchDate).Max());
                        cc1.PrimaryXAxis.DateTimeRange = new Syncfusion.Windows.Forms.Chart.ChartDateTimeRange(testdate, testdate2, 3, Syncfusion.Windows.Forms.Chart.ChartDateTimeIntervalType.Months);
                    }

                    #endregion



                    this.Text = strJobNumber;
                }
            }
        }