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