Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("QBZY");

            if (!UserType.Equals("mana")) { modify.Style.Add("display", "none"); }

            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("�Բ����������ʵ�ҳ�治����");
                    }

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

                    ResourceLab.Text = (labInfo == null) ? "ȫ��" : labInfo.Lab_Name;

                    if (resourceInfo.RecorderType == 0) // ����Ա
                    {
                        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

                    resourceInfo.ResourceVisitTime += 1;
                    resource.Update(resourceInfo);

                }
                catch (Exception ex)
                {
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 处理DS
        /// </summary>
        /// <param name="ds"></param>
        /// <returns></returns>
        protected DataSet HandleData(DataSet ds)
        {
            ds.Tables[0].Columns.Add("LabName");
            ds.Tables[0].Columns.Add("RecorderName");
            ds.Tables[0].Columns.Add("AttatchmentPath");

            LabMS.Model.Lab labInfo;
            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();

            for (int i = ds.Tables[0].Rows.Count - 1; i > -1; i--)
            {
                int labID = int.Parse(ds.Tables[0].Rows[i]["LabID"].ToString());
                labInfo = lab.GetModel(labID);

                ds.Tables[0].Rows[i]["LabName"] = (labInfo != null) ? labInfo.Lab_Name : "全部";

                if (ds.Tables[0].Rows[i]["ResourceRecorderType"].ToString() == "0") // 管理员
                {
                    BLL.UserTable ut = new LabMS.BLL.UserTable();
                    LabMS.Model.UserTable utInfo = ut.GetModel(int.Parse(ds.Tables[0].Rows[i]["ResourceRecorder"].ToString()));

                    ds.Tables[0].Rows[i]["RecorderName"] = (utInfo == null) ? "<del>已删除管理员</del>" : utInfo.UserName + " 管理员";
                }
                else
                {
                    BLL.Teacher teacher = new LabMS.BLL.Teacher();
                    LabMS.Model.Teacher teacherInfo = teacher.GetModel(int.Parse(ds.Tables[0].Rows[i]["ResourceRecorder"].ToString()));

                    ds.Tables[0].Rows[i]["RecorderName"] = (teacherInfo == null) ? "<del>已删除老师</del>" : teacherInfo.Teacher_Name + " 老师";
                }

                ds.Tables[0].Rows[i]["AttatchmentPath"] = ds.Tables[0].Rows[i]["ResourceAttachmentPath"];
            }

            return ds;
        }
Exemplo n.º 4
0
        //��ȡʵ������ͨ��ID
        protected string GetLabNameByID(int ID)
        {
            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
            LabMS.Model.Lab labModel = new LabMS.Model.Lab();

            labModel = lab.GetModel(ID);

            return labModel.Lab_Name;
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("SYSXX");
            strPageUserType.Add("mana");
            if (Request.QueryString["ID"] != null)
            {
                LabName = "ʵ����";
                if (!IsPostBack)
                {
                    int ID;
                    if (int.TryParse(Request.QueryString["ID"].ToString(), out ID))
                    {
                        List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();
                        LabMS.Model.Lab labModel = new LabMS.Model.Lab();
                        try
                        {
                            //��ȡ����ʵ������Ϣ
                            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                            labModel = lab.GetModel(ID);
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }

                        //��ʵ�����
                        list = DictionaryDropdownlist("111");
                        LabKindDDL.DataSource = list;
                        LabKindDDL.DataBind();
                        LabKindDDL.SelectedValue = labModel.Lab_Type;

                        //��ʵ������
                        list = DictionaryDropdownlist("112");
                        LabTypeDDL.DataSource = list;
                        LabTypeDDL.DataBind();
                        LabTypeDDL.SelectedValue = labModel.Lab_Type;

                        //��ʵ�鼶��
                        list = DictionaryDropdownlist("113");
                        LabLevelDDL.DataSource = list;
                        LabLevelDDL.DataBind();
                        LabLevelDDL.SelectedValue = labModel.Lab_Level;

                        //�󶨽�������
                        list = DictionaryDropdownlist("114");
                        AwardLevelDDL.DataSource = list;
                        AwardLevelDDL.DataBind();
                        AwardLevelDDL.SelectedValue = labModel.Lab_AwardLevel;

                        //��ʵ����״̬
                        list = DictionaryDropdownlist("115");
                        StatusDDL.DataSource = list;
                        StatusDDL.DataBind();
                        StatusDDL.SelectedValue = labModel.Lab_State;

                        //������ʵ����
                        LabDropdownlist();
                        LabDDL.SelectedValue = ID.ToString();
                    }
                    else
                    {
                        SaveBtn.Visible = false;
                        ERRLbl.Text = "ϵͳ�쳣��URL�������Ϸ���";
                        ERRLbl.Visible = true;
                    }
                }
            }
            else if (Request.QueryString["SubID"] != null)
            {
                if (!IsPostBack)
                {
                    int SubID;
                    if (int.TryParse(Request.QueryString["SubID"].ToString(), out SubID))
                    {
                        ViewState["SubID"] = SubID;
                        LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                        List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();
                        LabMS.Model.Lab labModel = new LabMS.Model.Lab();
                        LabMS.BLL.Location loc = new LabMS.BLL.Location();
                        List<LabMS.Model.Location> locModel = new List<LabMS.Model.Location> ();
                        try
                        {
                            labModel = lab.GetModel(SubID);
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }

                        LabNumTBX.Text = labModel.Lab_Code;//���
                        LabNameTBX.Text = labModel.Lab_Name;//����
                        LabName = labModel.Lab_Name;
                        SetUpDateTBX.Text = string.Format("{0:d}",labModel.Lab_SetupTime);//����
                        ManagerTBX.Text = labModel.Lab_InCharge;//������
                        TelTBX.Text = labModel.Lab_Phone;//�绰
                        CurriculumTBX.Text = labModel.Lab_Curriculum;//�γ�
                        NumTXB.Text = labModel.Lab_ApprovalCode;//��׼�ĺ�
                        ProfessionTBX.Text = labModel.Lab_Professional;//����רҵ
                        InvestmentTBX.Text = labModel.Lab_Investment.ToString(); ;//Ͷ�ʶ�
                        StatementTBX.Text = labModel.Lab_Statement;//��ע

                        locModel = loc.GetModelList(" LabID=" + SubID);
                        float f = 0;
                        for (int i = 0; i < locModel.Count; i++)
                        {
                            if (locModel[i].Location_Area.ToString().Trim() != "")
                            {
                                f += float.Parse(locModel[i].Location_Area);
                            }
                        }
                        if (f == 0)
                        {
                            UsingAreaTBX.Text = "";//ʹ�����
                        }
                        else
                        {
                            UsingAreaTBX.Text = f.ToString();//ʹ�����
                        }

                        //��ʵ�����
                        list = DictionaryDropdownlist("111");
                        LabKindDDL.DataSource = list;
                        LabKindDDL.DataBind();
                        LabKindDDL.SelectedValue = labModel.Lab_Type;

                        //��ʵ������
                        list = DictionaryDropdownlist("112");
                        LabTypeDDL.DataSource = list;
                        LabTypeDDL.DataBind();
                        LabTypeDDL.SelectedValue = labModel.Lab_Type;

                        //��ʵ�鼶��
                        list = DictionaryDropdownlist("113");
                        LabLevelDDL.DataSource = list;
                        LabLevelDDL.DataBind();
                        LabLevelDDL.SelectedValue = labModel.Lab_Level;

                        //�󶨽�������
                        list = DictionaryDropdownlist("114");
                        AwardLevelDDL.DataSource = list;
                        AwardLevelDDL.DataBind();
                        AwardLevelDDL.SelectedValue = labModel.Lab_AwardLevel;

                        //��ʵ����״̬
                        list = DictionaryDropdownlist("115");
                        StatusDDL.DataSource = list;
                        StatusDDL.DataBind();
                        StatusDDL.SelectedValue = labModel.Lab_State;

                        //������ʵ����
                        LabDropdownlist();
                        LabDDL.SelectedValue = labModel.Lab_ParentID.ToString();
                    }
                    else
                    {
                        SaveBtn.Visible = false;
                        ERRLbl.Text = "ϵͳ�쳣��URL�������Ϸ���";
                        ERRLbl.Visible = true;
                    }
                }
            }
            else
            {
                SaveBtn.Visible = false;
                ERRLbl.Text = "ϵͳ�쳣��URL�������Ϸ���";
                ERRLbl.Visible = true;
            }
            SetUpDateTBX.Attributes.Add("onclick", "c.showMoreDay = false;c.show(this);");
            SetUpDateTBX.Attributes.Add("readOnly", "-1");
            UsingAreaTBX.Attributes.Add("readOnly", "-1");
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //strPagePrivilege.Add("BJKB");
            //strPageUserType.Add("mana");

            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["ID"]) && !string.IsNullOrEmpty(Request.QueryString["Year"]) && !string.IsNullOrEmpty(Request.QueryString["Term"]))
                {
                    int ID = 0;
                    int Year = 0;
                    int Term = 0;
                    if (int.TryParse(Request.QueryString["ID"], out ID) && int.TryParse(Request.QueryString["Year"], out Year) && int.TryParse(Request.QueryString["Term"], out Term))
                    {
                        LabMS.BLL.Location Location = new LabMS.BLL.Location();
                        LabMS.Model.Location model = Location.GetModel(ID);

                        if (model != null)
                        {
                            if (model.LabID != null)
                            {
                                LabMS.BLL.Lab Lab = new LabMS.BLL.Lab();
                                LabMS.Model.Lab labmodel = Lab.GetModel(model.LabID.Value);
                                if (labmodel != null)
                                {
                                    lb_Lab.Text = labmodel.Lab_Name + " �ص㣺У��" + model.Location_Campus + "��ѧ¥��" + model.Location_Building + "¥�㣺" + model.Location_Floor + "�����" + model.Location_RoomNum + "";
                                }
                            }

                        }

                        lb_Year.Text = Year.ToString();
                        if (Term == 1)
                        {
                            lb_Term.Text = "��ѧ��";
                        }
                        else
                        {
                            lb_Term.Text = "��ѧ��";
                        }

                    }
                }
                DataBinds();
            }
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("SYSXX");
            if (UserType == "student" || UserType == "teacher")
            {
                modifybtn.Visible = false;
                DeletBtn.Visible = false;
            }
            if (Request.QueryString["SubID"] != null)
            {
                if (!IsPostBack)
                {
                    int SubID;
                    if (int.TryParse(Request.QueryString["SubID"].ToString(), out SubID))
                    {
                        IDHF.Value = SubID.ToString();
                        LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                        List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();
                        LabMS.Model.Lab labModel = new LabMS.Model.Lab();
                        LabMS.BLL.Location loc = new LabMS.BLL.Location();
                        List<LabMS.Model.Location> locModel = new List<LabMS.Model.Location>();
                        try
                        {
                            labModel = lab.GetModel(SubID);
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }

                        LabNumLbl.Text = labModel.Lab_Code;//编号
                        LabNameLbl.Text = labModel.Lab_Name;//名称
                        SetUpDateLbl.Text = string.Format("{0:d}", labModel.Lab_SetupTime);//日期
                        ManagerLbl.Text = labModel.Lab_InCharge;//负责人
                        TelLbl.Text = labModel.Lab_Phone;//电话
                        CurriculumLbl.Text = labModel.Lab_Curriculum;//课程
                        NumLbl.Text = labModel.Lab_ApprovalCode;//批准文号
                        ProfessionLbl.Text = labModel.Lab_Professional;//面向专业
                        InvestmentLbl.Text = labModel.Lab_Investment.ToString();//投资额
                        StatementLbl.Text = labModel.Lab_Statement;//备注

                        locModel = loc.GetModelList(" LabID=" + SubID);
                        float f = 0;
                        for (int i = 0; i < locModel.Count; i++)
                        {
                            if (locModel[i].Location_Area.ToString().Trim() != "")
                            {
                                f += float.Parse(locModel[i].Location_Area);
                            }
                        }
                        if (f == 0)
                        {
                            UsingAreaLbl.Text = "";//使用面积
                        }
                        else
                        {
                            UsingAreaLbl.Text = f.ToString();//使用面积
                        }

                        //绑定实验类别
                        list = DictionaryDropdownlist("111");
                        LabKindDDL.DataSource = list;
                        LabKindDDL.DataBind();
                        LabKindDDL.SelectedValue = labModel.Lab_Type;

                        //绑定实验类型
                        list = DictionaryDropdownlist("112");
                        LabTypeDDL.DataSource = list;
                        LabTypeDDL.DataBind();
                        LabTypeDDL.SelectedValue = labModel.Lab_Type;

                        //绑定实验级别
                        list = DictionaryDropdownlist("113");
                        LabLevelDDL.DataSource = list;
                        LabLevelDDL.DataBind();
                        LabLevelDDL.SelectedValue = labModel.Lab_Level;

                        //绑定奖励级别
                        list = DictionaryDropdownlist("114");
                        AwardLevelDDL.DataSource = list;
                        AwardLevelDDL.DataBind();
                        AwardLevelDDL.SelectedValue = labModel.Lab_AwardLevel;

                        //绑定实验室状态
                        list = DictionaryDropdownlist("115");
                        StatusDDL.DataSource = list;
                        StatusDDL.DataBind();
                        StatusDDL.SelectedValue = labModel.Lab_State;

                        //绑定所属实验室
                        LabDropdownlist();
                        LabDDL.SelectedValue = labModel.Lab_ParentID.ToString();
                    }
                    else
                    {
                        ERRLbl.Text = "系统异常,URL参数不合法!";
                        ERRLbl.Visible = true;
                        modifybtn.Visible = false;
                        DeletBtn.Visible = false;
                    }
                }
            }
            else
            {
                ERRLbl.Text = "系统异常,URL参数不合法!";
                ERRLbl.Visible = true;
                modifybtn.Visible = false;
                DeletBtn.Visible = false;
            }
        }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("ZJSYS");
            strPageUserType.Add("mana");
            if (Request.QueryString["ID"] == null)
            {
                concel.Visible = false;
                addsublab.Visible = false;
                tt1.Visible = false;
                LabName = "ʵ����";
                if (!IsPostBack)
                {
                    List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();
                    //��ʵ�����
                    list = DictionaryDropdownlist("111");
                    LabKindDDL.DataSource = list;
                    LabKindDDL.DataBind();

                    //��ʵ������
                    list = DictionaryDropdownlist("112");
                    LabTypeDDL.DataSource = list;
                    LabTypeDDL.DataBind();

                    //��ʵ�鼶��
                    list = DictionaryDropdownlist("113");
                    LabLevelDDL.DataSource = list;
                    LabLevelDDL.DataBind();

                    //�󶨽�������
                    list = DictionaryDropdownlist("114");
                    AwardLevelDDL.DataSource = list;
                    AwardLevelDDL.DataBind();

                    //��ʵ����״̬
                    list = DictionaryDropdownlist("115");
                    StatusDDL.DataSource = list;
                    StatusDDL.DataBind();

                    //������ѧ��
                    //SubjectDropdownlist();

                }
            }
            else
            {
                if (!IsPostBack)
                {
                    int ID;
                    string strID = Request.QueryString["ID"].ToString();
                    if (int.TryParse(strID, out ID))
                    {
                        //if (Page.Request.QueryString["flag"] !=null )
                        //{
                        //    SaveBtn.Visible = false;
                        //    concel.Visible = true;
                        //}
                        //else
                        //{
                        //    concel.Visible = true;
                        //    addsublab.Visible = true;
                        //}

                        LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                        LabMS.Model.Lab labModel = new LabMS.Model.Lab();
                        List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();

                        IDHF.Value = ID.ToString();//�洢IDֵ
                        //��ȡʵ������Ϣ ͨ��ID
                        labModel = lab.GetModel(ID);

                        LabNumTBX.Text = labModel.Lab_Code;//���
                        LabNameTBX.Text = labModel.Lab_Name;//����
                        LabName = labModel.Lab_Name;
                        DateTBX.Text = string.Format("{0:d}", labModel.Lab_SetupTime.ToString());//����
                        ManagerTBX.Text = labModel.Lab_InCharge;//������
                        TelTBX.Text = labModel.Lab_Phone;//�绰
                        CurriculumTBX.Text = labModel.Lab_Curriculum;//�е��γ�
                        NumTXB.Text = labModel.Lab_ApprovalCode;//��׼�ĺ�
                        ProfessionTBX.Text = labModel.Lab_Professional;//����רҵ
                        ProjectNumTBX.Text = labModel.Lab_ProjectNum.ToString();//����������
                        InvestmentTBX.Text = labModel.Lab_Investment.ToString();//Ͷ�ʶ�
                        SubjectTBX.Text = labModel.Lab_Disciplines;//����ѧ��
                        AwardNumTBX.Text = labModel.Lab_StAwardNum.ToString();//����

                        //��ȡ�ļ��б�
                        string strHTML = "";
                        if (labModel.Lab_Summary!= null)
                        {
                            AttachIDHF.Value = labModel.Lab_Summary.ToString();
                            LabMS.BLL.AttachmentItem attIte = new LabMS.BLL.AttachmentItem();
                            List<LabMS.Model.AttachmentItem> attIteModelList = new List<LabMS.Model.AttachmentItem>();

                            attIteModelList = attIte.GetModelList("Attach_ID=" + int.Parse(labModel.Lab_Summary.ToString()));
                            strHTML += "<table>";
                            for (int i = 0; i < attIteModelList.Count; i++)
                            {
                                strHTML += "<tr>";
                                strHTML += "<td style='display:none;'>";
                                strHTML += attIteModelList[i].ID;
                                strHTML += "</td>";
                                strHTML += "<td>";
                                strHTML += "<a>";
                                strHTML += "ɾ��";
                                strHTML += "</a>";
                                strHTML += "</td>";
                                strHTML += "<td>";
                                strHTML += attIteModelList[i].Item_Name;
                                strHTML += "</td>";
                                strHTML += "</tr>";
                            }
                            strHTML += "</table>";
                            filehtml.Value = strHTML;
                        }

                        //��ʵ�����
                        list = DictionaryDropdownlist("111");
                        LabKindDDL.DataSource = list;
                        LabKindDDL.DataBind();
                        LabKindDDL.SelectedValue = labModel.Lab_Category;

                        //��ʵ������
                        list = DictionaryDropdownlist("112");
                        LabTypeDDL.DataSource = list;
                        LabTypeDDL.DataBind();
                        LabTypeDDL.SelectedValue = labModel.Lab_Type;

                        //��ʵ�鼶��
                        list = DictionaryDropdownlist("113");
                        LabLevelDDL.DataSource = list;
                        LabLevelDDL.DataBind();
                        LabLevelDDL.SelectedValue = labModel.Lab_Level;

                        //�󶨽�������
                        list = DictionaryDropdownlist("114");
                        AwardLevelDDL.DataSource = list;
                        AwardLevelDDL.DataBind();
                        AwardLevelDDL.SelectedValue = labModel.Lab_AwardLevel;

                        //��ʵ����״̬
                        list = DictionaryDropdownlist("115");
                        StatusDDL.DataSource = list;
                        StatusDDL.DataBind();
                        StatusDDL.SelectedValue = labModel.Lab_State;

                        //������ѧ��
                        //SubjectDropdownlist();
                        //DepartmentDDL.SelectedValue = labModel.Lab_Curriculum;

                        //����ʵ������Ϣ
                        SubLabInfo_GridView(ID);
                        SubLabGridView.Visible = true;
                    }
                    else
                    {
                        SaveBtn.Visible = false;
                        ERRLbl.Text = "ϵͳ�쳣��IDֵ���Ϸ���";
                        ERRLbl.Visible = true;
                        addsublab.Visible = false;
                    }
                }
            }
            DateTBX.Attributes.Add("onclick", "c.showMoreDay = false;c.show(this);");
            DateTBX.Attributes.Add("readOnly", "-1");
            RoomAreaTBX.Attributes.Add("readOnly", "-1");
            SubjectTBX.Attributes.Add("readOnly", "-1");
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("SYSXX");
            if (UserType == "student" || UserType == "teacher")
            {
                modeify.Visible = false;
                DeleteBtn.Visible = false;
                addsublab.Visible = false;
            }
            if (Request.QueryString["ID"] == null)
            {
                ERRLbl.Text = "系统异常,URL参数为空!";
                ERRLbl.Visible = true;
                modeify.Visible = false;
                DeleteBtn.Visible = false;
                addsublab.Visible = false;
            }
            else
            {
                if (Page.Request.QueryString["flag"] != null)
                {
                    modeify.Visible = false;
                    DeleteBtn.Visible = false;
                    addsublab.Visible = false;
                }
                if (!IsPostBack)
                {
                    int ID;
                    string strID = Request.QueryString["ID"].ToString();
                    if (int.TryParse(strID, out ID))
                    {

                        LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                        LabMS.Model.Lab labModel = new LabMS.Model.Lab();
                        List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>();
                        string[] strArray = new string[2];

                        IDHF.Value = ID.ToString();//存储ID值
                        //获取实验室信息 通过ID
                        labModel = lab.GetModel(ID);

                        LabNumLbl.Text = labModel.Lab_Code;//编号
                        LabNameLbl.Text = labModel.Lab_Name;//名字
                        LabName = labModel.Lab_Name;
                        DateLbl.Text = string.Format("{0:d}", labModel.Lab_SetupTime.ToString());//日期
                        ManagerLbl.Text = labModel.Lab_InCharge;//负责人
                        TelLbl.Text = labModel.Lab_Phone;//电话
                        CurriculumLbl.Text = labModel.Lab_Curriculum;//承担课程
                        NumLbl.Text = labModel.Lab_ApprovalCode;//批准文号
                        ProfessionLbl.Text = labModel.Lab_Professional;//面向专业
                        ProjectNumLbl.Text = labModel.Lab_ProjectNum.ToString();//科研任务数
                        InvestmentLbl.Text = labModel.Lab_Investment.ToString();//投资额
                        SubjectLbl.Text = labModel.Lab_Disciplines;//所属学科
                        AwardNumLbl.Text = labModel.Lab_StAwardNum.ToString();//获奖数
                        StatementLbl.Text = labModel.Lab_Statement;//备注

                        //获取文件列表
                        string strHTML = "";
                        if (labModel.Lab_Summary != null)
                        {
                            LabMS.BLL.AttachmentItem attIte = new LabMS.BLL.AttachmentItem();
                            List<LabMS.Model.AttachmentItem> attIteModelList = new List<LabMS.Model.AttachmentItem>();

                            attIteModelList = attIte.GetModelList("Attach_ID=" + int.Parse(labModel.Lab_Summary.ToString()));
                            for (int i = 0; i < attIteModelList.Count; i++)
                            {
                                strHTML += "<a onclick='downloadfile("+attIteModelList[i].ID+")'>";
                                strHTML += attIteModelList[i].Item_Name;
                                strHTML += "</a>";
                                strHTML += "<br/>";
                            }
                            filehtml.InnerHtml = strHTML;
                        }

                        //绑定实验类别
                        list = DictionaryDropdownlist("111");
                        LabKindDDL.DataSource = list;
                        LabKindDDL.DataBind();
                        LabKindDDL.SelectedValue = labModel.Lab_Category;

                        //绑定实验类型
                        list = DictionaryDropdownlist("112");
                        LabTypeDDL.DataSource = list;
                        LabTypeDDL.DataBind();
                        LabTypeDDL.SelectedValue = labModel.Lab_Type;

                        //绑定实验级别
                        list = DictionaryDropdownlist("113");
                        LabLevelDDL.DataSource = list;
                        LabLevelDDL.DataBind();
                        LabLevelDDL.SelectedValue = labModel.Lab_Level;

                        //绑定奖励级别
                        list = DictionaryDropdownlist("114");
                        AwardLevelDDL.DataSource = list;
                        AwardLevelDDL.DataBind();
                        AwardLevelDDL.SelectedValue = labModel.Lab_AwardLevel;

                        //绑定实验室状态
                        list = DictionaryDropdownlist("115");
                        StatusDDL.DataSource = list;
                        StatusDDL.DataBind();
                        StatusDDL.SelectedValue = labModel.Lab_State;

                        //绑定子实验室信息
                        SubLabInfo_GridView(ID);
                        SubLabGridView.Visible = true;
                    }
                    else
                    {
                        ERRLbl.Text = "系统异常,ID值不合法!";
                        ERRLbl.Visible = true;
                        modeify.Visible = false;
                        DeleteBtn.Visible = false;
                        addsublab.Visible = false;
                    }
                }
            }
        }