Ejemplo n.º 1
0
 private void bContinue_Click(object sender, EventArgs e)
 {
     if (tName.TextLength > 0 && tProducer.TextLength > 0 && tMaterial.TextLength > 0 &&
         tPrice.TextLength > 0 && tBuckleMaterial.TextLength > 0 && cbBuckleType.SelectedIndex != -1)
     {
         var belt = new Belt(tName.Text, tProducer.Text, tMaterial.Text, Convert.ToDouble(tPrice.Text), tBuckleMaterial.Text, (Buckle)cbBuckleType.SelectedItem);
         storage.AddItem(belt);
         this.Close();
     }
 }
Ejemplo n.º 2
0
        public BeltForm(string itemName)
        {
            InitializeComponent();
            InitializeForm();

            Belt item = (Belt)storage.GetItem(itemName);

            tName.Text                = item.Name;
            tProducer.Text            = item.Producer;
            tMaterial.Text            = item.MainMaterial;
            tBuckleMaterial.Text      = item.BuckleMaterial;
            tPrice.Text               = item.Price.ToString();
            cbBuckleType.SelectedItem = item.BuckleType;
            tName.Enabled             = false;
        }