Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["courseNo"] == null)
        {
            Javascript.GoHistory(-1, Page);
            return;
        }
        if (!IsPostBack)
        {
            if (CommonUtility.SafeCheckByParams<string>(Request["courseResourceId"], ref courseResourceId))
            {
                DalOperationAboutCourseResources DalOperationAboutCourseResources = new DalOperationAboutCourseResources();
                CourseResources CourseResources = DalOperationAboutCourseResources.GetCourseResourcesbyId(courseResourceId);

                txtTitle.Text = CourseResources.courseResourceTitle;

                hidAttachmentId.Value = CourseResources.attachmentIds;

                if (CourseResources.attachmentIds.Length > 0)
                {
                    DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                    ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(CourseResources.attachmentIds, ref iframeCount, true,string.Empty);
                }
            }
            else
            {
                Javascript.GoHistory(-1, Page);
            }
        }
    }
Пример #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (hidAttachmentId.Value.Length != 0)
        {
            int attachmentId = 0;

            Attachments attachments = null;

            if (CommonUtility.SafeCheckByParams<string>(hidAttachmentId.Value, ref attachmentId))
            {
                DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                attachments = dalOperationAttachments.FindAdminNotifyAttachmentById(attachmentId);
            }

            Thumbnails.CreateImage(Server.MapPath(attachments != null ? attachments.attachmentUrl : "avatar/1-1.gif"));

            DalOperationPatch dalpa = new DalOperationPatch();
            UserCookiesInfo user = BllOperationAboutUser.GetUserCookiesInfo();
            dalpa.SetAvatar(user.userNo, user.userType, attachments != null ? attachments.attachmentUrl : "avatar/1-1.gif");
            Javascript.RefreshParentWindow("BBSUserinfo.aspx", Page);
            return;
        }
        else
        {
            Javascript.GoHistory(-1, "请选择上传文件!", Page);
        }
    }
        //初始化编辑页面
        public void InitialNotifyEdit(int englishExamNotifyInfoId)
        {
            DalOperationAboutEnglishExam dalOperationAboutEnglishExam = new DalOperationAboutEnglishExam();
            EnglishExamNotify englishExamNotify = dalOperationAboutEnglishExam.GetEnglishExamNotifyById(englishExamNotifyInfoId);

            txtTitle.Text = englishExamNotify.englishExamNotifyTitle;

            this.Textarea1.Value = englishExamNotify.englishExamNotifyContent;
            datepicker.Value = englishExamNotify.deadLineTime.ToString("yyyy-MM-dd HH:mm:ss");

            hidAttachmentId.Value = englishExamNotify.attachmentIds;

            if (englishExamNotify.attachmentIds.Length > 0)
            {
                DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(englishExamNotify.attachmentIds, ref iframeCount, true, string.Empty);
            }

            if (englishExamNotify.locale.Trim() == "苏州")
            {
                ddlLocale.Items.Add(new ListItem("苏州", "苏州"));
                ddlLocale.Items.Add(new ListItem("合肥", "合肥"));
            }
            else if (englishExamNotify.locale.Trim() == "合肥")
            {
                ddlLocale.Items.Add(new ListItem("合肥", "合肥"));
                ddlLocale.Items.Add(new ListItem("苏州", "苏州"));
            }
        }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!hasControls(course))
     {
         CommonUtility.RedirectLoginUrl();
         return;
     }
     if (!IsPostBack)
     {
         int topicId=0;
         if (CommonUtility.SafeCheckByParams<string>(Request["topicId"], ref topicId))
         {
             DalOperationAboutBbs dal = new DalOperationAboutBbs();
             DataSet ds = dal.GetTopicAndPostsByTopicId(topicId);
             txtTitle.Text = ds.Tables["1"].Rows[0]["topicTitle"].ToString().Trim();
             Textarea1.Value = ds.Tables["1"].Rows[0]["topicContent"].ToString().Trim();
             hidAttachmentId.Value = ds.Tables["1"].Rows[0]["attachmentIds"].ToString().Trim();
             if ( ds.Tables["1"].Rows[0]["attachmentIds"].ToString().Length > 0)
             {
                 DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                 ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(ds.Tables["1"].Rows[0]["attachmentIds"].ToString(), ref iframeCount, true,string.Empty);
             }
         }
         else
         {
             Javascript.GoHistory(-1, Page);
         }
     }
 }
