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