private void tsbRetrieve_Click(object sender, EventArgs e) { Datalayer d = Datalayer.Instance; try { Properties.Settings s = Properties.Settings.Default; statusLabel.Text = String.Format("Locations {0}", d.Open(s.OraUsername, s.OraPassword, s.OraTNS)); txtLocation.Text = txtLocation.Text.ToUpper(); DataTable dt = d.LocationClass(txtLocation.Text); if (dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; lblLocationDesc.Text = row["locdescription"].ToString(); lblEqClassCode.Text = row["eqclasscode"].ToString(); lblEqClassDesc.Text = row["eqclassdesc"].ToString(); lblSpecCode.Text = row["classificationid"].ToString(); lblSpecDesc.Text = row["classdescription"].ToString(); DataTable ds = d.LocationAttributes(txtLocation.Text, row["classstructureid"].ToString()); bindingSource1.DataSource = ds; dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); } else { statusLabel.Text = String.Format("There is no Location {0}", txtLocation.Text); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public StartCentre() { InitializeComponent(); Datalayer dl = Datalayer.Instance; dl.Open(); lblSite.Text = String.Format("{0} Workorder Backlog Prioritisation", dl.Site); DataPointCollection pc = progressPie.Series[0].Points; DataPoint p = null; Button b = null; DataSet prog = dl.GetProgressSummary(); foreach (DataRow row in prog.Tables["Progress"].Rows) { AssessmentStatus status = AssessmentStatuses.GetStatus(row["AssessmentStatus"].ToString()); switch (status) { case AssessmentStatus.New: p = pc[0]; p.Color = Color.Orange; b = btnNew; break; case AssessmentStatus.Completed: p = pc[1]; p.Color = Color.SeaGreen; b = btnComp; break; case AssessmentStatus.Cancelled: p = pc[2]; p.Color = Color.Crimson; b = btnCan; break; } p.AxisLabel = AssessmentStatuses.GetStatusDescription(status); p.YValues[0] = double.Parse(row["WoCount"].ToString()); b.Text = p.AxisLabel; b.BackColor = p.Color; b.Tag = p.Tag = status; } progressPie.Invalidate(); progressPie.Update(); priorityChart.Series[0].Points[0].Color = Color.PaleTurquoise; priorityChart.Series[0].Points[1].Color = Color.MediumAquamarine; priorityChart.Series[0].Points[2].Color = Color.Teal; priorityChart.Series[0].Points[3].Color = Color.DarkSlateGray; }
private void tsbCount_Click(object sender, EventArgs e) { Datalayer d = Datalayer.Instance; try { Properties.Settings s = Properties.Settings.Default; statusLabel.Text = String.Format("Locations {0}", d.Open(s.OraUsername, s.OraPassword, s.OraTNS)); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }