string type = String.Empty; // 对象类型 protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); type = RequestData.Get <string>("type"); SupervisionDC ent = null; if (!string.IsNullOrEmpty(id)) { ent = SupervisionDC.Find(id); } switch (RequestActionString) { case "update": ent = this.GetMergedData <SupervisionDC>(); ent.DoUpdate(); break; case "create": ent = this.GetPostedData <SupervisionDC>(); ent.DoCreate(); break; default: IList <DangerSource> dsEnts = DangerSource.FindAll(); PageState.Add("DSEnts", dsEnts); SetFormData(ent); if (ent != null) { string sql = @"select * from NCRL_SP..DangerSource where PatIndex('%'+Id+'%','" + ent.DangerSourceIds + "')>0 "; PageState.Add("DataList", DataHelper.QueryDictList(sql)); } break; } }
private void DoBatchDelete() { IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { SupervisionDC.DoBatchDelete(idList.ToArray()); } }
protected void Page_Load(object sender, EventArgs e) { SupervisionDC ent = null; switch (this.RequestAction) { case RequestActionEnum.Delete: ent = this.GetTargetData <SupervisionDC>(); ent.DoDelete(); break; default: if (RequestActionString == "batchdelete") { DoBatchDelete(); } else { DoSelect(); } break; } }
private void DoSelect() { ents = SupervisionDC.FindAll(SearchCriterion); PageState.Add("DataList", ents); }