//������ʵ���� �����б�� protected void LabDropdownlist() { LabMS.BLL.Lab lab = new LabMS.BLL.Lab(); DataSet ds = new DataSet(); ds = lab.GetList("Lab_ParentID is null"); LabDDL.DataSource = ds; LabDDL.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("FBTZ"); strPageUserType.Add("mana"); if (!Page.IsPostBack) { LabMS.BLL.Lab lab = new LabMS.BLL.Lab(); DataSet dsLab = lab.GetList(" Lab_ParentID is null "); LabList.DataTextField = "Lab_Name"; LabList.DataValueField = "ID"; LabList.DataSource = dsLab.Tables[0].DefaultView; LabList.DataBind(); LabList.Items.Add(new ListItem("ȫ��", "-1")); LabList.Items[LabList.Items.Count - 1].Selected = true; } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("FBTZ"); strPagePrivilege.Add("CKTZ"); strPageUserType.Add("mana"); if (!Page.IsPostBack) { #region Get id int id; if (string.IsNullOrEmpty(Request.QueryString["id"])) { throw new Exception("�Բ����������ʵ�ҳ�治����"); } try { id = int.Parse(Request.QueryString["id"]); } catch { throw new Exception("�Բ����������ʵ�ҳ�治����"); } #endregion LabMS.Model.Announcement noticeInfo; ExtendBLL.Announcement notice = new ExtendBLL.Announcement(); noticeInfo = notice.GetModel(id); if (noticeInfo == null) { throw new Exception("�Բ����������ʵ�ҳ�治����"); } NoticeTitle.Text = noticeInfo.AnnouncementTitle; NoticeAttachmentFile.Text = string.IsNullOrEmpty(noticeInfo.AttachmentPath) ? "<label style='color: #ff0000;'>������</label>" : "<a target='_blank' href='" + noticeInfo.AttachmentPath + "' >������ظ���</a>"; NoticeContent.Text = Server.HtmlDecode(noticeInfo.AnnouncementContent); NoticeExpireTime.Text = noticeInfo.ExpireTime.Value.ToString("yyyy-MM-dd"); ImportanceValue.Value = (noticeInfo.Importance.HasValue && (noticeInfo.Importance.Value == 1)) ? "1" : "0"; NoticePubTime.Text = noticeInfo.PublishTime.Value.ToString("yyyy��MM��dd�� HH:mm"); LabMS.BLL.UserTable staff = new LabMS.BLL.UserTable(); LabMS.Model.UserTable staffInfo = staff.GetModel(noticeInfo.PublisherID.Value); NoticePublisherName.Text = (staffInfo == null) ? "<del>��ɾ���û�</del>" : staffInfo.UserName; #region Get Lab LabMS.BLL.Lab lab = new LabMS.BLL.Lab(); DataSet dsLabs = lab.GetList(" Lab_ParentID is null "); LabList.Items.Add(new ListItem("ȫ��", "-1")); foreach (DataRow dr in dsLabs.Tables[0].Rows) { ListItem li = new ListItem(); li.Text = dr["Lab_Name"].ToString(); li.Value = dr["ID"].ToString(); if (noticeInfo.LabID.Equals(int.Parse(li.Value))) { li.Selected = true; } LabList.Items.Add(li); } #endregion } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("QBZY"); strPageUserType.Add("mana"); strPageUserType.Add("teacher"); if (!Page.IsPostBack) { try { #region Get id int id; if (string.IsNullOrEmpty(Request.QueryString["id"])) { throw new Exception("�Բ����������ʵ�ҳ�治����"); } try { id = int.Parse(Request.QueryString["id"]); } catch { throw new Exception("�Բ����������ʵ�ҳ�治����"); } #endregion LabMS.Model.Resource resourceInfo; ExtendBLL.Resource resource = new ExtendBLL.Resource(); resourceInfo = resource.GetModel(id); if (resourceInfo == null) { throw new Exception("�Բ����������ʵ�ҳ�治����"); } #region ��ȡʵ���� LabMS.BLL.Lab lab = new LabMS.BLL.Lab(); DataSet dsLabs = lab.GetList(" Lab_ParentID is null "); ResourceLab.Items.Add(new ListItem("ȫ��", "-1")); foreach (DataRow dr in dsLabs.Tables[0].Rows) { ListItem li = new ListItem(); li.Text = dr["Lab_Name"].ToString(); li.Value = dr["ID"].ToString(); if (resourceInfo.LabID.Equals(int.Parse(li.Value))) { li.Selected = true; } ResourceLab.Items.Add(li); } #endregion if (resourceInfo.RecorderType.Equals(0)) // ����Ա { LabMS.BLL.UserTable staff = new LabMS.BLL.UserTable(); LabMS.Model.UserTable staffInfo = staff.GetModel(resourceInfo.ResourceRecorder.HasValue ? resourceInfo.ResourceRecorder.Value : 0); ResourceRecorder.Text = (staffInfo == null) ? "<del>��ɾ���û�</del>" : staffInfo.UserName + " ����Ա"; } else if (resourceInfo.RecorderType == 1) { LabMS.BLL.Teacher teacher = new LabMS.BLL.Teacher(); LabMS.Model.Teacher teacherInfo = teacher.GetModel(resourceInfo.ResourceRecorder.HasValue ? resourceInfo.ResourceRecorder.Value : 0); ResourceRecorder.Text = (teacherInfo == null) ? "<del>��ɾ���û�</del>" : teacherInfo.Teacher_Name + " ��ʦ"; } // ResourceType.Text = resourceInfo.ResourceType.HasValue ? resourceInfo.ResourceType.Value.ToString() : ""; // TBD ResourceTitle.Text = resourceInfo.ResourceTitle; ResourceContent.Text = Server.HtmlDecode(resourceInfo.ResourceContent); ResourceVisitTime.Text = (resourceInfo.ResourceVisitTime.Value + 1).ToString(); ResourceRecordTime.Text = resourceInfo.ResourceRecordTime.Value.ToString("yyyy��MM��dd�� hh:mm"); if (!string.IsNullOrEmpty(resourceInfo.ResourceAttachmentPath)) { ResourceAttachment.Text = "<a target='_blank' href='" + resourceInfo.ResourceAttachmentPath + "' >������ظ���</a>"; } else { ResourceAttachment.Text = "<label style='color: #ff0000;'>������</label>"; } #region Tags DataSet dsTags = resource.GetTags(resourceInfo); System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = dsTags.Tables[0].Rows.Count - 1; i > -1; i--) { sb.Append(dsTags.Tables[0].Rows[i]["TagName"]); if (i != 0) { sb.Append(","); } } ResourceTags.Text = sb.ToString(); #endregion } catch (Exception ex) { } } }