コード例 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            BusinessMetaLayer asu = BusinessMetaLayer.instance();
            string            storageUnitReference;
            int storageUnitCapacity;
            int storageCurrent = 0;
            int storedCrop     = 1;
            int success;

            storageUnitReference = txtStorageUnitReference.Text;
            storageUnitCapacity  = Convert.ToInt32(txtStorageUnitCapacity.Text);
            success = asu.addStorageUnit(storageUnitReference, storageUnitCapacity, storageCurrent, storedCrop);

            if (success == 1)
            {
                MessageBox.Show("Task Created");
                txtStorageUnitReference.Clear();
                txtStorageUnitCapacity.Clear();
            }
            else
            {
                MessageBox.Show("An input is correct");
            }
        }