Пример #5
0
    //绑定结课资料规则数据
    public void DataBindArchivesItems(string teacherType)
    {
        ltlAttachments.Text = string.Empty;

        DalOperationAboutArchivesItems doac = new DalOperationAboutArchivesItems();
        DataTable dv = doac.GetArchivesItemByTeacherType(teacherType, termtag).Tables[0];
        DalOperationAboutArchives doaa = new DalOperationAboutArchives();
        DalOperationAttachments attachment = new DalOperationAttachments();

        Literal ltl = new Literal();

        if (dv.Rows.Count == 0)
        {
            ltl = new Literal();
            ltl.Text = "当前暂无上传结课资料要求<br />";

            phUpload.Controls.Add(ltl);
        }
        else
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(string.Format("<table class=\"datagrid2\"><tr><th>以下为{0}上传的结课资料:</th></tr>", teacherType));

            for (int i = 0; i < dv.Rows.Count; i++)
            {
                sb.Append("<tr><td>" + dv.Rows[i]["archiveItemName"].ToString().Trim() + "</td></tr>");

                DataTable dt = doaa.FindArchivesByCourseNo(courseNo, classID, termtag, teacherType, int.Parse(dv.Rows[i]["archiveItemId"].ToString().Trim())).Tables[0];

                List<string> attachmentIds = new List<string>();

                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    attachmentIds.Add(dt.Rows[j]["attachmentIds"].ToString().Trim());
                }

                string attachments = attachment.GetAttachmentsList(string.Join(",", attachmentIds.ToArray()), ref iframeCount, false, string.Empty);
                sb.Append(attachments.Trim().Length == 0 ? "<tr><td>上传文件列表:未上传</td></tr>" : "<tr><td>上传文件列表:" + attachments + "</td></tr>");
            }
            sb.Append("</table>");

            ltl = new Literal();
            ltl.Text = sb.ToString();
            phUpload.Controls.Add(ltl);
        }
    }
Пример #6
0
        //初始化编辑页面
        public void InitialNotifyEdit(int englishExamNotifyInfoId)
        {
            DalOperationAboutEnglishExam dalOperationAboutEnglishExam = new DalOperationAboutEnglishExam();
            dalOperationAboutEnglishExam.UpdateEnglishExamNotifyHitsById(englishExamNotifyInfoId);
            EnglishExamNotify englishExamNotify = dalOperationAboutEnglishExam.GetEnglishExamNotifyById(englishExamNotifyInfoId);

            ltlTitle.Text = englishExamNotify.englishExamNotifyTitle;

            this.ltlContent.Text = englishExamNotify.englishExamNotifyContent;
            ltlDeadLineTime.Text = englishExamNotify.deadLineTime.ToString();

            if (englishExamNotify.attachmentIds.Length > 0)
            {
                DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(englishExamNotify.attachmentIds, ref iframeCount, true,string.Empty);
            }
        }
Пример #7
0
        //初始化编辑页面
        public void InitialNotifyEdit(int gameCategoryId)
        {
            DalOperationAboutGameCategory dal = new DalOperationAboutGameCategory();
            DataTable dt = dal.Get(gameCategoryId).Tables[0];

            if (dt.Rows.Count > 0)
            {
                ltlTitle.Text = dt.Rows[0]["gameTitle"].ToString().Trim();

                this.ltlContent.Text = dt.Rows[0]["gameContent"].ToString().Trim();
                ltlDeadLineTime.Text = dt.Rows[0]["endTime"].ToString().Trim();

                if (dt.Rows[0]["attachmentIds"].ToString().Trim().Length > 0)
                {
                    DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                    ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(dt.Rows[0]["attachmentIds"].ToString().Trim(), ref iframeCount, true, string.Empty);
                }
            }
        }
