提交 d0c8ac1f 编写于 作者: Sugar_chestnut03's avatar Sugar_chestnut03

Replace DBManager.java

上级 10c6663e
......@@ -16,11 +16,8 @@ public class DBManager {
DBOpenHelper helper = new DBOpenHelper(context); //得到帮助类对象
db = helper.getWritableDatabase(); //得到数据库对象
}
/**
* 读取数据库当中的数据,写入内存集合里
* kind :表示收入或者支出
* */
// 读取数据库当中的数据,写入内存集合里
// kind :表示收入或者支出
public static List<TypeBean> getTypeList(int kind){
List<TypeBean>list = new ArrayList<>();
//读取typetb表当中的数据
......@@ -38,6 +35,22 @@ public class DBManager {
}
return list;
}
/*
* 向记账表当中插入一条元素
* */
public static void insertItemToAccounttb(AccountBean bean){
ContentValues values = new ContentValues();
values.put("typename",bean.getTypename());
values.put("sImageId",bean.getsImageId());
values.put("beizhu",bean.getBeizhu());
values.put("money",bean.getMoney());
values.put("time",bean.getTime());
values.put("year",bean.getYear());
values.put("month",bean.getMonth());
values.put("day",bean.getDay());
values.put("kind",bean.getKind());
db.insert("accounttb",null,values);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册