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