Пример #8
0
        public void ProcessRequest(HttpContext context)
        {
            CommonFunction.CheckUser();

            context.Response.ContentType = "text/html";
            if (context.Request["attachmentIds"] != null)
            {
                IList<string> ilist = new List<string>();
                DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                ilist = dalOperationAttachments.GetAttachmentByIds(context.Request["attachmentIds"]);
                if (ilist.Count > 0)
                {
                    string zipedFile = "批量文件_" + UploadFiles.DateTimeString() + ".zip";
                    ZipAndUnZipFile.MultiFilesZip(ilist, context.Server.MapPath("/temp/") + zipedFile, 4096);
                    context.Response.Clear();
                    context.Response.Redirect("/temp/" + zipedFile);
                    context.Response.Flush();
                }
            }
        }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!CommonUtility.SafeCheckByParams<string>(Request["courseNotifyId"], ref courseNotifyId))
        {
            Javascript.GoHistory(-1, Page);
            return;
        }
        if (!IsPostBack)
        {
            DalOperationAboutCourseNotifyInfo DalOperationAboutCourseNotifyInfo = new DalOperationAboutCourseNotifyInfo();
            CoursesNotifyInfo = DalOperationAboutCourseNotifyInfo.GetCourseNotifyInfoById(courseNotifyId);
            txtNotifyTitle.Text = CoursesNotifyInfo.courseNotifyInfoTitle;
            Textarea1.Value = CoursesNotifyInfo.courseNotifyInfoContent;

            hidAttachmentId.Value = CoursesNotifyInfo.attachmentIds;
            if (CoursesNotifyInfo.attachmentIds.Length > 0)
            {
                DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(CoursesNotifyInfo.attachmentIds, ref iframeCount, true, string.Empty);
            }

        }
    }
