Пример #1
0
        private void AddProduct()
        {
            if (string.IsNullOrEmpty(_newItem.ProductCode))
            {
                MessageWindow.ShowAlertMessage("Product Code is required");
                return;
            }

            if (ProductImage.WhereProductCodeIs(_newItem.ProductCode) != null)
            {
                MessageWindow.ShowAlertMessage("Product Code already exists");
                return;
            }

            var result = _newItem.Create();

            if (!result.Success)
            {
                MessageWindow.ShowAlertMessage(result.Message);
                return;
            }

            // success
            DialogResult = true;
            Close();
        }