protected void lbDown_Click(object sender, EventArgs e)
    {
        dcUTWDataContext dc = new dcUTWDataContext();
        var Downs           = dc.Downloads.Where(p => p.ID == Convert.ToInt64((sender as LinkButton).CommandArgument.Trim())).Single();

        Downs.DownCount++;

        dc.SubmitChanges();
        Response.Redirect(Downs.Url.Trim());
    }
Example #2
0
    protected void lbDown_Click(object sender, EventArgs e)
    {
        dcUTWDataContext dc = new dcUTWDataContext();
        var dwnUrl          = dc.MovieAddrs.Where(p => p.ID == Convert.ToInt64((sender as LinkButton).CommandArgument.Trim())).Single();

        dwnUrl.DownCount++;
        dc.Movies.Where(p => p.ID == dwnUrl.MovieID).Single().DownCount++;
        dc.SubmitChanges();
        Response.Redirect(dwnUrl.Url.Trim());
    }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(Request.QueryString["id"]))
     {
         dcUTWDataContext dc = new dcUTWDataContext();
         var oneMovie        = dc.Movies.Where(p => p.ID == Convert.ToInt32(Request.QueryString["id"])).Single();
         mpWatch.MediaSource       = oneMovie.WhatUrl.Trim();
         mpWatch.PlaceholderSource = oneMovie.Cover.Trim();
         oneMovie.WatchCount++;
         dc.SubmitChanges();
     }
 }
Example #4
0
    //private void MovieData()
    //{
    //    //dcUTWDataContext dc = new dcUTWDataContext();
    //    //var Movies = dc.Movies.Where(p => p.State == true).Select(p => new { p.ID, p.Name,isThere= dc.Recommends.Select(r=>r.MovieID).Contains(p.ID)});

    //}


    //private Boolean isRecommend(int nID)
    //{
    //    dcUTWDataContext dc = new dcUTWDataContext();
    //    Boolean bln = dc.Recommends.Where(p => p.MovieID == nID).Select(p=>p.MovieID).Contains(nID);
    //    return bln;
    //}

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        dcUTWDataContext dc = new dcUTWDataContext();

        if (dc.Recommends.Select(p => p.MovieID).Contains(Convert.ToInt64(ddlMovies.SelectedValue)) == false)
        {
            Recommend rcm = new Recommend();
            rcm.MovieID = Convert.ToInt64(ddlMovies.SelectedValue);
            rcm.State   = true;
            rcm.AddTime = DateTime.Now;
            dc.Recommends.InsertOnSubmit(rcm);
            dc.SubmitChanges();
        }
        else
        {
            lblMSG.Visible = true;
        }
        gvRecommends.DataBind();
    }