Пример #10
0
        //初始化编辑页面
        public void InitialNotifyEdit(int englishExamNotifyInfoId)
        {
            DalOperationAboutGameCategory dal = new DalOperationAboutGameCategory();
            DataTable dt = dal.Get(gameCategoryId).Tables[0];

            if (dt.Rows.Count > 0)
            {
                txtGameTitle.Text = dt.Rows[0]["gameTitle"].ToString().Trim();

                txttGameContent.Text = dt.Rows[0]["gameContent"].ToString().Trim();

                startTime.Value = Convert.ToDateTime(dt.Rows[0]["startTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");
                endTime.Value = Convert.ToDateTime(dt.Rows[0]["endTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");

                string _attachmentIds = dt.Rows[0]["attachmentIds"].ToString().Trim();

                hidAttachmentId.Value = _attachmentIds;
                if (_attachmentIds.Length > 0)
                {
                    DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                    ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(_attachmentIds, ref iframeCount, true, string.Empty);
                }
            }
        }
Пример #11
0
    public void ProcessRequest(HttpContext context)
    {
        CommonFunction.CheckUser();

        context.Response.CacheControl = "no-cache";
        string hidFrId = string.Empty;
        string hiddenId = string.Empty;
        string hidFileFolderType = string.Empty;

        try
        {
            //禁止网站外提交表单
            if (context.Request.ServerVariables["HTTP_REFERER"] != null)
            {
                if (context.Request.ServerVariables["SERVER_NAME"].ToLower().Trim() != context.Request.ServerVariables["HTTP_REFERER"].ToLower().Trim().Substring(7, context.Request.ServerVariables["SERVER_NAME"].ToLower().Trim().Length))
                {
                    return;
                }
            }
            else
            {
                return;
            }

            if (context.Request.Form["hidFileFolderType"] != null)
            {
                hidFrId = context.Request.Form["hidFrId"];
                hiddenId = context.Request.Form["hidHiddenId"];
                hidFileFolderType = context.Request.Form["hidFileFolderType"];
            }

            if (context.Request.Files.Count > 0)
            {
                HttpPostedFile file = context.Request.Files[0];

                if (UploadFiles.IsAllowedExtension(file.FileName))
                {
                    DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                    Attachments attachments = null;
                    attachments = UploadFiles.doUpload(file,
                        int.Parse(hidFileFolderType),
                        BllOperationAboutUser.GetUserCookiesInfo());
                    attachments = dalOperationAttachments.AddAdminNotifyAttachment(attachments);
                    context.Response.Write("<script type='text/javascript'>if(window.top.document.getElementById('TB_iframeContent')==null){window.top.uploadSuccess('"
                        + hidFrId + "','" + attachments.attachmentId + "','"
                        + attachments.attachmentTitle + "'," + hidFileFolderType + ",'" + hiddenId +
                        "');} else{window.top.document.getElementById('TB_iframeContent').contentWindow.uploadSuccess('"
                        + hidFrId + "','" + attachments.attachmentId + "','" + attachments.attachmentTitle + "'," + hidFileFolderType + ",'" + hiddenId + "');}</script>");
                    context.Response.Flush();
                }
                else
                {
                    context.Response.Write("<script>window.top.uploadError('" + hidFrId + "','" + hidFileFolderType + "', '上传文件类型有误!请重新选择文件上传');</script>");
                    context.Response.Flush();
                }
            }
            else
            {
                return;
            }
        }
        catch (Exception ex)
        {
            MongoDBLog.LogRecord(ex);
            context.Response.Write("<script>window.top.uploadError('" + hidFrId + "','" + hidFileFolderType + "', '上传失败,请重新上传或者向管理员通知此错误');</script>");
        }
    }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["courseNo"] == null||!CommonUtility.SafeCheckByParams<string>(Request["schoolworkNotifyId"], ref schoolworkNotifyId))
        {
            Javascript.GoHistory(-1, Page);
            return;
        }

        if (!IsPostBack)
        {
            DalOperationAboutCourses dalOperationAboutCourses = new DalOperationAboutCourses();
            schoolWorkNotify = dalOperationAboutCourses.GetSchoolworkNotifyById(schoolworkNotifyId);
            this.txtTitle.Text = schoolWorkNotify.schoolWorkNotifyTitle;
            this.Textarea1.Value = schoolWorkNotify.schoolWorkNotifyContent;
            datepicker.Value = schoolWorkNotify.deadline.ToString("yyyy-MM-dd HH:mm:ss");
            if (schoolWorkNotify.isOnline)
                this.ddltOnline.SelectedValue = "true";
            else
                this.ddltOnline.SelectedValue = "false";

            hidAttachmentId.Value = schoolWorkNotify.attachmentIds;
            if (schoolWorkNotify.attachmentIds.Length > 0)
            {
                DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(schoolWorkNotify.attachmentIds, ref iframeCount, true,string.Empty);
            }
        }
    }
Пример #13
0
 public string GetURL(string aids)
 {
     int a = 0;
     DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
     return dalOperationAttachments.GetAttachmentsList(aids, ref a, false,string.Empty);
 }
