package com.android.ticket.test.login;
import static com.android.test.info.ConstantUtil.HEAD_HEIGHT;
import static com.android.test.info.ConstantUtil.HEAD_WIDTH;
import static com.android.test.info.ConstantUtil.SERVER_ADDRESS;
import static com.android.test.info.ConstantUtil.SERVER_PORT;
import java.util.Calendar;
import java.util.Vector;
import com.android.ticket.test.login.R;
import com.android.test.info.MovieInfo;
import com.android.test.info.handle.*;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.AdapterView;
import android.widget.AutoCompleteTextView;
import android.widget.DatePicker;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class tbuy extends Activity implements OnClickListener {
String username = null; //声明表示访问者,即使用搜索功能的用户ID
Button btnGo1 = null;
Button btnGo2 = null;
Calendar c;
Button setStartDataButton = null;
TextView filmnameLabel = null;
Button setfilmnameLabelButton = null;
Button searcherButton = null;
EditText filmnameLabelText = null;
BaseAdapter ba=null;
String[][]msgg=new String[][]{{""}};//声明引用
TextView startDataLabel = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.buy);
Intent i = getIntent();
username = i.getStringExtra("username");//visitor==username
CreatTable.creattable();
goBuy();
}
public void goBuy() {//日期,电影名查询
setContentView(R.layout.buy);
c = Calendar.getInstance();
startDataLabel = (TextView) this.findViewById(R.id.startData_label);//日期
startDataLabel.setText((c.get(Calendar.MONDAY) + 1) + "月" + c.get(Calendar.DAY_OF_MONTH)+ "日");
setStartDataButton = (Button) this.findViewById(R.id.startData_button);
setStartDataButton.setOnClickListener(this);
filmnameLabel = (TextView) this.findViewById(R.id.filmname_label);
setfilmnameLabelButton = (Button) this.findViewById(R.id.filmname_button);
setfilmnameLabelButton.setOnClickListener(this);
btnGo1 = (Button)findViewById(R.id.ticketSearch_button);//查询
btnGo2 = (Button)findViewById(R.id.ticketBuy_button);//购票
btnGo1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if(validate())
{
String filmname = filmnameLabel.getText().toString().trim();
String date = startDataLabel.getText().toString().trim();
//displayText(date);
Vector<Vector<String>> Query_filmname;
Query_filmname = LoadUtil.getSameVector1(filmname,date);
if(Query_filmname.size()==0)
{
Toast.makeText(tbuy.this, "对不起,没有相关的信息!!!", Toast.LENGTH_SHORT).show();
//etKeyword1.setText("");etKeyword2.setText("");
return;
}
else
{
String[][] msgInfo=new String[Query_filmname.elementAt(0).size()][Query_filmname.size()];//新建和结果向量对应的数组
for(int i=0;i<Query_filmname.size();i++)
{//for循环将结果向量中的数据导入数组
for(int j=0;j<Query_filmname.elementAt(0).size();j++)
{
msgInfo[j][i]=(String)Query_filmname.get(i).get(j);
}
}
goToListView(msgInfo);//切换到查询结果显示界面ListView界面
}
}
}
});
btnGo2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if(validate())
{
{
String start = filmnameLabel.getText().toString().trim();
String date = startDataLabel.getText().toString().trim();
//displayText(date);
Vector<Vector<String>> Query_filmname;
Query_filmname = LoadUtil.getSameVector2(start,date);
if(Query_filmname.size()==0)
{
Toast.makeText(tbuy.this, "对不起,没有相关的信息!!!", Toast.LENGTH_SHORT).show();
//etKeyword1.setText("");etKeyword2.setText("");
return;
}
else
{
String[][] msgInfo=new String[Query_filmname.elementAt(0).size()][Query_filmname.size()];//新建和结果向量对应的数组
for(int i=0;i<Query_filmname.size();i++)
{//for循环将结果向量中的数据导入数组
for(int j=0;j<Query_filmname.elementAt(0).size();j++)
{
msgInfo[j][i]=(String)Query_filmname.get(i).get(j);
}
}
goToListView1(msgInfo);//切换到查询结果显示界面ListView界面
}
}
}
}
});
}
public boolean validate() {
String filmname = filmnameLabel.getText().toString().trim();
if(filmname.equals(""))
{
Toast.makeText(tbuy.this, "请输入电影名", Toast.LENGTH_SHORT).show();
// DialogUtil.showDialog(this,"用户项必须填写!",false);
return false;
}
return true;
}
public void goToListView(String[][]mssg) {
msgg=mssg;//赋值引用给全局数组,用来实现返回按钮功能
setContentView(R.layout.detail);//切换界面
final String[][]msg=mssg;//新建数组,并赋值
ListView lv_detail=(ListView)this.findViewById(R.id.ListView_detail);//拿到ListView的引用
BaseAdapter ba_detail=new BaseAdapter()//新建适配器
{
public int getCount()
{
return msg[0].length;//得到列表的长度
}
public Object getItem(int arg0){return null;}
public long getItemId(int arg0){return 0;}
public View getView(int arg0, View arg1, ViewGroup arg2)//为每一项添加内容
{
LinearLayout ll_detail=new LinearLayout(tbuy.this);
ll_detail.setOrientation(LinearLayout.HORIZONTAL); //设置朝向
ll_detail.setPadding(5,5,5,5);//四周留白
for(int i=0;i<msg.length;i++)//为每一行设置显示的数据
{
TextView s= new TextView(tbuy.this);
s.setText(msg[i][arg0]);//TextView中显示的文字
s.setTextSize(11);//字体大小
s.setPadding(1,2,2,1);//四周留白
s.setWidth(53);//宽度
s.setGravity(Gravity.CENTER);
ll_detail.addView(s);//放入LinearLayout
}
return ll_detail;//将此LinearLayout返回
}
};
lv_detail.setAdapter(ba_detail);//将适配器添加进ListView
}
public void goToListView1(final String[][]mssg) {
msgg=mssg;//赋值引用给全局数组,用来实现返回按钮功能
setContentView(R.layout.buydetail);//切换界面
final String[][]msg=mssg;//新建数组,并赋值
ListView lv_detail=(ListView)this.findViewById(R.id.ListView_detail);//拿到ListView的引用
BaseAdapter ba_detail=new BaseAdapter()//新建适配器
{
public int getCount()
{
return msg[0].length;//得到列表的长度
}
public Object getItem(int arg0){return null;}
public long getItemId(int arg0){return 0;}
public View getView( final int arg0, View arg1, ViewGroup arg2)//为每一项添加内容
{
LinearLayout ll_detail=new LinearLayout(tbuy.this);
ll_detail.setOrientation(LinearLayout.HORIZONTAL);//设置朝向,水平
ll_detail.setPadding(5,5,5,5);//四周留白
for(int i=0;i<msg.length;i++)//为每一行设置显示的数据
{
TextView s= new TextView(tbuy.this);
s.setText(msg[i][arg0]);//TextView中显示的文字
s.setTextSize(11);//字体大小
s.setPadding(1,2,2,1);//四周留白
s.setWidth(45);//宽度
s.setGravity(Gravity.CENTER);
ll_detail.addView(s);//放入LinearLayout
}
Button b = new Button(tbuy.this);
b.setText("预定");
b.setOnClickListener(new View.OnClickListener() {
public void onC
没有合适的资源?快使用搜索试试~ 我知道了~
影院售票系统(android版)
共151个文件
class:76个
java:28个
xml:24个
需积分: 43 94 下载量 19 浏览量
2016-06-01
16:45:49
上传
评论 16
收藏 624KB RAR 举报
温馨提示
影院售票系统(android版)(初学者专用)(android课程设计专用),import后就可以运行。
资源推荐
资源详情
资源评论
收起资源包目录
影院售票系统(android版) (151个子文件)
resources.ap_ 102KB
ticket.apk 130KB
proguard.cfg 1KB
LoadUtil.class 9KB
tbuy.class 6KB
LoginInfoHandle.class 4KB
R$id.class 4KB
regited.class 3KB
DeleteMovie.class 3KB
Date$1.class 3KB
Date.class 3KB
insertfilm$1.class 3KB
MainmenuActivity1.class 3KB
MainmenuActivity.class 2KB
DeleteMovie$4.class 2KB
DeleteMovie$3.class 2KB
treturn$2.class 2KB
tbuy$4.class 2KB
querybydistrict$1.class 2KB
CreatTable.class 2KB
treturn.class 2KB
tquery$1.class 2KB
detail1.class 2KB
querybydistrict.class 2KB
tquery.class 2KB
SummitOrder$1.class 2KB
SummitOrder.class 2KB
tbuy$1.class 2KB
tbuy$2.class 2KB
DeleteMovie$2.class 2KB
DeleteMovie$1.class 2KB
vieworeder.class 2KB
treturn$1.class 2KB
treturn$2$1.class 2KB
DeleteMovie$4$1.class 2KB
querybydistrict$2.class 2KB
Release.class 2KB
detail1$1.class 2KB
tquery$2.class 2KB
vieworeder$1.class 2KB
tbuy$3.class 2KB
tbuy$4$1.class 2KB
MovieInfo.class 2KB
MainApplication$1.class 2KB
DatabaseHelper.class 2KB
tbuy$6.class 1KB
selectquery.class 1KB
tbuy$5.class 1KB
MainmenuActivity1$3.class 1KB
MainmenuActivity1$4.class 1KB
MainmenuActivity1$2.class 1KB
MainmenuActivity1$1.class 1KB
MainmenuActivity$3.class 1KB
MainmenuActivity$4.class 1KB
regited$repwdOnFocusChangeListener.class 1KB
MainmenuActivity$2.class 1KB
MainmenuActivity$1.class 1KB
insertfilm.class 1KB
LoginInfo.class 1KB
MyConnector.class 1KB
selectquery$2.class 1KB
selectquery$1.class 1KB
Purchase.class 1KB
MainApplication.class 1KB
regited$1.class 1KB
R$string.class 1KB
regited$2.class 1KB
R$layout.class 1KB
Date$2.class 1KB
ConstantUtil.class 998B
tbuy$7.class 969B
MainmenuActivity1$5.class 858B
MainmenuActivity$5.class 852B
R.class 667B
R$drawable.class 533B
R$style.class 514B
R$attr.class 373B
BuildConfig.class 367B
IDatabaseHandle.class 288B
.classpath 459B
Thumbs.db 341KB
Thumbs.db 6KB
Thumbs.db 5KB
classes.dex 60KB
tbuy.java 10KB
LoadUtil.java 8KB
R.java 8KB
DeleteMovie.java 7KB
Date.java 4KB
tquery.java 4KB
querybydistrict.java 4KB
treturn.java 4KB
LoginInfoHandle.java 4KB
regited.java 3KB
detail1.java 3KB
MainmenuActivity.java 3KB
MainmenuActivity1.java 3KB
vieworeder.java 3KB
SummitOrder.java 2KB
insertfilm.java 2KB
共 151 条
- 1
- 2
资源评论
wshyuiop
- 粉丝: 3
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 编译原理深⼊词法分析实践-实验报告
- Disk-Drill数据恢复软件MAC版,支持最新arm架构
- 上班摸鱼神器-纯透明小说阅读工具
- 音频视频转文字3.7.7每天都可以转3小时.apk
- rain-ripples.PNG
- Gitlab: Python项目CI/CD实践 > fastapi-t1 > Dockerfile
- Epic Toon FX 史诗卡通特效 Unity像素游戏素材特效美术资源unitypackage
- 概率论与潮流统计学在时尚产业的应用(文档加Matlab源码)
- springboot的校园失物招领系统源码.zip
- Skeleton-Low Poly 低多边形骨架模型Unity插件美术资源包unitypackage
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功