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