日期:2014-05-18  浏览次数:20375 次

初级问题,请各位帮忙
类似搜索页面,因为判断条件多,求一个简单些的方法,我写的好烦琐,下面就是我写的,还只是一部分的判断呢,请帮忙

    if   (topCount1   ==   " "   ||   topCount1   ==   null)
                {
                        if   (other1   ==   "1 ")
                        {
                                DB1   db1   =   new   DB1();
                                string   Sql   =   "select   *   from   ProductBaseInfo ";
                                db1.SetDataBinding(dg,   Sql);
                                db1.CloseDataBase();
                        }
                        if   (other1   ==   "2 ")
                        {
                                DB1   db1   =   new   DB1();
                                string   Sql   =   "select   *   from   ProductBaseInfo ";
                                db1.SetDataBinding(dg,   Sql);
                                db1.CloseDataBase();
                        }
                        if   (other1   ==   "3 ")
                        {
                                DB1   db1   =   new   DB1();
                                string   Sql   =   "select   *   from  
                                db1.SetDataBinding(dg,   Sql);
                                db1.CloseDataBase();
                        }
                        if   (other1   ==   " "   ||   other1   ==   null)
                        {
                        &nbs