コード例 #1
0
        private void DeleteCategory(object param)
        {
            commandBuffer.Add(new Helpers.CategoryCommand <InvoiceCategory> {
                CommandType = Helpers.CommandEnum.Remove, Item = SelectedInvoiceCategory
            });

            CategoryCollection.Remove(SelectedInvoiceCategory);
        }
コード例 #2
0
        private void DeleteCategory(object param)
        {
            commandBuffer.Add(new Helpers.CategoryCommand <BuildingChargeBasisCategory> {
                CommandType = Helpers.CommandEnum.Remove, Item = SelectedCostCategory
            });

            CategoryCollection.Remove(SelectedCostCategory);
        }
コード例 #3
0
    private void BindData(CategoryWidget widget)
    {
        txtTitle.Text = widget.Title;

        CategoryCollection cc = new CategoryController().GetTopLevelCachedCategories();

        CategoryCollection InUse    = new CategoryCollection();
        CategoryCollection NotInUse = new CategoryCollection();

        NotInUse.AddRange(cc);

        foreach (int i in widget.CategoryIds)
        {
            bool found = false;
            foreach (Category c in NotInUse)
            {
                if (i == c.Id)
                {
                    InUse.Add(c);
                    found = true;
                }
            }

            if (found)
            {
                NotInUse.Remove(InUse[InUse.Count - 1]);
            }
        }

        the_Categories.DataSource = NotInUse;
        the_Categories.DataBind();

        existing_items.Items.Clear();
        foreach (Category c in InUse)
        {
            existing_items.Items.Add(new OrderedListItem(string.Format(ItemFormat, c.Name, c.Id), c.Name,
                                                         c.Id.ToString()));
        }
    }
コード例 #4
0
    private void BindData(CategoryWidget widget)
    {
        txtTitle.Text = widget.Title;

        CategoryCollection cc = new CategoryController().GetTopLevelCachedCategories();

        CategoryCollection InUse = new CategoryCollection();
        CategoryCollection NotInUse = new CategoryCollection();

        NotInUse.AddRange(cc);

        foreach(int i in widget.CategoryIds)
        {
            bool found = false;
            foreach(Category c in NotInUse)
            {
                if(i == c.Id)
                {
                    InUse.Add(c);
                    found = true;
                }
            }

            if(found)
            {
                NotInUse.Remove(InUse[InUse.Count - 1]);
            }
        }

        the_Categories.DataSource = NotInUse;
        the_Categories.DataBind();

        existing_items.Items.Clear();
        foreach (Category c in InUse)
        {
            existing_items.Items.Add(new Telligent.Glow.OrderedListItem(string.Format(this.ItemFormat, c.Name, c.Id), c.Name, c.Id.ToString()));
        }
    }