package
com.sqlitedb;
import
java.io.File;
import
com.ProjectClass.Client;
import
com.ProjectClass.Product;
import
com.ProjectClass.ToAddr;
import
com.projectConstant.ProjectConstant;
import
com.sqtest.R;
import
android.app.Activity;
import
android.database.Cursor;
import
android.os.Bundle;
import
android.util.Log;
import
android.view.Menu;
import
android.view.View;
import
android.view.View.OnClickListener;
import
android.widget.Button;
import
android.widget.CheckBox;
import
android.widget.EditText;
import
android.widget.TextView;
public
class
MainActivity
extends
Activity {
Button sure;
EditText login;
EditText pws;
CheckBox checkButton;
LoginDB mydb;
ProductDB myProductDB;
ToAddrDB myToAddrDB;
HistoryDB myHistoryDB;
TextView pwstext;
@Override
protected
void
onCreate(Bundle savedInstanceState) {
super
.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
}
public
void
init(){
sure = (Button)findViewById(R.id.button1);
login = (EditText)findViewById(R.id.editText2);
pws = (EditText)findViewById(R.id.editText1);
checkButton = (CheckBox)findViewById(R.id.checkBox1);
pwstext = (TextView)findViewById(R.id.textview1);
mydb =
new
LoginDB(
this
);
myProductDB =
new
ProductDB(
this
);
myToAddrDB =
new
ToAddrDB(
this
);
myHistoryDB =
new
HistoryDB(
this
);
InitDB();
sure.setOnClickListener(HistoryClick);
}
public
void
InitDB(){
markDir();
Product myproductInfo;
String
tcprices[] = {
"30"
,
"20"
,
"15"
,
"30"
,
"90"
,
"50"
};
String
tcproductNames[] = {
"烤鸭"
,
"烤鸡"
,
"烤牛"
,
"烤猪"
,
"烤狗"
,
"烤鼠"
};
String
tcnumbers[] = {
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
for
(
int
i =
0
; i < tcprices.length; i++){
myproductInfo =
new
Product();
String
price = tcprices[i];
myproductInfo.setProduct(
"贪吃吧"
, tcproductNames[i],
"null"
, price, tcnumbers[i]);
myProductDB.operateProduct(myproductInfo);
}
String
kxprices[] = {
"30"
,
"20"
,
"15"
,
"30"
,
"90"
,
"50"
};
String
kxproductNames[] = {
"溜冰"
,
"滑雪"
,
"吹牛"
,
"自恋"
,
"遛狗"
,
"溜鼠"
};
String
kxnumbers[] = {
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
for
(
int
i =
0
; i < kxprices.length; i++){
myproductInfo =
new
Product();
String
price = kxprices[i];
myproductInfo.setProduct(
"开心吧"
, kxproductNames[i],
"null"
, price, kxnumbers[i]);
myProductDB.operateProduct(myproductInfo);
}
String
lyprices[] = {
"30"
,
"20"
,
"15"
,
"30"
,
"90"
,
"50"
};
String
lyproductNames[] = {
"井冈山"
,
"青原山"
,
"庐山"
,
"泰山"
,
"江郎山"
,
"老虎山"
};
String
lynumbers[] = {
"2"
,
"2"
,
"2"
,
"2"
,
"2"
,
"2"
};
for
(
int
i =
0
; i < lyprices.length; i++){
myproductInfo =
new
Product();
String
price = lyprices[i];
myproductInfo.setProduct(
"健康吧"
, lyproductNames[i],
"null"
, price, lynumbers[i]);
myProductDB.operateProduct(myproductInfo);
}
String
tgprices[] = {
"30"
,
"20"
,
"15"
,
"30"
,
"90"
,
"50"
};
String
tgproductNames[] = {
"IPhone5"
,
"u8500"
,
"z470"
,
"y480"
,
"诺基亚"
,
"诺亚信"
};
String
tgnumbers[] = {
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
for
(
int
i =
0
; i < tgprices.length; i++){
myproductInfo =
new
Product();
String
price = tgprices[i];
myproductInfo.setProduct(
"团购吧"
, tgproductNames[i],
"null"
, price, tgnumbers[i]);
myProductDB.operateProduct(myproductInfo);
}
String
toName[] = {
"老张"
,
"老莫"
,
"老吴"
,
"老应"
,
"老周"
};
String
toAddr[] = {
"31栋127"
,
"31栋130"
,
"31栋119"
,
"31栋110"
,
"31栋129"
};
String
toTel[] = {
"18903067930"
,
"18103067930"
,
"18206067930"
,
"18307067430"
,
"18707067430"
};
ToAddr myToAddr =
new
ToAddr();
for
(
int
i =
0
; i <
5
; i++ ){
myToAddr.setAddrAndTel(
"lilin"
, toName[i], toAddr[i], toTel[i],
"false"
,
"false"
);
myToAddrDB.operateToAddrDB(myToAddr);
}
}
}