/// <summary> /// 获得数据列表 /// </summary> public List <XHD.Model.Personal_notes> DataTableToList(DataTable dt) { List <XHD.Model.Personal_notes> modelList = new List <XHD.Model.Personal_notes>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { XHD.Model.Personal_notes model; for (int n = 0; n < rowsCount; n++) { model = new XHD.Model.Personal_notes(); if (dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } if (dt.Rows[n]["emp_id"].ToString() != "") { model.emp_id = int.Parse(dt.Rows[n]["emp_id"].ToString()); } model.emp_name = dt.Rows[n]["emp_name"].ToString(); model.note_content = dt.Rows[n]["note_content"].ToString(); model.note_color = dt.Rows[n]["note_color"].ToString(); model.xyz = dt.Rows[n]["xyz"].ToString(); if (dt.Rows[n]["note_time"].ToString() != "") { model.note_time = DateTime.Parse(dt.Rows[n]["note_time"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// ��������б� /// </summary> public List<XHD.Model.Personal_notes> DataTableToList(DataTable dt) { List<XHD.Model.Personal_notes> modelList = new List<XHD.Model.Personal_notes>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { XHD.Model.Personal_notes model; for (int n = 0; n < rowsCount; n++) { model = new XHD.Model.Personal_notes(); if(dt.Rows[n]["id"].ToString()!="") { model.id=int.Parse(dt.Rows[n]["id"].ToString()); } if(dt.Rows[n]["emp_id"].ToString()!="") { model.emp_id=int.Parse(dt.Rows[n]["emp_id"].ToString()); } model.emp_name=dt.Rows[n]["emp_name"].ToString(); model.note_content=dt.Rows[n]["note_content"].ToString(); model.note_color=dt.Rows[n]["note_color"].ToString(); model.xyz=dt.Rows[n]["xyz"].ToString(); if(dt.Rows[n]["note_time"].ToString()!="") { model.note_time=DateTime.Parse(dt.Rows[n]["note_time"].ToString()); } modelList.Add(model); } } return modelList; }
/// <summary> /// 更新一条数据 /// </summary> public bool UpdateContent(XHD.Model.Personal_notes model) { return(dal.UpdateContent(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(XHD.Model.Personal_notes model) { return(dal.Add(model)); }