Exemplo n.º 1
0
        private void LoadData()
        {
            LoadComboBox();

            // Verificar si el usuario tiene permisos asignados
            OperationResult objSecurityOperationResult1 = new OperationResult();

            if (Mode == "New")
            {
                hfMode.Text = "New";
            }
            else if (Mode == "Edit")
            {
                ddlRole.SelectedValue = RoleId.ToString();
                ddlRole.Enabled       = false;

                var filterExpression = string.Format("i_NodeId=={0}&&i_RoleId=={1}&&i_IsDeleted==0", NodeId, RoleId);
                int count1           = _objNodeBL.GetRoleNodeProfileCount(ref objSecurityOperationResult1, filterExpression);

                if (count1 == 0)
                {
                    // Additional logic here.
                    hfMode.Text = "New";
                }
                else
                {
                    hfMode.Text = "Edit";
                    // Cargar permisos Globales
                    OperationResult objCommonOperationResultGlobal = new OperationResult();
                    var             objRoleNodeProfile             = _objNodeBL.GetRoleNodeProfile(ref objCommonOperationResultGlobal, NodeId, RoleId);

                    if (objRoleNodeProfile != null)
                    {
                        // Marcar (CkeckBox) los permisos en el Tree Contextual
                        foreach (var item in objRoleNodeProfile)
                        {
                            SearchNode(tvContextPermissions.Nodes, int.Parse(item.Id), true);
                        }
                    }
                }
            }
        }