我应该使用什么可编辑控件在 vb.net 应用程序中显示我的电子表格?

发布于 2024-12-02 11:49:53 字数 949 浏览 1 评论 0原文

我有一个 Excel 电子表格,其中包含三个标题:

项目名称

  • 我正在处理的项目的名称。

请求的角色

  • 项目员工的职称/专业。 (例如:机械师、经理、工程师)

姓名

  • 员工的姓名。

当我单击此人的姓名时,我希望出现另一个页面或选项卡(特定于此人),显示有关他们的详细信息,例如他们的姓名、职位、他们工作了多长时间、他们正在做什么项目...等(类似到 Facebook 个人资料)

当我单击项目名称时,我希望出现另一个页面或选项卡(特定于该项目),显示有关该项目的详细信息,例如要求、截止日期、当前正在处理该项目的人员...等等

。 ,我想设置两个级别的访问权限:

经理:

  • 可以添加新信息但不能更改或删除现有信息的人员
  • (只写权限)

管理员:

  • 可以完全访问所有信息的人员。
  • 所有最高级别的访问权限。

我不知道如何在 vb.net 应用程序中显示和/或组织如此多的信息。如果有人可以就 GUI 的一些可能的布局提供一些建议,我们将不胜感激!

其他详细信息:

  • 对于特定页面,我正在考虑使用选项卡控件,但我想要它,以便我可以搜索项目或名称列表,选择一个,然后它会显示关于它的页面。

  • 访问级别是我最不担心的......尽管它仍然是一个担心。


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.


如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

涫野音 2024-12-09 11:49:53

您不想将该信息存储在 Excel 电子表格中,数据库要好得多。对于您在此处所描述的内容,我将假设您有项目和员工,并且多个员工可以处理一个项目。然后您将需要一些表:

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

一旦您的表全部设置完毕并填充了数据,您将需要读取数据并将其传输到您的 .NET 应用程序。有几种方法可以做到这一点,您必须决定哪种方法最适合您的需求。我是数据集的忠实粉丝,它们总是工作得很好。

要填充网格,您需要使用一条 sql 语句来填充三个表中的数据表(我使用记事本作为我的 IDE,因此这可能不准确):

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

要向最终用户显示数据,您需要将使用 DataGridView 控件。将 datagrid.DataSource 设置为使用您刚刚填充的数据表,并且数据应该会显示。

显示相关的员工和员工项目信息,我会在数据网格下方使用选项卡控件。一个选项卡用于项目,一个选项卡用于员工。对表中的每个字段使用单独的控件。当用户更改数据网格中的行时,将该行的相关项目和员工信息加载到两个数据表中,并从中填充控件。

最后,要设置程序的权限,您需要让员工登录到该应用程序。他们登录后,您可以在“员工”表中查找他们,了解他们是经理还是管理员,并相应地设置权限。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文