示例#1
0
        protected void RadTreeView1_Nodeclick(object sender, RadTreeNodeEventArgs e)
        {
            var dt = new object();

            if (e.Node.Level.Equals(0))
            {
                dt = _entities.GetAllCV();
            }
            else
            {
                dt = _entities.GetCVByIDToChuc(Int32.Parse(e.Node.Value));
            }
            HoSoNhanVien_UngVien hs = new HoSoNhanVien_UngVien();

            RadGrid1.DataSource = dt;
            RadGrid1.Rebind();
            if (RadGrid1.Items.Count > 0)
            {
                RadGrid1.Items[0].Selected = true;
                GridDataItem item       = RadGrid1.Items[0];
                Int32        IDNhanVien = Int32.Parse(item["IDNhanVien"].Text);
                FillCurrentEmployeeDetail(IDNhanVien);
                RadContextMenu1.Items.FindItemByValue("xoa").Enabled = true;
                RadContextMenu1.Items.FindItemByValue("sua").Enabled = true;
                CheckPermis();
            }
            else
            {
                RadContextMenu1.Items.FindItemByValue("xoa").Enabled = false;
                RadContextMenu1.Items.FindItemByValue("sua").Enabled = false;
            }
        }
示例#2
0
        protected void AjaxManager_Request(object sender, AjaxRequestEventArgs e)
        {
            RadTreeNodeEventArgs tne;// = new RadTreeNodeEventArgs(RadTreeView1.SelectedNode);

            switch (e.Argument)
            {
            case "XoaNV":
                var dt = _entities.DeleteEmployeeByIDNhanVien((Int32)Session["idNV"]);
                RadGrid1.Rebind();
                tne = new RadTreeNodeEventArgs(RadTreeView1.SelectedNode);
                RadTreeView1_Nodeclick(sender, tne);
                break;

            case "RebindGrid":
                var         dtRebind = new object();
                RadTreeNode tn       = RadTreeView1.SelectedNode;
                if (tn.Level.Equals(0))
                {
                    dtRebind = _entities.GetAllCV();
                }
                else
                {
                    dtRebind = _entities.GetCVByIDToChuc(Int32.Parse(tn.Value));
                }

                RadGrid1.DataSource = dtRebind;
                RadGrid1.DataBind();
                //if (RadGrid1.Items.Count > 0)
                {
                    FillCurrentEmployeeDetail((int)Session["idNV"]);
                }

                //foreach (GridDataItem item in RadGrid1.Items)
                //{
                //    if (item.RowIndex == 2)
                //    {
                //        item.Selected = true;
                //    }

                //}
                break;
            }
        }