예제 #1
0
        public List<ETRoleEntity> GetAssignedGISRoles()
        {
            List<ETRoleEntity> AssignedGISRoles = new List<ETRoleEntity>();
            ETRoleEntity AssignedGISRole;
            if( _GISAssignedRoles != null)
            foreach (DataSetETRoles.ETTableRow ETROW in _GISAssignedRoles.ETTable.Rows)
            {
                if (ETROW.RowState == DataRowState.Added)
                {
                    AssignedGISRole = new ETRoleEntity();
                    AssignedGISRole.RoleName = ETROW[_GISAssignedRoles.ETTable.RoleNameColumn.ColumnName].ToString();
                    AssignedGISRole.UserId = SelectedUser;
                    AssignedGISRole.Description = ETROW[_GISAssignedRoles.ETTable.DescriptionColumn.ColumnName].ToString();
                    AssignedGISRole.EtType = ETROW[_GISAssignedRoles.ETTable.RoleTypeColumn.ColumnName].ToString();
                    AssignedGISRoles.Add(AssignedGISRole);
                }

            }

            return AssignedGISRoles;
        }
        public List<ETRoleEntity> GetETRolesForUser(string UserName)
        {
            DataTable dt = new DataTable();
            DbHelper helper = new DbHelper();
            DbCommand command = helper.BuildDbCommand("P_SS_GISUserRole_S");
            helper.AssignParameterValues(command, UserName);
            Helper.Fill(dt, command);

            List<ETRoleEntity> dtet = new List<ETRoleEntity>();
            ETRoleEntity ET;
            foreach (DataRow dr in dt.Rows)
            {
                ET = new ETRoleEntity();
                ET.RoleName = dr["RoleName"].ToString();
                ET.UserId = dr["UserName"].ToString();
                dtet.Add(ET);
            }

            return dtet;
        }
        public void DeleteUsersETRole(ETRoleEntity etRoleEntity)
        {
            string transactionid = NCS.IConnect.ApplicationContexts.ApplicationContextFactory.GetApplicationContext().TransactionId;
            DbHelper helper = new DbHelper();
            DbCommand command = helper.BuildDbCommand("P_SS_GISUserRole_D");

            helper.AssignParameterValues(command, AppContext.Current.UserName.ToString(), Membership.ApplicationName, transactionid, etRoleEntity.UserId, etRoleEntity.RoleName);
            Helper.ExecuteNonQuery(command);
        }
예제 #4
0
 public List<ETRoleEntity> GetUnassignedGISRoles()
 {
     ultraGridGISAllRoles.UpdateData();
     List<ETRoleEntity> UnAssignedGISRoles = new List<ETRoleEntity>();
     ETRoleEntity UnAssignedGISRole;
     if(GISRolesAssigned!= null)
     foreach (string GISRow in GISRolesAssigned)
     {
         UnAssignedGISRole = new ETRoleEntity();
         UnAssignedGISRole.RoleName = GISRow;
         UnAssignedGISRole.UserId = SelectedUser;
         UnAssignedGISRoles.Add(UnAssignedGISRole);
     }
     return UnAssignedGISRoles;
 }