Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AddEditListingForm addEditListingForm = new AddEditListingForm();

            addEditListingForm.Title = "Add new shop";
            if (addEditListingForm.ShowDialog() == DialogResult.OK)
            {
                ShopManager.Shops.Add(addEditListingForm.Shop);
                ShopManager.Save();

                pnlShopListing.Controls.Add(CreateShopControl(addEditListingForm.Shop));
            }
        }
Exemplo n.º 2
0
        private void lnkEdit_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            AddEditListingForm addEditListingForm = new AddEditListingForm();

            addEditListingForm.Title = "Edit - " + this.shop.Name;
            addEditListingForm.Shop  = this.shop;
            if (addEditListingForm.ShowDialog() == DialogResult.OK)
            {
                shop = addEditListingForm.Shop;
                ShopManager.Save();
                LoadValues();

                if (ListItemUpdated != null)
                {
                    ListItemUpdated(null, null);
                }
            }
        }