如何在c#中编写工资单软件 [英] How Do I Write A Payroll software in c#

查看:134
本文介绍了如何在c#中编写工资单软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个名为Employee的类,它有2个属性,其中一个用于基础工资,另一个用于输入和退出员工的时间和日期列表。(来自我们想要的每个集合)。然后我们想要显示他们的真实信息(姓名和姓氏及其工作号码)并计算他们上班的天数和工作时间(在字典中)

we have a class named Employee that has 2 properties one of them for based salary and the other one for the list of time and date of entering and exiting of employees.(from each of collections that we want).then we want to show the real information about them(name and family name & their work number)and calculate that how many days they come to work and how much time they work(in dictionary)

推荐答案

你需要一个像这样的数据库表结构



表名:DayWorkDetails



EmployeeId: bigint FK

日期:smalldatetime

StatTime:时间

结束时间:时间



***本月天数进来



DECLARE @Month INT,

@EmployeeID BIGINT



SELECT *

来自DayWorkDetails

WHERE

月(日期)= @月

AND EmpolyeeId = @ EmployeeID



***总工资本月特大时刻



SELECT SUM(DATEDIFF('HH',StatTime,EndTime))AS NumOfHours
来自DayWorkDetails的

WHERE

月(日期)= @月

AND EmpolyeeId = @ EmployeeID
You need a Database Table structure like this

Table Name: DayWorkDetails

EmployeeId: bigint FK
Date: smalldatetime
StatTime: Time
EndTime: TIme

***Numbers of Days Come in this month

DECLARE @Month INT,
@EmployeeID BIGINT

SELECT *
FROM DayWorkDetails
WHERE
Month(Date)=@Month
AND EmpolyeeId =@EmployeeID

*** Total working hours in this month

SELECT SUM(DATEDIFF('HH',StatTime,EndTime)) AS NumOfHours
FROM DayWorkDetails
WHERE
Month(Date)=@Month
AND EmpolyeeId =@EmployeeID


这篇关于如何在c#中编写工资单软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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