Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MovieAct userAct = new MovieAct();
         Ruserlist.DataSource = userAct.GetAll ();
         Ruserlist.DataBind();
     }
 }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MovieAct movAct = new MovieAct();
            rep1.DataSource = movAct.GetOldMovies().OrderByDescending(s => s.PlayDay);
            rep1.DataBind();
            if (Request.QueryString["idd"] == null)
            {
                //MessageBox("请先登录后观看视频");
                return;
            }
            User user = userAct.GetByid(Request.QueryString["idd"]);
            if (user == null || user.LoginPassWord != Request.QueryString["pw"])
            {
                //MessageBox("请先登录后观看视频");
                return;
            }

            Movie todayMovie = movAct.GetTodayMovie();
            Movie nextMoive = movAct.GetNextdayMovie();
            if (nextMoive != null)
            {
                Literal2.Text = nextMoive.Name;
                Literal4.Text = nextMoive.Name;
            }
            if (todayMovie == null)
            {
                MessageBox("今天没有可看的最新视频,请联系我们!");
                return;
            }
            ImageButton1.Visible = true;
            Literal1.Text = todayMovie.Name;
            Literal3.Text = todayMovie.Name;

            LimitAct limitAct = new LimitAct();
            Limit limit = limitAct.GetByid(user.Limit.ToString());
            if (limit.NeedIntegral)
            {
                if (limit.CanRepeater == false)
                {
                    ImageButton1.Attributes.Add("onclick", "return confirm('确认观看教学视频?确认观看将扣除你一个积分!');");
                }
                else
                {
                    IList<string> Watcheduser = MyCache.WatchedUser;
                    if (Watcheduser.Contains(user.QQ) == false)
                    {
                        ImageButton1.Attributes.Add("onclick", "return confirm('确认观看教学视频?确认观看将扣除你一个积分!');");
                    }
                }
            }
        }
    }
Example #3
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        User user = userAct.GetByid(Request.QueryString["idd"]);

        LimitAct limitAct = new LimitAct();
        Limit limit = limitAct.GetByid(user.Limit.ToString());

        MovieAct movAct = new MovieAct();
        Movie todayMovie = movAct.GetTodayMovie();

        //是否需要积分观看
        if (limit.NeedIntegral == false)
        {
            StartVideo(todayMovie.URL);
            return;
        }
        else
        {
            if (limit.CanRepeater == false)
            {
                if (user.Jifen < 1)
                {
                    MessageBox("您的积分不够了,请及时充值!");
                    return;
                }
                RedureJifen(user);
                StartVideo(todayMovie.URL);
                return;
            }
            else
            {
                IList<string> Watcheduser = MyCache.WatchedUser;
                if (Watcheduser.Contains(user.QQ))
                {
                    StartVideo(todayMovie.URL);
                    return;
                }
                else
                {
                    if (user.Jifen < 1)
                    {
                        MessageBox("您的积分不够了,请及时充值!");
                        return;
                    }
                    RedureJifen(user);
                    StartVideo(todayMovie.URL);
                    Watcheduser.Add(user.QQ);
                    MyCache.WatchedUser = Watcheduser;

                    return;
                }
            }
        }
    }
Example #4
0
 protected void BTadd0_Click(object sender, EventArgs e)
 {
     string ids= HiddenField1.Value;
     try
     {
         MovieAct act = new MovieAct();
         act.Del(ids);
         MessageBox("删除成功!");
         Ruserlist.DataSource = act.GetAll();
         Ruserlist.DataBind();
     }
     catch (Exception ex)
     {
         MessageBox(ex.Message);
     }
 }
Example #5
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        DateTime firstDay;
        try
        {
            firstDay = Convert.ToDateTime(txtDay.Text.Trim());
        }
        catch (Exception ex)
        {
            MessageBox("请输入正确的日期");
            return;
        }

        try
        {
            string qqs = TextBox2.Text.Trim();
            string[] ids = qqs.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < ids.Length; i++)
            {
                MovieAct userAct = new MovieAct();
                string[] xx = ids[i].Split(new string[] { "----" }, StringSplitOptions.RemoveEmptyEntries);
                if (xx.Length != 2)
                {
                    MessageBox("视频导入格式不正确!");
                    return;
                }
                string name = xx[0];
                string url = xx[1];
                userAct.Add(name, url, firstDay.AddDays(i).ToString());

            }
            //MessageBox("!");
            RunScript("alert('视频导入成功!');window.opener.history.go(0);");
        }
        catch (Exception ex)
        {
            MessageBox(ex.Message);
            throw;
        }
    }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MovieAct movAct = new MovieAct();
            rep1.DataSource = movAct.GetOldMovies().OrderByDescending(s => s.PlayDay);
            rep1.DataBind();

            Movie todayMovie = movAct.GetTodayMovie();
            Movie nextMoive = movAct.GetNextdayMovie();
            if (nextMoive != null)
            {
                Literal2.Text = nextMoive.Name;
                Literal4.Text = nextMoive.Name;
            }
            if (todayMovie != null)
            {
                Literal1.Text = todayMovie.Name;
                Literal3.Text = todayMovie.Name;
            }
        }
    }