//绑定申请信息
        protected void BindData(int ProjectID)
        {
            LabMS.BLL.PersonalProject perProject = new LabMS.BLL.PersonalProject();
            LabMS.Model.PersonalProject perProjectInfo = new LabMS.Model.PersonalProject();

            perProjectInfo = perProject.GetModel(ProjectID);
            ProjectName.Text = perProjectInfo.ProjectName;
            PlanHours.Text = perProjectInfo.PlanHours.ToString();
            ddlApplyLab.SelectedValue = perProjectInfo.AppcationLabID.ToString();
            if (!string.IsNullOrEmpty(perProjectInfo.ApplicationStartTime.ToString()))
            {
                ApplyTimeMin.Text = perProjectInfo.ApplicationStartTime.Value.ToShortDateString();
            }
            if (!string.IsNullOrEmpty(perProjectInfo.ApplicationEndTime.ToString()))
            {
                ApplyTimeMax.Text = perProjectInfo.ApplicationEndTime.Value.ToShortDateString();
            }

            string strSemester = Common.Status.GetSemester(perProjectInfo.Semester.Value);
            lbSTime.Text = perProjectInfo.SYear.Value.ToString() + "学年 " + strSemester;
            lbStatus.Text = Common.Status.GetPersonalProjectStatus(perProjectInfo.ProjectStatus.ToString());

            Contactor.Text = perProjectInfo.Contactor;
            ContactorClass.Text = perProjectInfo.ContactorClass;
            ContactEmail.Text = perProjectInfo.ContactorEmail;
            ContactPhone.Text = perProjectInfo.ContactorPhone;
            Teacher.Text = perProjectInfo.Teacher;
            TeacherTitle.Text = perProjectInfo.TeacherTitle;
            TeacherEmail.Text = perProjectInfo.TeacherEmail;
            TeacherPhone.Text = perProjectInfo.TeacherPhone;
            ApplyReason.Text = perProjectInfo.ApplicationReason;
            Opinion.Text = perProjectInfo.Opinion;
            if (!string.IsNullOrEmpty(perProjectInfo.ProjectStartTime.ToString()))
            {
                LabDate.Text = perProjectInfo.ProjectStartTime.Value.ToShortDateString();
                LabStartTimeHour.Text = perProjectInfo.ProjectStartTime.Value.Hour.ToString();
                LabStartTimeMinute.Text = perProjectInfo.ProjectStartTime.Value.Minute.ToString();
            }
            if (!string.IsNullOrEmpty(perProjectInfo.ProjectEndTime.ToString()))
            {
                LabEndTimeHour.Text = perProjectInfo.ProjectEndTime.Value.Hour.ToString();
                LabEndTimeMinute.Text = perProjectInfo.ProjectEndTime.Value.Minute.ToString();
            }

            int LabID = int.Parse(perProjectInfo.AppcationLabID.ToString());
            LocationDropdownList(LabID);
            ddlLocation.SelectedValue = perProjectInfo.ProjectLabID.ToString();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     strPagePrivilege.Add("XSZNSYXMLB");
     strPageUserType.Add("mana");
     if (Request.QueryString["ProjectID"] == null)
     {
         Common.JShelper.JSAlert(Page, "err", "参数错误!");
         return;
     }
     if (!int.TryParse(Request.QueryString["ProjectID"], out ProjectID))
     {
         Common.JShelper.JSAlert(Page, "err", "参数错误!");
         return;
     }
     LabMS.BLL.PersonalProject project = new LabMS.BLL.PersonalProject();
     LabMS.Model.PersonalProject projectInfo = new LabMS.Model.PersonalProject();
     projectInfo = project.GetModel(ProjectID);
     string status = projectInfo.ProjectStatus;
     ApprovalProjectPreview.Visible = false;
     if (status.Equals("4"))
     {
         ApprovalProjectPreview.Visible = true;
         ApplyOpinion.Visible = true;
         ApplyBtn.Visible = false;
     }
     if (status.Equals("3"))
     {
         ApplyOpinion.Visible = true;
         ApplyBtn.Visible = false;
     }
     if (!IsPostBack)
     {
         LabDropdownlist();
         BindApplicantList(ProjectID);
         BindEquipList(ProjectID);
         BindData(ProjectID);
     }
 }
        protected void GridViewPerProject_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //判断是否为数据行
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //鼠标移动时改变背景色
                //e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';this.style.color='#003399'");
                //e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='6699FF';this.style.color='8C4510'");
                e.Row.Attributes["style"] = "Cursor:pointer";
                //鼠标点击数据行时的链接

                int itemp = e.Row.Cells.Count;
                for (int i = 1; i < itemp; i++)
                {
                    //被点击数据行的实验项目ID
                    int ProjectID = int.Parse(gvPersonalProjectList.DataKeys[gvPersonalProjectList.DataKeys.Count - 1].Value.ToString());

                    LabMS.BLL.PersonalProject project = new LabMS.BLL.PersonalProject();
                    LabMS.Model.PersonalProject projectinfo = new LabMS.Model.PersonalProject();
                    //获得该实验项目的状态
                    projectinfo = project.GetModel(ProjectID);
                    string projectStatus = projectinfo.ProjectStatus;
                    e.Row.Cells[i].Attributes.Add("onDblclick", "window.location.href='PreviewPersonalProject.aspx?ProjectID="
                                              + ProjectID + "'");
                }
            }
        }
        //审批[不通过]
        protected void btnUnapprove_Click(object sender, EventArgs e)
        {
            #region 验证
            if (string.IsNullOrEmpty(Opinion.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(Page, "err", "审批意见不能为空!");
                return;
            }
            #endregion
            LabMS.BLL.PersonalProject projectinfo = new LabMS.BLL.PersonalProject();
            LabMS.Model.PersonalProject project = new LabMS.Model.PersonalProject();

            int ProjectID = int.Parse(Request.QueryString["ProjectID"]);
            project = projectinfo.GetModel(ProjectID);

            project.Opinion = Opinion.Text;
            project.ProjectStatus = "3";
            try
            {
                projectinfo.Update(project);
            }
            catch (Exception ex)
            {
                lbErr.Text = ex.Message;
                lbErr.Visible = true;
                return;
            }
            LabMS.Common.JShelper.JSAlertAndRedirect(Page, "UnapproveSuccess", "审批不通过操作成功", "ListPersonalProject.aspx");
        }
        //审批[通过]
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            #region 验证
            if (string.IsNullOrEmpty(Opinion.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(Page, "err", "审批意见不能为空!");
                return;
            }
            if (string.IsNullOrEmpty(LabDate.Text.Trim()) || string.IsNullOrEmpty(LabStartTimeHour.Text.Trim()) || string.IsNullOrEmpty(LabStartTimeMinute.Text.Trim())
                || string.IsNullOrEmpty(LabEndTimeHour.Text.Trim()) || string.IsNullOrEmpty(LabEndTimeMinute.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(Page, "err", "实验时间不能为空!");
                return;
            }

            int StartHour = 0;
            int EndHour = 0;
            int StartMinute = 0;
            int EndMinute = 0;
            if (!(int.TryParse(LabStartTimeHour.Text.Trim(), out StartHour) && int.TryParse(LabStartTimeMinute.Text.Trim(), out StartMinute)
                && int.TryParse(LabEndTimeHour.Text.Trim(), out EndHour) && int.TryParse(LabEndTimeMinute.Text.Trim(), out EndMinute)))
            {
                LabMS.Common.JShelper.JSAlert(Page, "err", "实验时间只能输入数字!");
                return;
            }
            else
            {
                StartHour = int.Parse(LabStartTimeHour.Text.Trim());
                StartMinute = int.Parse(LabStartTimeMinute.Text.Trim());
                EndHour = int.Parse(LabEndTimeHour.Text.Trim());
                EndMinute = int.Parse(LabEndTimeMinute.Text.Trim());

                if (StartHour > 24 || EndHour > 24 || StartMinute > 60 || EndMinute > 60)
                {
                    LabMS.Common.JShelper.JSAlert(Page, "err", "实验时间不合法!");
                    return;
                }
                if (StartHour > EndHour || ((StartHour.Equals(EndHour)) && (StartMinute>=EndMinute)))
                {
                    LabMS.Common.JShelper.JSAlert(Page, "err", "实验开始时间大于结束时间!");
                    return;
                }
            }
            if (ddlLocation.SelectedValue.ToString().Equals("0"))
            {
                LabMS.Common.JShelper.JSAlert(Page, "err", "实验地点不能为空!");
                return;
            }
            #endregion
            LabMS.BLL.PersonalProject projectinfo = new LabMS.BLL.PersonalProject();
            LabMS.Model.PersonalProject project = new LabMS.Model.PersonalProject();

            int ProjectID = int.Parse(Request.QueryString["ProjectID"]);
            project = projectinfo.GetModel(ProjectID);

            project.Opinion = Opinion.Text;
            project.ProjectLabID = int.Parse(ddlLocation.SelectedValue.Trim());
            project.ProjectStartTime = DateTime.Parse(LabDate.Text + "  " + LabStartTimeHour.Text + ":" + LabStartTimeMinute.Text + ":00");
            project.ProjectEndTime = DateTime.Parse(LabDate.Text + "  " + LabEndTimeHour.Text + ":" + LabEndTimeMinute.Text + ":00");
            project.ProjectStatus = "4";
            try
            {
                projectinfo.Update(project);
            }
            catch (Exception ex)
            {
                lbErr.Text = ex.Message;
                lbErr.Visible = true;
                return;
            }
            LabMS.Common.JShelper.JSAlertAndRedirect(Page, "ApproveSuccess", "审批通过操作成功", "ListPersonalProject.aspx");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            strPageUserType.Add("student");
            if (Request.QueryString["ProjectID"] == null)
            {
                Common.JShelper.JSAlert(Page, "err", "参数错误!");
                return;
            }
            int ProjectID = 0;
            if (!int.TryParse(Request.QueryString["ProjectID"], out ProjectID))
            {
                Common.JShelper.JSAlert(Page, "err", "参数错误!");
                return;
            }
            if (!IsPostBack)
            {
                LabMS.BLL.PersonalProject project = new LabMS.BLL.PersonalProject();
                LabMS.Model.PersonalProject projectInfo = new LabMS.Model.PersonalProject();
                projectInfo = project.GetModel(ProjectID);
                string status = projectInfo.ProjectStatus;
                iniBtn(status);

                LabDropdownlist();
                BindApplicantList(ProjectID);
                BindEquipList(ProjectID);
                BindData(ProjectID);
                tbID.Value = ProjectID.ToString();
            }
        }