Пример #14
0
    public int fileFolderType = (int)FileFolderType.archives; //结课资料文件

    #endregion Fields

    #region Methods

    //绑定结课资料规则数据
    public void DataBindArchivesItems()
    {
        DalOperationAboutArchivesItems doac = new DalOperationAboutArchivesItems();
        DataTable dv = doac.GetArchivesItemByTeacherType(Master.teacherType, Master.termtag).Tables[0];
        DalOperationAboutArchives doaa = new DalOperationAboutArchives();
        DalOperationAttachments attachment = new DalOperationAttachments();

        Literal ltl = new Literal();

        if (dv.Rows.Count == 0)
        {
            btnUpload.Visible = false;
            ltl = new Literal();
            ltl.Text = "当前暂无上传结课资料要求";

            phUpload.Controls.Add(ltl);
            return;
        }

        Table tb = new Table();
        tb.CssClass = "tableAddStyleNone";
        tb.Width = Unit.Percentage(100);

        for (int i = 0; i < dv.Rows.Count; i++)
        {
            TableRow tr = new TableRow();
            TableCell td = new TableCell();
            td.HorizontalAlign = HorizontalAlign.Left;
            td.CssClass = "border";
            td.Width = Unit.Percentage(10);

            HiddenField hid = new HiddenField();
            hid.ID = "hid_" + dv.Rows[i]["archiveItemId"].ToString().Trim();
            hid.ClientIDMode = ClientIDMode.Static;

            ltl = new Literal();
            ltl.Text = dv.Rows[i]["archiveItemName"].ToString().Trim() + ":";

            td.Controls.Add(ltl);
            td.Controls.Add(hid);
            tr.Cells.Add(td);

            td = new TableCell();
            td.HorizontalAlign = HorizontalAlign.Left;
            td.CssClass = "border";

            DataTable dt = doaa.FindArchivesByCourseNo(Master.courseNo, Master.classID, Master.termtag, Master.teacherType, int.Parse(dv.Rows[i]["archiveItemId"].ToString().Trim())).Tables[0];

            List<string> attachmentIds = new List<string>();

            for (int j = 0; j < dt.Rows.Count; j++)
            {
                attachmentIds.Add(dt.Rows[j]["attachmentIds"].ToString().Trim());
            }

            string attachments = attachment.GetAttachmentsList(string.Join(",", attachmentIds.ToArray()), ref Master.iframeCount, true, (i + 1).ToString());
            ltl = new Literal();
            ltl.Text = (attachments.Trim().Length == 0 ? "未上传" : attachments)+ "&nbsp;&nbsp;<input type=\"button\" value=\"为" + dv.Rows[i]["archiveItemName"].ToString().Trim() + "添加一个附件\"" + " onclick=\"addIframe(" + fileFolderType +
        "," + (i + 1).ToString() + "," + (i + 1).ToString() + ");\" />" + "&nbsp;&nbsp;<b>上传文件大小不超过</b>" + ConfigurationManager.AppSettings["uploadFileLimit"] + "<div id=\"iframes" + (i + 1).ToString() + "\"></div><br />";

            hid = new HiddenField();
            hid.ID = "hidAttachmentId" + (i + 1).ToString();
            hid.ClientIDMode = ClientIDMode.Static;
            hid.Value = string.Join(",", attachmentIds.ToArray());
            td.Controls.Add(ltl);
            td.Controls.Add(hid);
            tr.Cells.Add(td);

            tb.Rows.Add(tr);
        }

        phUpload.Controls.Add(tb);
    }
Пример #15
0
 public string GetSchoolAttachmentsURL(string aids)
 {
     DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
     return dalOperationAttachments.GetAttachmentsList(aids, ref Master.iframeCount, true,string.Empty);
 }
Пример #16
0
    protected void ViewAdminNotify()
    {
        int notifyId = -1;
        if (CommonUtility.SafeCheckByParams<string>(Request["adminNotifyInfoId"], ref notifyId))
        {
            DalOperationAboutAdminNotify dal = new DalOperationAboutAdminNotify();

            //浏览次数加1
            dal.AddScanCount(notifyId);

            DataSet adminNotify = dal.FindNotifybyNo(notifyId);
            news.DataSource = adminNotify.Tables[0];
            news.DataBind();

            if (adminNotify.Tables[0].Rows[0]["attachmentIds"].ToString().Length > 0)//有附件则显示
            {
                DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
            }

        }
        else
        {
            Javascript.GoHistory(-1, Page);
        }
    }
Пример #17
0
    protected void BindGradeCheckNotify()
    {
        StudentsGradeCheckConfig model = new StudentsGradeCheckConfig { notifyTitle = string.Empty, notifyContent = string.Empty };

        DalOperationAboutGradeCheck dos = new DalOperationAboutGradeCheck();
        DataTable dt = dos.GetGradeCheckDocument().Tables[0];

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            model.notifyTitle = dt.Rows[i]["notifyTitle"].ToString().Trim();
            model.notifyContent = dt.Rows[i]["notifyContent"].ToString().Trim();
            model.attachmentIds = dt.Rows[i]["attachmentIds"].ToString().Trim();
        }

        txtNotifyTitle.Text = model.notifyTitle;
        txtNotifyContent.Text = model.notifyContent;
        hidAttachmentId.Value = model.attachmentIds;

        if (model.attachmentIds.Length > 0)
        {
            DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
            spanAttachment.InnerHtml = dalOperationAttachments.GetAttachmentsList(model.attachmentIds, ref iframeCount, true, string.Empty);
        }
    }
