简体   繁体   中英

what editable control should i use to display my spreadsheet in a vb.net application?

I have a spreadsheet in excel with three headers:

Project Name

  • The name of a project i'm working on.

Requested Role

  • The job title/profession of the project employee. (example: mechanic, manager, engineer)

Name

  • The name of the employee.

When i click on the Person's name i want another page or tab (specific to this person) to appear showing details about them such as their name, job title, how long they worked, what project they are doing... etc. (similar to a Facebook profile)

When i click on the project name i want another page or tab (specific to this project) to appear showing details about it such as the requirements, the deadline, who is currently working on it... etc.

Furthermore, i would like to set up two levels of access:

Managers:

  • People who can add new information but not change or delete existing information
  • (write-only permissions)

Administrators:

  • People who can have full access to all information.
  • All highest level of access.

I don't know how i would go about displaying and/or organizing so much information in a vb.net application. if anyone could provide some suggestions as to some possible layouts of the GUI it would be greatly appreciated!

Additional Details:

  • For the specific pages i was thinking of using the tab control but i want it so that i can search through the list of projects or names, select one, and then it brings up the page about it.

  • The levels of access is the least of my worries... although it is still a worry.


You don't want to store that information in an excel spreadsheet, a database is much, much better. For what you've described here I'm going to assume that you have Projects and Employees, and that multiple Employees can work on a project. You'll need a few tables then:

Project
  ProjectSeq    'Int     - unique sequence for this project record
  Name          'String  - name of project
  Descr         'String  - description of project
  ...           'Various - other fields as needed

Employee
  EmployeeSeq   'Int     - unique sequence for this employee record
  Name          'String  - Name of employee
  Title         'String  - Job title of this employee
  IsManager     'Boolean - Is this employee a manager?
  IsAdmin       'Boolean - Is this employee an administrator?
  ...           'Various - other fields as needed

ProjEmpl
  ProjEmplSeq   'Int     - unique sequence for this project-employee record
  ProjSeq       'Int     - link to project record
  EmployeeSeq   'Int     - link to employee record
  ...           'Various - other fields that apply to this project-employee combination

Once you have your tables all set up and populated with data, you'll want to read the data and transfer it to your .NET application. There are a few ways of doing this, you'll have to decide which works best for your needs. I'm a big fan of DataSets, they always work nicely.

To fill the grid, you'll need to use a sql statement that fills a datatable from the three tables (I'm using notepad as my IDE, so this may not be exact):

SELECT pe.*, p.Name as ProjName, e.Name as EmplName, e.Title
FROM ProjEmpl pe, Project p, Employee e
WHERE p.ProjectSeq  = pe.ProjectSeq AND
      e.EmployeeSeq = pe.EmployeeSeq

To display the data to the end user, you would use a DataGridView control. Set the datagrid.DataSource to use the datatable you just populated and the data should show up.

To display the related Employee & Project information, I'd use a tab control underneath the datagrid. One tab for Project, and one tab for Employee. Use individual controls for each field in the table. When the user changes rows in the datagrid, load the related Project and Employee information for that row into two datatables and populate the controls from that.

Lastly, to set permissions on the program you'll need to have the employee log onto the application. Once they've logged on you can look them up in the Employee table, find out if they are a manager or an administrator, and set the permissions accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM