Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request["courseNo"] == null)
     {
         Javascript.GoHistory(-1, Page);
         return;
     }
         experimentId = 0;
         if (CommonUtility.SafeCheckByParams<string>(Request["experimentId"], ref experimentId))
         {
             DalOperationAboutExperiment dalOperationAboutExperiment = new DalOperationAboutExperiment();
             experiment = dalOperationAboutExperiment.GetExperimentById(experimentId);
             experimentResourcesIdt = experiment.experimentResourceId;
         }
         else
         {
             Javascript.GoHistory(-1, Page);
         }
 }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";

        if (!IsPostBack)
        {
            Javascript.ExcuteJavascriptCode("window.onbeforeunload= function(){if($.trim($('#hidOriginalAttachmentId').val())!=$.trim($('#hidAttachmentId').val())){return '温馨提示:实验数据可能未保存哟~(此为提示,并不代表您真正未保存实验数据,请在完成附件上传后点击提交,确保顺利提交实验)';}}", Page);
            HtmlControl liControl = (HtmlControl)Master.Master.FindControl("ContentPlaceHolder1").FindControl("liFragment9");
            liControl.Visible = true;
            liControl.Attributes.Add("class", "ui-tabs-selected");
            UserCookiesInfo UserCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo();
            //设置实验资源ID
            int experimentResourceId = -1;

            if (CommonUtility.SafeCheckByParams<string>(Request["experimentResourceId"], ref experimentResourceId))
            {

                DalOperationAboutExperimentResources DalOperationAboutExperimentResources = new DalOperationAboutExperimentResources();
                DataSet dsExperimentResource = DalOperationAboutExperimentResources.GetExperimentResourcesById(experimentResourceId);
                dlstExperiment.DataSource = dsExperimentResource.Tables[0];
                dlstExperiment.DataBind();
                DateTime deadLine = Convert.ToDateTime(dsExperimentResource.Tables[0].Rows[0]["deadLine"].ToString());

                DalOperationAboutExperiment DalOperationAboutExperiment = new DalOperationAboutExperiment();
                int experimentId = 0;
                bool checkOR = false;

                if (checkOR)
                {
                    experimentspan.InnerHtml += "已经批阅!";
                    btnExperiment.Visible = false;
                    return;
                }
                else if (deadLine.CompareTo(DateTime.Now) <= 0)
                {
                    experimentspan.InnerHtml += "已过截止日期!";
                    btnExperiment.Visible = false;
                    return;
                }

                if (DalOperationAboutExperiment.ExperimentIsCommit(UserCookiesInfo.userNo, experimentResourceId, ref experimentId, ref checkOR))
                {

                    string attachmentids = DalOperationAboutExperiment.GetExperimentById(experimentId).attachmentId.ToString();

                    hidAttachmentId.Value = attachmentids;
                    hidOriginalAttachmentId.Value = attachmentids;

                    experimentspan.InnerHtml = "已提交实验文件列表<br/><br />" + GetSchoolAttachmentsURL(attachmentids);
                }
                experimentspan.InnerHtml += "<input id=\"Button3\" type=\"button\" value=\"点击添加一个附件,可添加多个\" onclick=\"addIframe(" + (int)FileFolderType.experiments + ");\" />&nbsp;&nbsp;<b>上传文件大小不超过</b>" + ConfigurationManager.AppSettings["uploadFileLimit"] + "<div id=\"iframes\"></div>";
            }
        }
    }