Beispiel #1
0
    private void GetChildCategories(ref List <DM_NHOM_VTHHInfo> data, string p, string separator)
    {
        DM_VTHHController controller = new DM_VTHHController();

        foreach (var item in controller.GetFortuneGroupByParentID(p))
        {
            data.Add(new DM_NHOM_VTHHInfo()
            {
                TEN_NHOM_VTHH = separator + item.TEN_NHOM_VTHH,
                MA_NHOM_VTHH  = item.MA_NHOM_VTHH
            });
            GetChildCategories(ref data, item.MA_NHOM_VTHH, separator + "----");
        }
    }
Beispiel #2
0
 protected void Storecb_MA_NHOM_VTHH_OnRefreshData(object sender, StoreRefreshDataEventArgs e)
 {
     try
     {
         DM_VTHHController       controller = new DM_VTHHController();
         List <DM_NHOM_VTHHInfo> data       = new List <DM_NHOM_VTHHInfo>();
         foreach (var item in controller.GetFortuneGroupByParentID("-"))
         {
             data.Add(new DM_NHOM_VTHHInfo()
             {
                 TEN_NHOM_VTHH = item.TEN_NHOM_VTHH,
                 MA_NHOM_VTHH  = item.MA_NHOM_VTHH
             });
             GetChildCategories(ref data, item.MA_NHOM_VTHH, "----");
         }
         Storecb_MA_NHOM_VTHH.DataSource = data;
         Storecb_MA_NHOM_VTHH.DataBind();
     }
     catch (Exception ex)
     {
         X.Msg.Alert("Có lỗi xảy ra", ex.Message.ToString()).Show();
     }
 }
Beispiel #3
0
    private Ext.Net.TreeNodeCollection LoadFortuneGroup(Ext.Net.TreeNodeCollection rootNode)
    {
        if (rootNode == null)
        {
            rootNode = new Ext.Net.TreeNodeCollection();
        }

        DM_VTHHController       controller = new DM_VTHHController();
        List <DAL.DM_NHOM_VTHH> dvList     = controller.GetFortuneGroupByParentID("-");

        Ext.Net.TreeNode root = new Ext.Net.TreeNode();
        root.Expanded = true;
        Ext.Net.TreeNode all = new Ext.Net.TreeNode()
        {
            Text     = "Danh sách nhóm",
            NodeID   = "-1",
            Icon     = Ext.Net.Icon.Group,
            Expanded = true
        };
        all.Listeners.Click.Handler = "hdfNodeID.setValue('-1');btnEditGroup.enable();btnDeleteGroup.enable();#{PagingToolbar1}.pageIndex=0;#{PagingToolbar1}.doLoad();";
        root.Nodes.Add(all);
        foreach (DAL.DM_NHOM_VTHH dv in dvList)
        {
            Ext.Net.TreeNode node = new Ext.Net.TreeNode(dv.TEN_NHOM_VTHH);// + "(" + dv.MA_NHOM_VTHH + ")");
            //  node.Icon = Ext.Net.Icon.Folder;
            all.Nodes.Add(node);
            node.Expanded = true;
            node.NodeID   = dv.MA_NHOM_VTHH;
            LoadChildFortunes(dv.MA_NHOM_VTHH, node);
            node.Listeners.Click.Handler = "hdfParentNodeID.setValue('" + dv.PARENTID + "');hdfNodeID.setValue('" + dv.MA_NHOM_VTHH + "');btnEditGroup.enable();btnDeleteGroup.enable();#{PagingToolbar1}.pageIndex=0;#{PagingToolbar1}.doLoad();";
        }
        //   treeFortuneGroup.Root.Clear();
        //  treeFortuneGroup.Root.Add(root);
        rootNode.Add(root);
        return(rootNode);
    }