修改内容

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 + "%'";
                        }
                    }
                }
            }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值