コード例 #1
0
        private void SetDisplay()
        {
            l      = new Accessor.VolumeAccess();
            l      = CmbMat.SelectedItem as Accessor.VolumeAccess;
            costID = l.VolumeCostID;
            Descriptiontxt.Text = l.Description;
            MaterialIDtxt.Text  = l.MaterialID;
            //Middel pane
            MiddlePanelNumTwolbl.Text    = "Total Volume";
            MiddlePaneltxt.Text          = "Total Cost";
            MiddlePanelNumOnelbl.Visible = false;
            MiddlePanelNumOnelbl.Visible = false;

            string totVolume = string.Format("{0:0.00}", l.TotalVolume);

            NumMidPanelNumTwo.Text = totVolume;

            string totCost = string.Format("{0:C}", l.TotalCost);

            MiddlePaneltxt.Text = totCost;

            //Lower pane


            LowerPanelNumTwolbl.Visible = false;
            LowerPanelNumTwotxt.Visible = false;
            LowerPanelNumOnelbl.Text    = "Price per Liter";

            string pricePerM = string.Format("{0:C}", l.PricePerLitre);

            LowerPanelNumOnetxt.Text = pricePerM;
        }
コード例 #2
0
        private void ApplyEdit()
        {
            //TODO Check if the value is not INVALID
            l               = new Accessor.VolumeAccess();
            l.MaterialID    = MaterialIDtxt.Text;
            l.TotalVolume   = Convert.ToDecimal(NumMidPanelNumTwo.Text);
            l.TotalCost     = decimal.Parse(MiddlePaneltxt.Text, System.Globalization.NumberStyles.Currency);
            l.PricePerLitre = decimal.Parse(LowerPanelNumOnetxt.Text, System.Globalization.NumberStyles.Currency);

            d.SaveVolume(costID, l);
            CmbMat.DataSource = d.GetVolume();
        }
コード例 #3
0
 private void CmbMat_SelectedIndexChanged(object sender, EventArgs e)
 {
     l = CmbMat.SelectedItem as Accessor.VolumeAccess;
     SetDisplay();
 }