private void CheckCannotFillTicketsReason(DataTable dt, String projectID, String employeeNo)
    {
               //定义的reason参数
        StringBuilder reason = new StringBuilder();
        if (dt == null) 
        {
            WebSiteHelper.ShowAlertMessage(this, "项目没有启动或员工没有在项目中,请确定好在进行查询!;");
            //reason.Append("项目没有启动或员工没有在项目中,请确定好在进行查询!;");
        }
        if (dt != null)
        {
            DataRow serchItem = dt.Rows[0] as DataRow;
            string projectIDSerch = serchItem["ProjectID"].ToString();
            string employeeNoSerch = serchItem["EmployeeNo"].ToString();            if (!string.IsNullOrEmpty(employeeNo) && !string.IsNullOrEmpty(projectID))
            {
                if (string.IsNullOrEmpty(projectIDSerch) && !string.IsNullOrEmpty(employeeNoSerch))
                {
                    reason.Append("项目没有启动或不存在此项目,请确认后再查询!;");
                }                if (string.IsNullOrEmpty(employeeNoSerch) && !string.IsNullOrEmpty(projectIDSerch))
                {
                    reason.Append("员工没有在此项目中,请确认后在查询!;");
                }
            }            if (dt.Rows.Count == 0)
            {
                reason.Append("员工不在该项目里,不能填写该项目的工时票!;");            }
            DataRow item = dt.Rows[0] as DataRow;
            string employeeLegal = item["EmployeeLegal"].ToString();
            string projectLegal = item["ProjectLegal"].ToString();
            string reallyStartDate = item["ReallyStartDate"].ToString();
            if (employeeLegal != projectLegal)
            {
                reason.Append("员工不在本Legal entity 的分包项目中;");
            }
            if (string.IsNullOrEmpty(reallyStartDate))
            {
                reason.AppendFormat("{0}项目没启动;", projectLegal);
            }
            if (this.dpDate.HasValue)
            {
                DateTime startDate = DateTime.Parse(reallyStartDate);
                DateTime workDate = this.dpDate.Value;
                if (workDate < startDate)
                {
                    reason.AppendFormat("项目启动日期是{0},只能填写该日后的工时票;", startDate.ToShortDateString());
                }                DateTime inDate = DateTime.Parse(item["InDate"].ToString());
                if (workDate < inDate)
                {
                    reason.AppendFormat("员工加入项目组日期是{0},只能填写该日后的工时票;", inDate.ToShortDateString());                }
                DateTime endDate = DateTime.Parse(item["ReallyEndDate"].ToString());
                if (workDate > endDate)
                {
                    reason.AppendFormat("项目结束日期是{0},只能填写该日前的工时票;", endDate.ToShortDateString());                }
                DateTime outDate = DateTime.Parse(item["OutDate"].ToString());
                if (workDate > outDate)
                {
                    reason.AppendFormat("员工退出项目组日期是{0},只能填写该日前的工时票;", outDate.ToShortDateString());                }
            }
}