Пример #18
0
    protected void BindGradeCheckExcelTemplate(HtmlGenericControl span,bool isDelete)
    {
        DalOperationAboutGradeCheck dos = new DalOperationAboutGradeCheck();
        DataTable dt = dos.GetGradeCheckExcelTemplate().Tables[0];

        string _ids = string.Empty;

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            _ids = dt.Rows[i]["excelTemplateAttachmentIds"].ToString().Trim();
        }

        hidAttachmentId1.Value = _ids;

        if (_ids.Length > 0)
        {
            DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
            span.InnerHtml = dalOperationAttachments.GetAttachmentsList(_ids, ref iframeCount1, isDelete, "1");
        }
    }
Пример #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (CommonUtility.SafeCheckByParams<string>(Request["experimentResourceId"], ref experimentResourceId))
            {
                if (Request["courseNo"] == null)
                {
                    Javascript.GoHistory(-1, Page);
                    return;
                }
                DalOperationAboutExperimentResources DalOperationAboutExperimentResources = new DalOperationAboutExperimentResources();
                experimentResources = DalOperationAboutExperimentResources.GetExperimentResourcesbyId(experimentResourceId);
                txtTitle.Text = experimentResources.experimentResourceTitle;
                Textarea1.Value = experimentResources.experimentResourceContent;
                datepicker.Value = experimentResources.deadLine.ToString("yyyy-MM-dd HH:mm:ss");

                hidAttachmentId.Value = experimentResources.attachmentIds;
                if (experimentResources.attachmentIds.Length > 0)
                {
                    DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                    ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(experimentResources.attachmentIds, ref iframeCount, true,string.Empty);
                }
            }
        }
    }
Пример #20
0
        protected string GetArchivesList(string teacherType, string courseNo, string classID, string termtag)
        {
            //已经有的附件数,页面初始化时与前端JS进行交互
            int iframeCount = 0;

            DalOperationAboutArchivesItems doac = new DalOperationAboutArchivesItems();
            DataTable dv = doac.GetArchivesItemByTeacherType(teacherType, termtag).Tables[0];
            DalOperationAboutArchives doaa = new DalOperationAboutArchives();
            DalOperationAttachments attachment = new DalOperationAttachments();

            Literal ltl = new Literal();

            if (dv.Rows.Count == 0)
            {
                return "当前暂无" + teacherType + "上传结课资料的要求<br />";
            }
            else
            {
                StringBuilder sb = new StringBuilder();

                sb.Append(string.Format("<table class=\"datagrid2\"><tr><th colspan=\"2\">以下为{0}上传的结课资料:</th></tr>", teacherType));

                for (int i = 0; i < dv.Rows.Count; i++)
                {
                    sb.Append("<tr><td width=\"15%\">" + dv.Rows[i]["archiveItemName"].ToString().Trim() + ":</td>");

                    DataTable dt = doaa.FindArchivesByCourseNo(courseNo, classID, termtag, teacherType, int.Parse(dv.Rows[i]["archiveItemId"].ToString().Trim())).Tables[0];

                    List<string> attachmentIds = new List<string>();

                    for (int j = 0; j < dt.Rows.Count; j++)
                    {
                        attachmentIds.Add(dt.Rows[j]["attachmentIds"].ToString().Trim());
                    }

                    string attachments = attachment.GetAttachmentsList(string.Join(",", attachmentIds.ToArray()), ref iframeCount, false, string.Empty);
                    sb.Append(attachments.Trim().Length == 0 ? "<td>上传文件列表:未上传</td></tr>" : "<td>上传文件列表:" + attachments + "</td></tr>");
                }
                sb.Append("</table>");
                return sb.ToString();
            }
        }
