当前位置: 首页>>代码示例>>C#>>正文


C# DataEntities.AddToMovieUrlKuaib方法代码示例

本文整理汇总了C#中Voodoo.Basement.DataEntities.AddToMovieUrlKuaib方法的典型用法代码示例。如果您正苦于以下问题:C# DataEntities.AddToMovieUrlKuaib方法的具体用法?C# DataEntities.AddToMovieUrlKuaib怎么用?C# DataEntities.AddToMovieUrlKuaib使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Voodoo.Basement.DataEntities的用法示例。


在下文中一共展示了DataEntities.AddToMovieUrlKuaib方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btn_Save_Click

        protected void btn_Save_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();

            movieID = WS.RequestInt("movieid", 0);
            MovieInfo movie = //MovieInfoView.GetModelByID(movieID.ToS());
                (from l in ent.MovieInfo where l.id == movieID select l).FirstOrDefault();
            #region deal
            switch (type)
            {
                case "kuaib":
                    var kuaibUrl = (from l in ent.MovieUrlKuaib where l.id == id select l).FirstOrDefault();
                    kuaibUrl.MovieTitle = movie.Title;
                    kuaibUrl.Title = txt_Title.Text;
                    kuaibUrl.Url = txt_Url.Text;
                    kuaibUrl.MovieID = movie.id;
                    kuaibUrl.UpdateTime = DateTime.Now;

                    if (kuaibUrl.id <= 0)
                    {
                        ent.AddToMovieUrlKuaib(kuaibUrl);
                    }
                    break;
                case "baidu":
                    var baiduUrl = (from l in ent.MovieUrlBaidu where l.id == id select l).FirstOrDefault();
                    baiduUrl.MovieTitle = movie.Title;
                    baiduUrl.Title = txt_Title.Text;
                    baiduUrl.Url = txt_Url.Text;
                    baiduUrl.MovieID = movie.id;
                    baiduUrl.UpdateTime = DateTime.Now;
                    if (baiduUrl.id <= 0)
                    {
                        ent.AddToMovieUrlBaidu(baiduUrl);
                    }
                    break;
                case "mag":
                    var magUrl = (from l in ent.MovieUrlMag where l.id == id select l).FirstOrDefault();
                    magUrl.MovieTitle =  movie.Title;
                    magUrl.Title = txt_Title.Text;
                    magUrl.Url = txt_Url.Text;
                    magUrl.MovieID = movie.id;
                    magUrl.UpdateTime = DateTime.Now;
                    if (magUrl.id <= 0)
                    {
                        ent.AddToMovieUrlMag(magUrl);
                    }
                    break;
            }
            #endregion
            ent.SaveChanges();
            ent.Dispose();

            Response.Redirect("UrlList.aspx?type=" + type + "&movieid="+movieID);
        }
开发者ID:svn2github,项目名称:KCMS2,代码行数:54,代码来源:UrlEdit.aspx.cs


注:本文中的Voodoo.Basement.DataEntities.AddToMovieUrlKuaib方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。