Exemplo n.º 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不同,不能投票!";
            }
        }
    }
Exemplo n.º 2
0
    private void ShowWork()
    {
        string Studentnum = Request.Cookies["StudentCookies"].Values["Snum"].ToString();
        string Wfilename, Wfiletype, Wurl, Wip;
        string Wid = Request.QueryString["Wid"].ToString();
        if (LearnSite.Common.WordProcess.IsNum(Wid))
        {
            LearnSite.Model.Works wmodel=new LearnSite.Model.Works();
            LearnSite.BLL.Works ws = new LearnSite.BLL.Works();
            wmodel=ws.GetModel(Int32.Parse(Wid));
            LabelWnum.Text = wmodel.Wnum;
            Wfilename = wmodel.Wfilename;
            Wurl = wmodel.Wurl;
            Wfiletype = LearnSite.Common.FileDown.FileNameExtension(Wurl);
            string typestr = Wfiletype.Substring(1, Wfiletype.Length - 1);
            ImageType.ImageUrl = "~/Images/FileType/" + typestr.ToLower() + ".gif";
            Labelself.Text = HttpUtility.HtmlDecode(wmodel.Wself);
            Labelsdate.Text = wmodel.Wdate.ToString();
            Labellength.Text = wmodel.Wlength.ToString() + "字节";
            Labelfilename.Text = wmodel.Wfilename;
            LabelWscore.Text = wmodel.Wscore.ToString()+"分";
            Wip = wmodel.Wip;
            TimeSpan ts = DateTime.Now - DateTime.Parse(Labelsdate.Text);
            Labelspan.Text = ts.Days.ToString() + " 天 ";
            Session[Studentnum+"Wurl"] = Wurl;
            string worknum = wmodel.Wnum;
            string LoginIp = Request.Cookies["StudentCookies"].Values["LoginIp"].ToString();
            int days =Int32.Parse( LearnSite.Common.XmlHelp.GetWorkDowntime());//获取作品查看天数

            HyperLinkreturn.NavigateUrl = "~/Student/myvote.aspx?Wid=" + Wid + "&Wcid=" + wmodel.Wcid.ToString() + "&Wmsort="+wmodel.Wmsort.ToString();

            LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission();
            Labelmission.Text = mbll.GetMissionTitle(wmodel.Wmid.Value);
            if (Wip == LoginIp && worknum==Studentnum)
            {

                LBtnfile.Visible = true;
                if (Labelself.Text != "")
                {
                    Btnword.Text = "修改自评";
                }
                else
                {
                    Btnword.Text = "添加自评";
                }
            }
            else
            {
                if (ts.Days > days)
                {
                    Btnword.Text = "添加互评";
                    LBtnfile.Visible = true;

                }
                else
                {
                    Labelmsg.Text = days.ToString()+"天后可查看";
                    LBtnfile.Visible = false;
                }
            }

            //Labelmsg.Text = Wurl;
        }
    }