Exemplo n.º 1
0
        /// <summary>
        /// Add
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (VerificationHelper.IsInputBoxEmpty(txtProductTypeName))
            {
                return;
            }

            if (productTypeService.IsProductTypeNameExisted(txtProductTypeName.Text.Trim()))
            {
                MessageBox.Show("This " + txtProductTypeName.Text.Trim() + " already exists.");
            }
            else
            {
                var productType = new ProductType()
                {
                    ProductTypeName = txtProductTypeName.Text
                };

                productTypeService.Add(productType);
            }

            ResetUIInputtdData();
        }