public int CountDateStamp(string employeecode, string pmperiodid)//นับวันที่ สมมตินับได้15วัน เขียนในclassนะค่ะ
{
connect();
SqlCommand command = new SqlCommand(@"select COUNT(DateStamp) AS CountDateStamp from vTimeInOut where EmployeeCode =@EmployeeCode
and DateStamp >=(SELECT BeginDate From vPMPeriod Where PMPeriod_ID =@PMPeriod_ID
And PMPeriodStatus = 0) and DateStamp<=dbo.fGen8DateFormat(Getdate()) ", con);
command.Parameters.AddWithValue("@EmployeeCode", employeecode);
command.Parameters.AddWithValue("@PMPeriod_ID", pmperiodid);
roweffect = command.ExecuteNonQuery();
return roweffect; // return เป็น-1
}