示例#1
0
        void DisplayDiscount(Enums.Task task)
        {
            //Add Blur
            Blur blur = new Blur(this.ParentForm, UIConstants.FormBlurOpacity);

            blur.Show();

            Forms.Discounts.Discount product = new Forms.Discounts.Discount
            {
                DiscountObject = Discount,
                OnDelete       = OnDeleteDiscount,
                Task           = task,
                TopMost        = true
            };

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

            if (formResponse.ActionDialog == Enums.ActionDialog.Updated)
            {
                Discount = (Backend.Objects.Discount)formResponse.Data;
                //Force Update
                this.Initialize();
            }

            //Remove Blur
            blur.Close();
        }
示例#2
0
        private void BtnAddDiscount_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.Discounts.Discount discount = new Forms.Discounts.Discount
            {
                OnCreate = OnCreateDiscount,
                Task     = Enums.Task.Create,
                TopMost  = true
            };

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

            //Remove Blur
            blur.Close();
        }