protected void Page_Load(object sender, EventArgs e) { EmpVoiceAnswerInfo ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <EmpVoiceAnswerInfo>(); ent.DoDelete(); this.SetMessage("删除成功!"); break; default: if (RequestActionString == "batchdelete") { DoBatchDelete(); } else if (RequestActionString == "ischeck") { Ischeck(); } else { DoSelect(); } break; } }
//提交回复 private void DoRepply() { string ReplyId = RequestData.Get("ReplyId") + ""; string Content = RequestData.Get("Content") + ""; string NikeName = RequestData.Get("NikeName") + ""; var Ent = EmpVoiceAnswerInfo.Find(ReplyId); if (Ent != null) { EmpVoiceAnswerInfo SubEnt = new EmpVoiceAnswerInfo(); SubEnt.ParentId = Ent.Id; SubEnt.Answer = Content; SubEnt.NikeName = NikeName; SubEnt.CreateId = UserInfo.UserID; SubEnt.DoCreate(); Ent.ReplyCount = Ent.ReplyCount.GetValueOrDefault() + 1; if (!string.IsNullOrEmpty(Ent.NoReaderItem)) { Ent.NoReaderItem += "," + SubEnt.Id; } Ent.DoUpdate(); this.PageState.Add("AnserId", SubEnt.Id); } }
/// <summary> /// 查询 /// </summary> private void DoSelect() { string QuestionId = RequestData.Get <string>("Id"); SearchCriterion.AddSearch(EmpVoiceAnswerInfo.Prop_QuestionId, QuestionId); ents = EmpVoiceAnswerInfo.FindAll(SearchCriterion); this.PageState.Add("EmpVoiceAnswerInfoList", ents); }
private void DoBatchDelete() { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { EmpVoiceAnswerInfo.DoBatchDelete(idList.ToArray()); } }
private void DoSelect() { if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { ent = EmpVoiceAnswerInfo.Find(id); } this.SetFormData(ent); } }
private void DoCreate() { string Anonymity = RequestData.Get("Anonymity") + ""; string Answer = RequestData.Get("Answer") + ""; string QuestionId = RequestData.Get("QuestionId") + ""; var QEnt = EmpVoiceAskQuestion.Find(QuestionId); if (QEnt != null) { QEnt.AnswerCount = QEnt.AnswerCount.GetValueOrDefault() + 1; QEnt.DoUpdate(); } ent = this.GetPostedData <EmpVoiceAnswerInfo>(); ent.Anonymity = Anonymity; ent.DoCreate(); }
/// <summary> /// 查询 /// </summary> private void DoSelect() { ents = EmpVoiceAnswerInfo.FindAll(SearchCriterion); this.PageState.Add("AnswerInfoList", ents); }