/// <summary> /// 获得数据列表 /// </summary> public List <Dianda.Model.Document_File_Share> DataTableToList(DataTable dt) { List <Dianda.Model.Document_File_Share> modelList = new List <Dianda.Model.Document_File_Share>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Dianda.Model.Document_File_Share model; for (int n = 0; n < rowsCount; n++) { model = new Dianda.Model.Document_File_Share(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["FileID"].ToString() != "") { model.FileID = int.Parse(dt.Rows[n]["FileID"].ToString()); } model.ShareForUser = dt.Rows[n]["ShareForUser"].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.Document_File_Share model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Dianda.Model.Document_File_Share model) { return(dal.Add(model)); }