如何显示平衡日志在GridView [英] How do I show balance log in a gridview

查看:171
本文介绍了如何显示平衡日志在GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个系统,其中允许用户申请服用叶。该系统还称赞叶每个用户的帐户,每年两次。

I have a system in which allows the user to apply for taking leaves. The system also credits leaves to each user's account, twice a year.

现在,管理员在这个整个系统的充分授权,并可以取消,并授予叶。

Now, the administrator has full authority over this whole system and, can cancel the and grant leaves.

要分析用户是否未超过扩展到他的所有权限,它要求该管理员应显示的信用和叶发生在每个用户帐户,像一个日志的借方的记录。

To analyze whether a user has not exceeded all privileges extended to him, it is required that the admin should be shown a record of the credit and debit of leaves taking place in each user account, like a log.

事情是这样的:

Something like this:

现在,我已经做了桌子下面,来容纳这样的数据:

Now, I have made a table as below, to house this data:

我现在查询是,我如何实现这一目标?我的意思是,应该是我的SQL查询,我应该如何显示呢?
我应该创建一个SQL Server代理作业,并显示在GridView中的数据?如果是的话,那我应该怎么指定的步骤。

My query now is that how do i achieve this? I mean, what should be my sql query and how should i display it? Should I create a Sql Server Agent job and display the data in a gridview? If yes, then how should I specify the steps for that.

我的数据库具有存储为每个用户每种类型的休假余额更新雇员表。和许可表容纳由用户发出的请求的详细信息。基本上,它存储所有的休假申请表填写的细节。

My database has an employee table which stores the updated balance for each type of leave for every user. And the leave table houses the details of the requests made by the users. Basically, it stores all the details filled out in the leave application form.

我很困惑,我该如何获取发生在这些表的操作和变化,因为这是需要什么来显示给管理员。

I am confused as to how do I fetch the operations and changes occurring on these tables, for that is what is required to be displayed to the admin.

推荐答案

按我查询的理解,我一直在下面分享我的建议是:

As per my understanding of your query, I have been shared my suggestion below :

1.My的观点,您可以通过使用数据库中的存储过程,让你期望的输出。

1.My point of view ,you can get your expected output by using stored procedure in Database.

2.因为希望你存储的员工信息的价值,休假类型,留下细节与原发性和放大器的帮助下单独的表;外键约束。

2.Because Hopefully You stored the values of employee information, leave type ,leave details are into separate table with the help of primary & foreign key constraints.

3.In存储过程,可以执行以下步骤:

3.In the stored procedure, you can perform the following steps:

(1)Pass Input parameter : EmployeeId, FromDate, ToDate, HandledById (AdminId)
(2)Join all corresponding table with the help of Primary & foreign key Id.
(3)Select the appropriate column, Use aggregate function to find the leave.
(4)Use sub query in case of necessary as per your logic & table structure.

4.然后您可以绑定&放大器;轻松显示GridView控件中的数据。

4.Then You can bind & display the data in gridview easily.

不要让我知道如果你需要任何东西!

Do let me know if you need anything else.!

这篇关于如何显示平衡日志在GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