/// <summary> /// 获得数据列表 /// </summary> public List <ERM.MDL.Category> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List <ERM.MDL.Category> modelList = new List <ERM.MDL.Category>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { ERM.MDL.Category model; for (int n = 0; n < rowsCount; n++) { model = new ERM.MDL.Category(); if (ds.Tables[0].Rows[n]["id"].ToString() != "") { model.id = int.Parse(ds.Tables[0].Rows[n]["id"].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.Category model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(ERM.MDL.Category model) { dal.Add(model); }