Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!UserType.Equals("mana")) { modify.Style.Add("display", "none"); }

            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;
                NoticeAttachment.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��");
                NoticeImportance.Text = (noticeInfo.Importance.HasValue && (noticeInfo.Importance.Value == 1)) ? "<label style='color: #ff0000;'>��Ҫ</label>" : "һ��";
                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);

                // NoticeRole.Text = "����"; //TBD
                NoticePublisherName.Text = (staffInfo == null) ? "<del>��ɾ���û�</del>" : staffInfo.UserName;

                LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                LabMS.Model.Lab labInfo = lab.GetModel(noticeInfo.LabID.Value);

                NoticeLab.Text = (labInfo == null) ? "ȫ��" : labInfo.Lab_Name;
            }
        }
Beispiel #2
0
        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
            }
        }