protected void gvSur_PageIndexChanging(object sender, GridViewPageEventArgs e) { CY.CSTS.Core.Business.Survey sur = new CY.CSTS.Core.Business.Survey(); if (CY.CSTS.Core.Business.Survey.SelectByStatus(1) != null) { sur = CY.CSTS.Core.Business.Survey.SelectByStatus(1); } else if (CY.CSTS.Core.Business.Survey.SelectByStatus(2) != null) { sur = CY.CSTS.Core.Business.Survey.SelectByStatus(2); } gvSur.PageIndex = e.NewPageIndex; BindGv(sur.Id); undisable(); }
protected void btnStart_Click(object sender, EventArgs e) { CY.CSTS.Core.Business.Survey Survey = new CY.CSTS.Core.Business.Survey(); Survey.Name = System.DateTime.Now.Year + "年" + System.DateTime.Now.Month + "月" + "重庆大型仪器资源共享平台共享调查"; Survey.AddTime = System.DateTime.Now; //subsidies.AddPerson = Session["User"].ToString();//添加人 Survey.Status = 1; Survey.Des = tbDes.Text; Survey.Save(); CY.CSTS.Core.Business.FreshNews fresh = new CY.CSTS.Core.Business.FreshNews(); fresh.FreshEvent = "共享调查开始"; fresh.EventType = 6; fresh.EventTime = DateTime.Now; Page.RegisterStartupScript("", "<script>window.location.href=\"SurveyManagement.aspx\"</script>"); }
/// <summary> /// /// </summary> protected void BindPage() { CY.CSTS.Core.Business.Survey sur = new CY.CSTS.Core.Business.Survey(); if (CY.CSTS.Core.Business.Survey.SelectByStatus(1) != null) { sur = CY.CSTS.Core.Business.Survey.SelectByStatus(1); hdSurveyID.Value = sur.Id.ToString();//调查ID lbInfo.InnerText = sur.Name; lbDes.InnerText = sur.Des; divaddrecord.Visible = true; BindGv(sur.Id); } else if (CY.CSTS.Core.Business.Survey.SelectByStatus(2) != null) { sur = CY.CSTS.Core.Business.Survey.SelectByStatus(2); hdSurveyID.Value = sur.Id.ToString(); lbInfo.InnerText = sur.Name; lbAlert.InnerText = "评审中,只能查看,不能添加、修改、删除调查表"; divaddrecord.Visible = true; BindGv(sur.Id); } else { lbInfo.InnerText = "共享调查已关闭"; lableDes.Visible = false; } }
protected void btnHdEnd_Click(object sender, EventArgs e) { CY.CSTS.Core.Business.Survey sur = new CY.CSTS.Core.Business.Survey(); if (CY.CSTS.Core.Business.Survey.SelectByStatus(1) != null) { sur = CY.CSTS.Core.Business.Survey.SelectByStatus(1); } else { sur = CY.CSTS.Core.Business.Survey.SelectByStatus(2); } sur.Status = 0; sur.Save(); string sqlwhere = "where [surveyID]='" + sur.Id + "'"; IList<CY.CSTS.Core.Business.SurveyTable> sbList = CY.CSTS.Core.Business.SurveyTable.GetSurveyTableBySql(sqlwhere); for (int i = 0; i < sbList.Count; i++) { if (sbList[i].Status == 2 || sbList[i].Status == 3 || sbList[i].Status == 6) { sbList[i].Status = 5; sbList[i].Save(); } } CY.CSTS.Core.Business.FreshNews fresh = new CY.CSTS.Core.Business.FreshNews(); fresh.FreshEvent = "共享调查结束"; fresh.EventType = 6; fresh.EventTime = DateTime.Now; Page.RegisterStartupScript("", "<script>window.location.href=\"SurveyManagement.aspx\"</script>"); }