Exemplo n.º 1
0
        private void BtnEdit_Click(object sender, EventArgs e)
        {
            Blur blur = new Blur(this.ParentForm, UIConstants.FormBlurOpacity);

            blur.Show();

            Forms.Products.Product product = new Forms.Products.Product
            {
                ProductObject = Product,
                Task          = Enums.Task.Update,
                TopMost       = true
            };

            // Update If Updated
            var formResponse = product.ShowWithResponse();

            if (formResponse.ActionDialog == Enums.ActionDialog.Updated)
            {
                Product = (Backend.Objects.Product)formResponse.Data;

                //Force Update
                this.Initialize();
            }
            else if (formResponse.ActionDialog == Enums.ActionDialog.Deleted)
            {
                // Delete -> Nothing to show
                this.OnDelete(this, e);
                this.Hide();
            }

            blur.Close();
        }
Exemplo n.º 2
0
        private void BtnAddProduct_Click(object sender, EventArgs e)
        {
            if (!Util.Func.IsUserAllowed(User, Util.PermissionAlertType.Message, this.ParentForm))
            {
                return;
            }

            //Add Blur
            Blur blur = new Blur(this.ParentForm, UIConstants.FormBlurOpacity);

            blur.Show();

            Forms.Products.Product product = new Forms.Products.Product
            {
                OnCreate = OnCreateProduct,
                Task     = Enums.Task.Create,
                TopMost  = true
            };

            // Update
            var dialogResult = product.ShowWithResult();

            blur.Close();
        }