//绑定申请人
        protected void BindApplicantList(int ProjectID)
        {
            ExtendBLL.PersonalProject personalproject = new ExtendBLL.PersonalProject();
            List<ExtendModule.StudentAndOther> applicantList = new List<ExtendModule.StudentAndOther>();

            string strWhere = " pa.PersonalProjID = " + ProjectID;
            applicantList = personalproject.GetStudentInfoList(strWhere);
            gvApplicant.DataSource = applicantList;
            gvApplicant.DataBind();
        }
Пример #2
0
        //绑定数据
        protected void BindData(int ProjectID)
        {
            //绑定基本信息
            LabMS.BLL.PersonalProject project = new LabMS.BLL.PersonalProject();
            LabMS.Model.PersonalProject projectinfo = new LabMS.Model.PersonalProject();

            projectinfo = project.GetModel(ProjectID);
            ProjectName.Text = projectinfo.ProjectName;
            PlanHours.Text = projectinfo.PlanHours.ToString();
            ddlApplyLab.SelectedValue = projectinfo.AppcationLabID.ToString();
            if (!string.IsNullOrEmpty(projectinfo.ApplicationStartTime.ToString()))
            {
                ApplyTimeMin.Text = projectinfo.ApplicationStartTime.Value.ToShortDateString();
            }
            if (!string.IsNullOrEmpty(projectinfo.ApplicationEndTime.ToString()))
            {
                ApplyTimeMax.Text = projectinfo.ApplicationEndTime.Value.ToShortDateString();
            }
            Contactor.Text = projectinfo.Contactor ;
            ContactorClass.Text = projectinfo.ContactorClass;
            ContactEmail.Text = projectinfo.ContactorEmail;
            ContactPhone.Text = projectinfo.ContactorPhone;
            Teacher.Text = projectinfo.Teacher;
            TeacherTitle.Text = projectinfo.TeacherTitle;
            TeacherEmail.Text = projectinfo.TeacherEmail;
            TeacherPhone.Text = projectinfo.TeacherPhone;
            ApplyReason.Text = projectinfo.ApplicationReason;

            //绑定申请人
            ExtendBLL.PersonalProject applicant = new ExtendBLL.PersonalProject();
            List<ExtendModule.StudentAndOther> applicantinfo = new List<ExtendModule.StudentAndOther>();

            string strWhere = " pa.PersonalProjID = " + ProjectID;
            applicantinfo = applicant.GetStudentInfoList(strWhere);
            #region 绑定申请人列表
            string strHTML0 = "<table  id='applicantlist' border='1' class='infoTable' style='width: 185px; border-collapse: collapse;'>";
            strHTML0 += "<thead>";
            strHTML0 += "<tr class='header'>";
            strHTML0 += "<td class='none'>";
            strHTML0 += "ID";
            strHTML0 += "</td>";

            strHTML0 += "<td>";
            strHTML0 += "学号";
            strHTML0 += "</td>";

            strHTML0 += "<td>";
            strHTML0 += "姓名";
            strHTML0 += "</td>";
            strHTML0 += "<td>";
            strHTML0 += "";
            strHTML0 += "</td>";
            strHTML0 += "</tr>";
            strHTML0 += "</thead>";
            strHTML0 += "<tbody>";
            tb_StudentIDs.Text = "";
            foreach (ExtendModule.StudentAndOther s in applicantinfo)
            {
                if (tb_StudentIDs.Text == "")
                {
                    tb_StudentIDs.Text += s.ID.ToString();
                }
                else
                {
                    tb_StudentIDs.Text += "," + s.ID.ToString();
                }
                strHTML0 += "<tr>";
                strHTML0 += "<td class='none'>";
                strHTML0 += s.ID.ToString();
                strHTML0 += "</td>";
                strHTML0 += "<td>";
                strHTML0 += s.Student_Code;
                strHTML0 += "</td>";
                strHTML0 += "<td>";
                strHTML0 += s.Student_Name;
                strHTML0 += "</td>";
                strHTML0 += "<td>";
                strHTML0 += "<a>删除</a>";
                strHTML0 += "</td>";
                strHTML0 += "</tr>";
            }
            strHTML0 += "</tbody>";
            strHTML0 += "</table>";
            studentlist.Text = strHTML0;
            tblistEmpty.Value = "0";
            #endregion

            //绑定低耗品和仪器
            LabMS.BLL.PersonalProjConsume projectconsume = new LabMS.BLL.PersonalProjConsume();
            List<LabMS.Model.PersonalProjConsume> projectequipinfo = new List<LabMS.Model.PersonalProjConsume>();
            List<LabMS.Model.PersonalProjConsume> projectlowconsumeinfo = new List<LabMS.Model.PersonalProjConsume>();

            #region 绑定仪器
            //仪器
            string strWhere2 = " EquipType=1 and PersonalProjID=" + ProjectID;
            projectequipinfo = projectconsume.GetModelList(strWhere2);

            string strHTML = "<table  id='tableEquip' border='1' class='infoTable' style='border-collapse: collapse;'>";
            strHTML += "<thead>";
            strHTML += "<tr class='header'>";
            strHTML += "<td style='display:none'>";
            strHTML += "编号";
            strHTML += "</td>";

            strHTML += "<td>";
            strHTML += "名称";
            strHTML += "</td>";

            strHTML += "<td>";
            strHTML += "数量";
            strHTML += "</td>";

            strHTML += "<td>";
            strHTML += "备注";
            strHTML += "</td>";

            strHTML += "<td>";
            strHTML += "";
            strHTML += "</td>";

            strHTML += "</tr>";
            strHTML += "</thead>";
            strHTML += "<tbody>";
            tb_EIndex.Value = projectequipinfo.Count.ToString();

            for (int i = 0; i < projectequipinfo.Count; i++)
            {
                strHTML += "<tr>";
                strHTML += "<td style='display:none'>";
                strHTML += "<input type='text' id='code" + i + "'/>";
                strHTML += "</td>";
                strHTML += "<td>";
                strHTML += "<input style='width:40px;' value='" + projectequipinfo[i].EquipName + "' name='name" + i + "' id='name" + i + "' type='text' /><input  onclick=OpenEditWin2('../CommonPage/consumselectlist.aspx?location=@ALL@&Type=yiqi',500,400,'code" + i + "','name" + i + "'); type='button' class='button' value='...' /> ";
                strHTML += "</td>";
                strHTML += "<td>";
                strHTML += "<input style='width:30px;' value='" + projectequipinfo[i].EquipNum + "' name='num" + i + "' id='num" + i + "' type='text' />";
                strHTML += "</td>";
                strHTML += "<td>";
                strHTML += "<input style='width:50px;' value='" + projectequipinfo[i].Introduction + "' name='intro" + i + "' id='intro" + i + "' type='text' />";
                strHTML += "</td>";
                strHTML += "<td>";
                strHTML += "<a>删除</a>";
                strHTML += "</td>";
                strHTML += "</tr>";
            }
            strHTML += "</tbody>";
            strHTML += "</table>";
            lbEquip.Text += strHTML;
            #endregion
            #region 绑定低耗品
            //低耗品
            string strWhere3 = " EquipType=2 and PersonalProjID=" + ProjectID;
            projectlowconsumeinfo = projectconsume.GetModelList(strWhere3);

            string strHTML2 = "<table  id='tableConsump' border='1' class='infoTable' style='border-collapse: collapse;'>";
            strHTML2 += "<thead>";
            strHTML2 += "<tr class='header'>";
            strHTML2 += "<td style='display:none'>";
            strHTML2 += "编号";
            strHTML2 += "</td>";

            strHTML2 += "<td>";
            strHTML2 += "名称";
            strHTML2 += "</td>";

            strHTML2 += "<td>";
            strHTML2 += "数量";
            strHTML2 += "</td>";

            strHTML2 += "<td>";
            strHTML2 += "备注";
            strHTML2 += "</td>";

            strHTML2 += "<td>";
            strHTML2 += "";
            strHTML2 += "</td>";

            strHTML2 += "</tr>";
            strHTML2 += "</thead>";
            strHTML2 += "<tbody>";

            tb_ConsumpIndex.Value = projectlowconsumeinfo.Count.ToString();

            for (int i = 0; i < projectlowconsumeinfo.Count; i++)
            {
                strHTML2 += "<tr>";
                strHTML2 += "<td style='display:none'>";
                strHTML2 += "<input type='text'id='consumpcode" + i + "'/>";
                strHTML2 += "</td>";
                strHTML2 += "<td>";
                strHTML2 += "<input style='width:40px;' value='" + projectlowconsumeinfo[i].EquipName + "' name='consumpname" + i + "' id='consumpname" + i + "' type='text' /><input  onclick=OpenEditWin3('../CommonPage/consumselectlist.aspx?location=@ALL@&Type=xiaohaopin',500,400,'consumpcode" + i + "','consumpname" + i + "'); type='button' class='button' value='...' /> ";
                strHTML2 += "</td>";
                strHTML2 += "<td>";
                strHTML2 += "<input style='width:30px;' value='" + projectlowconsumeinfo[i].EquipNum + "' name='consumpnum" + i + "' id='consumpnum" + i + "' type='text' />";
                strHTML2 += "</td>";
                strHTML2 += "<td>";
                strHTML2 += "<input style='width:50px;' value='" + projectlowconsumeinfo[i].Introduction + "' name='consumpintro" + i + "' id='consumpintro" + i + "' type='text' />";
                strHTML2 += "</td>";
                strHTML2 += "<td>";
                strHTML2 += "<a>删除</a>";
                strHTML2 += "</td>";
                strHTML2 += "</tr>";
            }
            strHTML2 += "</tbody>";
            strHTML2 += "</table>";
            lbConsump.Text += strHTML2;
            #endregion
        }