/// <summary> /// 获得数据列表 /// </summary> public List <Tunnel.Model.Tunnel_kaosetting> DataTableToList(DataTable dt) { List <Tunnel.Model.Tunnel_kaosetting> modelList = new List <Tunnel.Model.Tunnel_kaosetting>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Tunnel.Model.Tunnel_kaosetting model; for (int n = 0; n < rowsCount; n++) { model = new Tunnel.Model.Tunnel_kaosetting(); model.k_id = Convert.ToInt64(dt.Rows[n]["k_id"].ToString()); model.k_amtime = dt.Rows[n]["k_amtime"].ToString(); model.k_pmtime = dt.Rows[n]["k_pmtime"].ToString(); model.k_xiu = dt.Rows[n]["k_xiu"].ToString(); model.k_am2time = dt.Rows[n]["k_am2time"].ToString(); model.k_pm2time = dt.Rows[n]["k_pm2time"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Tunnel.Model.Tunnel_kaosetting model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Tunnel.Model.Tunnel_kaosetting model) { return(dal.Add(model)); }