/// <summary> /// 获得数据列表 /// </summary> public List <GSSModel.SysLog> DataTableToList(DataTable dt) { List <GSSModel.SysLog> modelList = new List <GSSModel.SysLog>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { GSSModel.SysLog model; for (int n = 0; n < rowsCount; n++) { model = new GSSModel.SysLog(); if (dt.Rows[n]["F_ID"].ToString() != "") { model.F_ID = int.Parse(dt.Rows[n]["F_ID"].ToString()); } if (dt.Rows[n]["F_UserID"].ToString() != "") { model.F_UserID = int.Parse(dt.Rows[n]["F_UserID"].ToString()); } model.F_UserName = dt.Rows[n]["F_UserName"].ToString(); model.F_Note = dt.Rows[n]["F_Note"].ToString(); model.F_Data = dt.Rows[n]["F_Data"].ToString(); if (dt.Rows[n]["F_DateTime"].ToString() != "") { model.F_DateTime = DateTime.Parse(dt.Rows[n]["F_DateTime"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(GSSModel.SysLog model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(GSSModel.SysLog model) { return(dal.Add(model)); }