3138行开始,这个括号里面的内容都给替换了吧
if (TYPE == "66" || TYPE == "69" || TYPE == "11")//mod by chairuirui 2013-12-30现场问题处理单(2013.11及以后)加一个检索条件:创建日期
{
object cookieStart = System.Web.HttpContext.Current.Session["createdateSTARTDATE"];
object cookieEnd = System.Web.HttpContext.Current.Session["createdateENDDATE"];
string createdateStart = "";
string createdateEnd = "";
if (cookieStart != null)
{
createdateStart = cookieStart.ToString();
}
else
{
if (TYPE == "69")
{
DateTime dtTime = DateTime.Now; //当前时间
DateTime startWeek = dtTime.AddDays(1 - Convert.ToInt32(dtTime.DayOfWeek.ToString("d"))); //本周周一
DateTime endWeek = startWeek.AddDays(4); //本周周五
createdateStart = startWeek.ToString("yyyy-MM-dd");
}
else
{
createdateStart = DateTime.Now.Year.ToString() + "-01-01";
}
} if (cookieEnd != null)
{
if (cookieEnd.ToString() != "")
{
createdateEnd = cookieEnd.ToString() + " 23:59:59";
}
}
else
{
if (TYPE == "69")
{
DateTime dtTime = DateTime.Now; //当前时间
DateTime startWeek = dtTime.AddDays(1 - Convert.ToInt32(dtTime.DayOfWeek.ToString("d"))); //本周周一
DateTime endWeek = startWeek.AddDays(4); //本周周五
createdateEnd = endWeek.ToString("yyyy-MM-dd");
}
else
{
createdateEnd = DateTime.Now.Year.ToString() + "-12-31";
}
}
if (createdateStart != ""&&createdateEnd!="")
{
strWhere += " and [创建日期] >='" + createdateStart + "' and [创建日期] <= '" + createdateEnd + "' ";
}
else if (createdateStart != "" && createdateEnd == "")
{
strWhere += " and [创建日期] >='" + createdateStart + "' ";
}
else if (createdateStart == "" && createdateEnd != "")
{
strWhere += " and [创建日期] <='" + createdateEnd + "' ";
}
if (TYPE != "11")//mod by chairuirui 2013-12-30现场问题处理单(2013.11及以后)加一个检索条件:创建日期
{
object cookieCreater = System.Web.HttpContext.Current.Session["creater"];
if (cookieCreater != null)
{
string creater = cookieCreater.ToString();
if (creater != "")
{
strWhere += " and KANJINAME like '%" + creater + "%'";
}
}
}
}
5779行 这里的括号也给覆盖了
if (type == "66" || type == "69" || type=="11")
{
object cookieStart = System.Web.HttpContext.Current.Session["createdateSTARTDATE"];
object cookieEnd = System.Web.HttpContext.Current.Session["createdateENDDATE"];
string createdateStart = "";
string createdateEnd = "";
//string sStartText = string.Format("{0:" + str_DateFormat + "}", (DateTime.Now.Year.ToString() + "-01-01")); //mod by chairuirui 2013-1-22 日期变成当年的一月一日到12月31日
//string sEndText = string.Format("{0:" + str_DateFormat + "}", (DateTime.Now.Year.ToString() + "-12-31"));
if (cookieStart != null)
{
createdateStart = cookieStart.ToString();
}
else
{
if (type == "69")
{
DateTime dtTime = DateTime.Now; //当前时间
DateTime startWeek = dtTime.AddDays(1 - Convert.ToInt32(dtTime.DayOfWeek.ToString("d"))); //本周周一
DateTime endWeek = startWeek.AddDays(4); //本周周五
createdateStart = startWeek.ToString("yyyy-MM-dd");
}
else
{
createdateStart = DateTime.Now.Year.ToString() + "-01-01";
}
} if (cookieEnd != null)
{
if (cookieEnd.ToString() != "")
{
createdateEnd = cookieEnd.ToString() + " 23:59:59";
}
}
else
{
if (type == "69")
{
DateTime dtTime = DateTime.Now; //当前时间
DateTime startWeek = dtTime.AddDays(1 - Convert.ToInt32(dtTime.DayOfWeek.ToString("d"))); //本周周一
DateTime endWeek = startWeek.AddDays(4); //本周周五
createdateEnd = endWeek.ToString("yyyy-MM-dd");
}
else
{
createdateEnd = DateTime.Now.Year.ToString() + "-12-31";
}
}
if (createdateStart != ""&&createdateEnd!="")
{
contentWhere += " and [createdate] >='" + createdateStart + "' and [createdate] <= '" + createdateEnd + "' ";
}
else if (createdateStart != "" && createdateEnd == "")
{
contentWhere += " and [createdate] >='" + createdateStart + "' ";
}
else if (createdateStart == "" && createdateEnd != "")
{
contentWhere += " and [createdate] <='" + createdateEnd + "' ";
}
if (type != "11")
{
object cookieCreater = System.Web.HttpContext.Current.Session["creater"];
if (cookieCreater != null)
{
string createrName = cookieCreater.ToString();
if (createrName != "")
{
contentWhere += " and KANJINAME like '%" + createrName + "%'";
}
}
}
}