/// <summary> /// 获得数据列表 /// </summary> public List <JMP.MDL.jmp_userlog> DataTableToList(DataTable dt) { List <JMP.MDL.jmp_userlog> modelList = new List <JMP.MDL.jmp_userlog>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { JMP.MDL.jmp_userlog model; for (int n = 0; n < rowsCount; n++) { model = new JMP.MDL.jmp_userlog(); if (dt.Rows[n]["l_id"].ToString() != "") { model.l_id = int.Parse(dt.Rows[n]["l_id"].ToString()); } if (dt.Rows[n]["l_user_id"].ToString() != "") { model.l_user_id = int.Parse(dt.Rows[n]["l_user_id"].ToString()); } if (dt.Rows[n]["l_logtype_id"].ToString() != "") { model.l_logtype_id = int.Parse(dt.Rows[n]["l_logtype_id"].ToString()); } model.l_ip = dt.Rows[n]["l_ip"].ToString(); model.l_location = dt.Rows[n]["l_location"].ToString(); model.l_info = dt.Rows[n]["l_info"].ToString(); model.l_sms = dt.Rows[n]["l_sms"].ToString(); if (dt.Rows[n]["l_time"].ToString() != "") { model.l_time = DateTime.Parse(dt.Rows[n]["l_time"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JMP.MDL.jmp_userlog model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JMP.MDL.jmp_userlog model) { return(dal.Add(model)); }