日期:2014-05-20  浏览次数:20908 次

LINQ,根据条件修改。。怎么做!(急)
C# code
//try
            //{
            //    ImdbBean bean = ImdbLogic.tb_MovieByID_MovieLogic(id);
            //    bean.ID_Movie = int.Parse(Request.QueryString["id"]);
            //    bean.Name_CN = this.tb_Name_CN.Text;
            //    bean.Name_EN = this.tb_Name_EN.Text;
            //    bean.Year_Movie = this.tb_Year_Movie.Value;
            //    bean.Url_IMDB = this.tb_Url_IMDB.Text;
            //    bean.Url_Down = this.tb_url_Down.Text;
            //    bean.Date_Down = DateTime.Parse(this.tb_DateDown.Value);
            //    bean.Path_Save = this.tb_path_Save.Text;
            //    bean.Remark = this.tb_Remark.Text;
            //    //电影类型
            //    string Type_Movie = "";
            //    for (int i = 0; i < cbl_type_Movie.Items.Count; i++)
            //    {
            //        if (cbl_type_Movie.Items[i].Selected)
            //        {
            //            Type_Movie += cbl_type_Movie.Items[i].Text + ".";
            //        }
            //    }
            //    bean.Type_Movie = Type_Movie;
            //    //字幕
            //    string subtitle_Movie = "";
            //    for (int i = 0; i < rbl_subtitle_Movie.Items.Count; i++)
            //    {
            //        if (rbl_subtitle_Movie.Items[i].Selected)
            //        {
            //            subtitle_Movie = rbl_subtitle_Movie.Items[i].Text;
            //        }
            //    }
            //    bean.Subtitle_Movie = subtitle_Movie;
            //    //音轨
            //    string track_Movie = "";
            //    for (int i = 0; i < this.rbl_track_Movie.Items.Count; i++)
            //    {
            //        if (rbl_track_Movie.Items[i].Selected)
            //        {
            //            track_Movie = rbl_track_Movie.Items[i].Text;
            //        }
            //    }
            //    bean.Track_Movie = track_Movie;

            //    bool result = ImdbLogic.tb_MovieUpdateLogic(bean);
            //    if (result)
            //    {
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改成功')</script>");
            //    }
            //    else
            //    {
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改失败')</script>");
            //    }
            //}
            //catch (Exception)
            //{

            //    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改有误')</script>");
            //}


这种怎么转呢!


------解决方案--------------------
有修改就该为修改后的值,没有修改,就改为修改前的值,这样想想是不是简单些?

------解决方案--------------------
多条件查询可以考虑使用条件拼接,查询的时候用 or 组合.
------解决方案--------------------
探讨

自己都搞定了!

------解决方案--------------------
http://blog.csdn.net/q107770540/archive/2010/07/09/5724013.aspx