/// <summary> /// 获得数据列表 /// </summary> public List <hm.Model.sysItemCategory> DataTableToList(DataTable dt) { List <hm.Model.sysItemCategory> modelList = new List <hm.Model.sysItemCategory>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { hm.Model.sysItemCategory model; for (int n = 0; n < rowsCount; n++) { model = new hm.Model.sysItemCategory(); if (dt.Rows[n]["sicId"] != null && dt.Rows[n]["sicId"].ToString() != "") { model.sicId = int.Parse(dt.Rows[n]["sicId"].ToString()); } if (dt.Rows[n]["innerName"] != null && dt.Rows[n]["innerName"].ToString() != "") { model.innerName = dt.Rows[n]["innerName"].ToString(); } if (dt.Rows[n]["catName"] != null && dt.Rows[n]["catName"].ToString() != "") { model.catName = dt.Rows[n]["catName"].ToString(); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 获得数据列表 /// </summary> public List<hm.Model.sysItemCategory> DataTableToList(DataTable dt) { List<hm.Model.sysItemCategory> modelList = new List<hm.Model.sysItemCategory>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { hm.Model.sysItemCategory model; for (int n = 0; n < rowsCount; n++) { model = new hm.Model.sysItemCategory(); if(dt.Rows[n]["sicId"]!=null && dt.Rows[n]["sicId"].ToString()!="") { model.sicId=int.Parse(dt.Rows[n]["sicId"].ToString()); } if(dt.Rows[n]["innerName"]!=null && dt.Rows[n]["innerName"].ToString()!="") { model.innerName=dt.Rows[n]["innerName"].ToString(); } if(dt.Rows[n]["catName"]!=null && dt.Rows[n]["catName"].ToString()!="") { model.catName=dt.Rows[n]["catName"].ToString(); } modelList.Add(model); } } return modelList; }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(hm.Model.sysItemCategory model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(hm.Model.sysItemCategory model) { return(dal.Add(model)); }