private void SetDisplay() { a = new Accessor.AreaAccess(); a = CmbMat.SelectedItem as Accessor.AreaAccess; costID = a.AreaCostID; Descriptiontxt.Text = a.Description; MaterialIDtxt.Text = a.MaterialID; //Middel pane MiddlePanelNumOnelbl.Text = "Total Lenght"; MiddlePanelNumTwolbl.Text = "Total Width"; MiddlePanelNumThreelbl.Text = "Total Cost"; string totL = string.Format("{0:0.00}", a.TotalLenght); NumMidPanelNumOne.Text = totL; string totW = string.Format("{0:0.00}", a.TotalWidth); NumMidPanelNumTwo.Text = totW; string totC = string.Format("{0:C}", a.TotalCost); MiddlePaneltxt.Text = totC; //Lower pane LowerPanelNumOnelbl.Text = "Total Area"; LowerPanelNumTwolbl.Text = "Price per Square Meter"; string totArea = string.Format("{0:0.00}", a.TotalArea); LowerPanelNumOnetxt.Text = totArea; string pricePerSQM = string.Format("{0:C}", a.PricePSqrMeter); LowerPanelNumTwotxt.Text = pricePerSQM; }
private void CmbMat_SelectedIndexChanged(object sender, EventArgs e) { a = CmbMat.SelectedItem as Accessor.AreaAccess; SetDisplay(); }