public DataTable GetRoleApplications(UsersApplicationsRoles userApplicationRole, int tipo)
        {
            CreateColumns();

            var           lstRole       = GetRoleforApplication(userApplicationRole, tipo);
            ApplicationDA applicationDa = new ApplicationDA(_configuration);

            if (lstRole.Count > 0)
            {
                foreach (var role in lstRole)
                {
                    _drFixed = _dtFixed.NewRow();

                    _drFixed["RoleId"]                  = role.RoleId;
                    _drFixed["RoleName"]                = role.RoleName;
                    _drFixed["RoleDescription"]         = role.RoleDescription;
                    _drFixed["ApplicationId"]           = role.ApplicationId;
                    _drFixed["ApplicationName"]         = applicationDa.FindApplication(role.ApplicationId).ApplicationName;
                    _drFixed["CreationDateTime"]        = role.CreationDateTime;
                    _drFixed["CreationUserId"]          = role.CreationUserId;
                    _drFixed["ModificationDateTime"]    = role.ModificationDateTime;
                    _drFixed["ModificationUserId"]      = role.ModificationUserId;
                    _drFixed["DeclineDate"]             = role.DeclineDate;
                    _drFixed["RoleAuthorizationUserId"] = role.RoleAuthorizationUserId;
                    _drFixed["RoleAuthorizationOwner"]  = role.RoleAuthorizationOwner;

                    _dtFixed.Rows.Add(_drFixed);
                }
            }
            applicationDa.Dispose();

            return(_dtFixed);
        }
        public DataTable GetRolesApplications(string strValue)
        {
            CreateColumns();

            var conn     = StrConexion;
            var roleList = new List <Role>();

            using (var sqlCon = new SqlConnection(conn))
            {
                sqlCon.Open();
                var cmd = new SqlCommand
                {
                    Connection  = sqlCon,
                    CommandType = CommandType.StoredProcedure,
                    CommandText = "usp_FindRoles"
                };
                cmd.Parameters.AddWithValue("@strCampo", strValue);

                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    var role = new Role
                    {
                        RoleId          = (int)reader["RoleId"],
                        RoleName        = (string)reader["RoleName"],
                        RoleDescription = (string)reader["RoleDescription"],
                        ApplicationId   = (int)reader["ApplicationId"],
                        DeclineDate     = string.IsNullOrEmpty(reader["DeclineDate"].ToString()) ? string.Empty : string.Format("{0:dd/MM/yyyy}", reader["DeclineDate"])
                    };
                    roleList.Add(role);
                }

                ApplicationDA applicationDa = new ApplicationDA(_configuration);
                //llenamos Tabla
                if (roleList.Count > 0)
                {
                    foreach (var role in roleList)
                    {
                        _drFixed = _dtFixed.NewRow();

                        _drFixed["RoleId"]          = role.RoleId;
                        _drFixed["RoleName"]        = role.RoleName;
                        _drFixed["RoleDescription"] = role.RoleDescription;
                        _drFixed["ApplicationId"]   = role.ApplicationId;

                        _drFixed["ApplicationName"] = applicationDa.FindApplication(role.ApplicationId).ApplicationName;
                        _drFixed["DeclineDate"]     = role.DeclineDate;

                        _dtFixed.Rows.Add(_drFixed);
                    }
                }
                applicationDa.Dispose();
            }

            return(_dtFixed);
        }