//问卷调查投票 public bool SurveyAnswer_Edit(IES.CC.Model.Survey.SurveyAnswer model) { IES.CC.Model.Survey.Survey survey = new CC.Model.Survey.Survey { SurveyID = model.SurveyID, UserID = model.UserID }; bool isCan = Survey_Is_Sumbit(survey); if (isCan) { bool flag = SurveyDAL.SurveyAnswer_Edit(model); if (flag) { bool flag1 = SurveyDAL.SurveyToObject_IsFinish_Upd(model); return flag1; } else { return false; } } else { return false; } }
//我参与的问卷列表 public List<IES.CC.Model.Survey.Survey> Survey_MyJoin_List(IES.CC.Model.Survey.Survey model, int PageIndex, int PageSize) { var list= SurveyDAL.Survey_MyJoin_List(model, PageIndex, PageSize); DateTime date = DateTime.Now; for (var i = 0; i < list.Count; i++) { var surveyid = list[i].SurveyID; var status = list[i].Status; DateTime start = Convert.ToDateTime(list[i].StartDate); DateTime end = Convert.ToDateTime(list[i].EndDate); if (status != 3 && status != 2 && start <= date && date < end.AddDays(1))//未进行、结束→进行 { IES.CC.Model.Survey.Survey survey = new CC.Model.Survey.Survey { SurveyID = surveyid, Status = 2 }; bool result = Survey_Status_Upd(survey); if (result == true) { list[i].Status = 2; } } else if (status != 4 && date > end.AddDays(1))//未进行、暂停、进行→结束 { IES.CC.Model.Survey.Survey survey = new CC.Model.Survey.Survey { SurveyID = surveyid, Status = 4 }; bool result = Survey_Status_Upd(survey); if (result == true) { list[i].Status = 4; } } else { } } return list; }
// 获取调查问卷的详细信息 public IES.CC.Model.Survey.SurveyInfo SurveyInfo_Get(int SurveyID) { IES.CC.Model.Survey.Survey model = new CC.Model.Survey.Survey { SurveyID = SurveyID }; return SurveyDAL.SurveyInfo_Get(model); }