开发者

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

开发者 https://www.devze.com 2023-04-02 02:50 出处:网络
I have a spreadsheet in excel with three headers: Project Name The name of a project i\'m working on. Requested Role

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 appea开发者_JAVA技巧r 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号