Example #1
0
 public Product(string name, double price, string unit, double storedLoc, Space.OperativeType operative)
 {
     this.productName = name.Trim();
     this.price = price;
     this.unit = unit.Trim();
     this.storedLocation = storedLoc;
     this.operative = operative;
 }
        private void buttonOkay_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;

            if (comboBoxOperativeType.SelectedIndex == 0)
                operativeType = Space.OperativeType.Male;
            else if (comboBoxOperativeType.SelectedIndex == 1)
                operativeType = Space.OperativeType.Female;
            else
                throw new Exception("Impossible option is selected");

            storedLocation = double.Parse(comboBoxStoredLocation.SelectedItem.ToString());

            this.Close();
        }