private void BindItem(GridViewRowEventArgs e)
    {
        int cid = Uc.CategoryID;
        int sid = Uc.ServiceID;
        TaskE task = (TaskE)UWeb.ToInt32(e, "TaskID");
        ServiceCategory sc = new ServiceCategory(Cxt, sid, cid);

        HyperLink lnkt = e.Row.FindControl("lnkt") as HyperLink;

        switch (task)
        {
            case TaskE.SearchItem:
                lnkt.Text = sc.Get(AttributeE.CategorySearchLabel, Category.DefaultSearch);
                lnkt.NavigateUrl = UWeb.GetUrlItemSearch(Uc.ServiceID, cid, SearchTypeE.Quick);
                break;
            case TaskE.NewItem:
                lnkt.Text = sc.Get(AttributeE.CategoryNewLabel, Category.DefaultNew);
                lnkt.NavigateUrl = UWeb.GetUrlItemEdit(Uc.ServiceID, LayoutE.Edit, cid, Uc.ItemID);
                break;
            case TaskE.BrowseItem:
                lnkt.Text = sc.Get(AttributeE.CategoryBrowseLabel, Category.DefaultBrowse);
                lnkt.NavigateUrl = UWeb.GetUrlItemSearch(Uc.ServiceID, cid, SearchTypeE.Browse);
                break;
            case TaskE.MyItem:
                lnkt.Text = sc.Get(AttributeE.CategoryMyItemsLabel, Category.DefaultMyItems);
                lnkt.NavigateUrl = UWeb.GetUrlItemSearch(Uc.ServiceID, cid, SearchTypeE.MyItems);
                break;
        }
    }
    private void BindItem(GridViewRowEventArgs e)
    {
        int cid = UWeb.ToInt32(e, "CategoryID");
        int sid = UWeb.ToInt32(e, "ServiceID");
        
        Category c = new Category(Cxt, cid);
        ServiceCategory sc = new ServiceCategory(Cxt, sid, cid);

        Image imgc = e.Row.FindControl("imgc") as Image;
        imgc.ImageUrl = Category.IconUrl(cid);
        imgc.AlternateText = c.Name;

        HyperLink lnkm = e.Row.FindControl("lnkm") as HyperLink;
        lnkm.Text = c.Name + " " + UStr.PBracket(sc.ConfigAttributes.ToInt32(AttributeE.ServiceCategoryItemCount));
        lnkm.NavigateUrl = UWeb.GetUrlItemSearch(Uc.ServiceID, cid, SearchTypeE.Browse);

        CategoryTaskUc ctuc1 = e.Row.FindControl("ctuc1") as CategoryTaskUc;
        ctuc1.Uc.CategoryID = cid;
        ctuc1.Uc.ServiceID = sid;

        ctuc1.InitControl();
    }
        private static void UpdateStats(Cxt cxt, BaseCollection items)
        {
            for (int i = 0; i < items.Count; i++)
            {
                ServiceCategory c = new ServiceCategory(cxt, items[i].GetColInt32("ServiceID"), items[i].GetColInt32("CategoryID"));

                c.ConfigAttributes.Set(AttributeE.ServiceCategoryItemCount, items[i].GetCol("ItemCount"));

                c.ConfigAttributes.Save();
            }
        }