Beispiel #1
0
    /// <summary>
    /// 显示信息
    /// </summary>
    private void ShowInfo()
    {
        string Studentnum = Request.Cookies["StudentCookies"].Values["Snum"].ToString();
        int MySgrade = Int32.Parse(Request.Cookies["StudentCookies"].Values["Sgrade"].ToString());
        int MySclass = Int32.Parse(Request.Cookies["StudentCookies"].Values["Sclass"].ToString());
        string Wid = Request.QueryString["Wid"].ToString();
        string Wcid = Request.QueryString["Wcid"].ToString();
        if (LearnSite.Common.WordProcess.IsNum(Wid) && LearnSite.Common.WordProcess.IsNum(Wcid))
        {
            LearnSite.Model.Works wmodel = new LearnSite.Model.Works();
            LearnSite.BLL.Works ws = new LearnSite.BLL.Works();
            wmodel = ws.GetModel(Int32.Parse(Wid));
            Labelsort.Text = wmodel.Wmsort.ToString();
            Labelegg.Text = wmodel.Wegg.ToString();
            LabelCtitle.Text = "〖" + ws.GetCtitle(Int32.Parse(Wid)) + "〗";
            Labelme.Text = wmodel.Wvote.ToString();
            Labelegg.Text = wmodel.Wegg.ToString();
            Labelhow.Text = ws.HowWorks(Int32.Parse(Wcid), MySgrade, MySclass, Int32.Parse(Labelsort.Text));
            string workIp = wmodel.Wip;
            string worknum = wmodel.Wnum;
            string loginIp = Request.Cookies["StudentCookies"].Values["LoginIp"].ToString();
            bool worklimit = LearnSite.Common.XmlHelp.GetWorkIpLimit();

            if (workIp == loginIp && Studentnum == worknum) //如果作品提交IP和学号跟登录IP学号一致,则显示所有作品
            {
                DataListvote.DataSource = ws.ShowMissionWorks(Int32.Parse(Wcid), MySgrade, MySclass, Int32.Parse(Labelsort.Text), Studentnum);
                DataListvote.DataBind();
                Session[Studentnum] = workIp;//设置IP
            }
            else
            {
                Labelmsg.Text = "你提交作品的Ip与登录投票的Ip不同,不能投票!";
            }
        }
    }