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