//初始化编辑页面 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("苏州", "苏州")); } }
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); } } }
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); } } }
//绑定结课资料规则数据 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); } }
//初始化编辑页面 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); } }
//初始化编辑页面 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); } } }
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); } } }
//初始化编辑页面 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); } } }
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)+ " <input type=\"button\" value=\"为" + dv.Rows[i]["archiveItemName"].ToString().Trim() + "添加一个附件\"" + " onclick=\"addIframe(" + fileFolderType + "," + (i + 1).ToString() + "," + (i + 1).ToString() + ");\" />" + " <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); }
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); } } }
public string GetSchoolAttachmentsURL(string aids) { DalOperationAttachments dalOperationAttachments = new DalOperationAttachments(); return dalOperationAttachments.GetAttachmentsList(aids, ref Master.iframeCount, true,string.Empty); }
public string GetURL(string aids) { int a = 0; DalOperationAttachments dalOperationAttachments = new DalOperationAttachments(); return dalOperationAttachments.GetAttachmentsList(aids, ref a, false,string.Empty); }
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); } }
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"); } }
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); } } } }
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(); } }
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); }
//初始化编辑页面 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; } } }