/// <summary> /// 获得数据列表 /// </summary> public List <ERM.MDL.RefDetail> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List <ERM.MDL.RefDetail> modelList = new List <ERM.MDL.RefDetail>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { ERM.MDL.RefDetail model; for (int n = 0; n < rowsCount; n++) { model = new ERM.MDL.RefDetail(); model.content = ds.Tables[0].Rows[n]["content"].ToString(); if (ds.Tables[0].Rows[n]["imageindex"].ToString() != "") { model.imageindex = int.Parse(ds.Tables[0].Rows[n]["imageindex"].ToString()); } model.keyWord = ds.Tables[0].Rows[n]["keyWord"].ToString(); if (ds.Tables[0].Rows[n]["layer"].ToString() != "") { model.layer = int.Parse(ds.Tables[0].Rows[n]["layer"].ToString()); } if (ds.Tables[0].Rows[n]["nodeid"].ToString() != "") { model.nodeid = int.Parse(ds.Tables[0].Rows[n]["nodeid"].ToString()); } if (ds.Tables[0].Rows[n]["parentid"].ToString() != "") { model.parentid = int.Parse(ds.Tables[0].Rows[n]["parentid"].ToString()); } model.title = ds.Tables[0].Rows[n]["title"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(ERM.MDL.RefDetail model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(ERM.MDL.RefDetail model) { dal.Add(model); }