Пример #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //查看结课资料
        if (!IsPostBack)
        {
            DalOperationAboutCourses doac = new DalOperationAboutCourses();
            course = doac.GetCoursesByNo(courseNo, classID, termtag);
            if (course == null)
            {
                course = new Courses { courseNo = courseNo, classID = classID, termTag = termtag };
            }

            ltlAttachments.Text = "该课程还没有上传期末资料归档!";

            DalOperationAboutArchives doaa = new DalOperationAboutArchives();

            if (doaa.IsExistArchivesBycourseNoCompatible(courseNo, classID, termtag) != 0)
            {
                string attachmentIds = doaa.FindArchivesByCourseNoCompatible(courseNo, classID, termtag).attachmentIds;
                DalOperationAttachments attachment = new DalOperationAttachments();
                string _attachmentIds = attachment.GetAttachmentsList(attachmentIds, ref iframeCount, false,string.Empty);
                ltlAttachments.Text = _attachmentIds.Trim().Length == 0 ? "未上传资料" : _attachmentIds;
            }

            DataBindArchivesItems("教师");
            DataBindArchivesItems("助教");
        }
    }
 public string GetURL(string aids)
 {
     DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
     return dalOperationAttachments.GetAttachmentsList(aids, ref iframeCount, false, string.Empty);
 }
Пример #23
0
    //初始化编辑页面
    public void InitialNotifyEdit(int notifyId)
    {
        DalOperationAboutAdminNotify doan = new DalOperationAboutAdminNotify();
        AdminNotifyInfo notify = doan.FindNotifyByNo(notifyId);
        if (notify == null)
        {
            Javascript.AlertAndRedirect("要修改的信息不存在,请检查!", "/Administrator/NotifyInfoManage.aspx", Page);
        }
        else
        {
            //通知或办事流程
            ddlNotifyType.SelectedValue = notify.notifyTypeId.ToString().Trim();

            txtTitle.Text = notify.notifyTitle;

            this.Textarea1.Value = notify.notifyContent;

            hidAttachmentId.Value = notify.attachmentIds;

            if (notify.attachmentIds.Length > 0)
            {
                DalOperationAttachments dalOperationAttachments = new DalOperationAttachments();
                ltlAttachment.Text = dalOperationAttachments.GetAttachmentsList(notify.attachmentIds, ref iframeCount, true,string.Empty);
            }
        }

        DalOperationAboutAdminNotifyType dalNotifyType = new DalOperationAboutAdminNotifyType();
        DataTable dt = dalNotifyType.FindAllParentAdminNotifyType().Tables[0];

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            ListItem _item = new ListItem(dt.Rows[i]["notifyTypeName"].ToString().Trim(), dt.Rows[i]["notifyTypeId"].ToString().Trim());
            ddlNotifyType.Items.Add(_item);
        }

        if (dalNotifyType.FindParentIdById(notify.notifyTypeId).Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < ddlNotifyType.Items.Count; i++)
            {

                if (ddlNotifyType.Items[i].Value.ToString().Trim() == dalNotifyType.FindParentIdById(notify.notifyTypeId).Tables[0].Rows[0]["parentId"].ToString().Trim())
                {
                    ddlNotifyType.SelectedIndex = i;
                }
            }

            DataTable _dt = dalNotifyType.FindAllAdminNotifyTypeByParentId(int.Parse(ddlNotifyType.SelectedValue)).Tables[0];

            for (int j = 0; j < _dt.Rows.Count; j++)
            {
                ddlNotifyTypeChild.Items.Add(new ListItem(_dt.Rows[j]["notifyTypeName"].ToString().Trim(), _dt.Rows[j]["notifyTypeId"].ToString().Trim()));
            }
        }

        for (int i = 0; i < ddlNotifyTypeChild.Items.Count; i++)
        {
            if (ddlNotifyTypeChild.Items[i].Value.ToString().Trim() == notify.notifyTypeId.ToString().Trim())
            {
                ddlNotifyTypeChild.SelectedIndex = i;
            }
        }
    }