Beispiel #1
0
 protected void GridPanel1_RowDblClick(object sender, DirectEventArgs e)
 {
     try
     {
         string id = "";
         foreach (var a in RowSelectionModel1.SelectedRows)
         {
             id = a.RecordID;
         }
         DAL.DM_VTHH item = new DM_VTHHController().GetByID(id);
         txt_GHI_CHU.Text = item.GHI_CHU;
         txt_MA_VTHH.Text = item.MA_VTHH;
         if (item.NGUYEN_GIA.Value > 0)
         {
             txt_NGUYEN_GIA.Text = item.NGUYEN_GIA.Value.ToString();
         }
         txt_TEN_VTHH.Text = item.TEN_VTHH;
         cb_MA_DONVITINH.SetValue(item.MA_DONVITINH);
         cb_MA_NHOM_VTHH.SetValue(item.MA_NHOM_VTHH);
         if (item.SOTHANG_KHAUHAO.HasValue)
         {
             txt_SOTHANG_KHAUHAO.Value = item.SOTHANG_KHAUHAO.Value;
         }
         wdCapNhatTaiSan.Show();
     }
     catch (Exception ex)
     {
         X.Msg.Alert("Có lỗi xảy ra", ex.Message.ToString()).Show();
     }
 }
Beispiel #2
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 #3
0
    private void LoadChildFortunes(string maNhom, Ext.Net.TreeNode node)
    {
        List <DAL.DM_NHOM_VTHH> childList = new DM_VTHHController().GetFortuneGroupByParentID(maNhom);

        foreach (DAL.DM_NHOM_VTHH dv in childList)
        {
            Ext.Net.TreeNode child = new Ext.Net.TreeNode(dv.TEN_NHOM_VTHH);// + "(" + dv.MA_NHOM_VTHH + ")");
            //    child.Icon = Ext.Net.Icon.Folder;
            node.Nodes.Add(child);
            child.Expanded = true;
            child.NodeID   = dv.MA_NHOM_VTHH;
            LoadChildFortunes(dv.MA_NHOM_VTHH, child);
            child.Listeners.Click.Handler = "hdfParentNodeID.setValue('" + dv.PARENTID + "');hdfNodeID.setValue('" + dv.MA_NHOM_VTHH + "');btnEditGroup.enable();btnDeleteGroup.enable();#{PagingToolbar1}.pageIndex=0;#{PagingToolbar1}.doLoad();";
        }
    }
Beispiel #4
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 #5
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);
    }