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()); }
}
}
{
//定义的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()); }
}
}
解决方案 »
- 4.34G版本visual studio 2008安装不上,cab5.cab文件损坏,跪求同版本此文件!
- LinQ 怎么返回 TataTable ???在线等。。。。
- 大哥~我要截个助
- 有什么办法让VBA中得到asp.net中的web.config里的key的值啊?
- 小弟刚毕业,花了一两个月时间做的东西,
- datagrid分頁問題??求教
- ======又见怪问题。。。。晕,搞死我了/。。兄第们来看看啊
- 请教高手 静态方法 和 实例方法 的区别
- javascript 如何读取 textBox 控件里面的值?
- 如何将一个表格放在网页的正中?
- c# 调用扫描仪详细代码
- 关于AddObject()对象的问题
<ig:BoundDataField DataFieldName="Reason" Width="200px" Key="Reason">
<Header Text="原因"></Header>
</ig:BoundDataField>
后台数据库应为要绑定数据所以写了一个空值
由 ‘’AS Reason代替的问问怎么办?急........