/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.ChinaZone> DataTableToList(DataTable dt) { List <Hownet.Model.ChinaZone> modelList = new List <Hownet.Model.ChinaZone>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.ChinaZone model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.ChinaZone(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ZoneID"].ToString()); } model.ParentID = dt.Rows[n]["ParentID"].ToString(); if (dt.Rows[n]["OrderNum"].ToString() != "") { model.OrderNum = int.Parse(dt.Rows[n]["OrderNum"].ToString()); } model.InfoNum = dt.Rows[n]["InfoNum"].ToString(); model.Name = dt.Rows[n]["Name"].ToString(); model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.ChinaZone model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.ChinaZone model) { return(dal.Add(model)); }