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