Example #1
0
        void AddDiscountToGrid(Backend.Objects.Discount discount)
        {
            //Fill Grid [ DiscountsGrid ] With Rows
            DiscountModel discountModel = new DiscountModel
            {
                OnDelete = OnDeleteDiscount,
                Discount = discount,
                OnToggle = OnToggleModel,
                User     = user,
                Store    = store,
            };

            //Add To Grid
            DiscountsGrid.Controls.Add(discountModel);
        }
Example #2
0
        void Initialize()
        {
            User     = Util.Data.GetUser();
            Store    = Util.Data.GetStore();
            discount = DiscountObject;

            //Get Task
            if (Task == Enums.Task.Get || Task == Enums.Task.Update)
            {
                GetDiscount();
                GetDiscountProducts();
            }
            else if (Task == Enums.Task.Create)
            {
                discount = new Backend.Objects.Discount {
                    Type = null
                };
                txtDiscountValue.Text = "0";
                btnDelete.Visible     = false;
            }

            Translate();
        }