📄 form.java
字号:
package mypkg;
import java.util.*;
import java.sql.*;
import java.text.*;
public class form extends Execute_DB
{
//定义类成员变量
private long GoodsID;
private long UserID;
private String strSql;
private String CreateTime;
private String FormID;
private float Totals;
private String PayKey;
//初始化类成员变量
public form()
{
this.GoodsID=0;
this.UserID=0;
java.util.Date NowTime = new java.util.Date();
this.CreateTime = NowTime.toLocaleString();
this.strSql="";
}
//向form数据表中添加一条新记录
public boolean add_form()
{
this.strSql="insert into form ";
this.strSql=this.strSql + "(";
this.strSql=this.strSql + "FormID,";
this.strSql=this.strSql + "UserID,";
this.strSql=this.strSql + "Totals,";
this.strSql=this.strSql + "PayKey,";
this.strSql=this.strSql + "CreateTime";
this.strSql=this.strSql + ") ";
this.strSql=this.strSql + "values(";
this.strSql=this.strSql + "'" + this.FormID + "',";
this.strSql=this.strSql + "'" + this.UserID + "',";
this.strSql=this.strSql + "'" + this.Totals + "',";
this.strSql=this.strSql + "'" + this.PayKey + "',";
this.strSql=this.strSql + "'" + this.CreateTime + "'";
this.strSql=this.strSql + ")";
boolean isAdd = super.exeSql(this.strSql);
return isAdd;
}
//删除成员变量GoodsID中对应的图书信息
public boolean delete_form()
{
this.strSql="delete from goods where GoodsID =";
this.strSql=this.strSql + this.GoodsID;
boolean isDelete = super.exeSql(this.strSql);
return isDelete;
}
//删除类DeleteGoodsID中对应的图书信息
public boolean delete_goods(String DeleteGoodsID)
{
this.strSql="delete from goods where GoodsID in (";
this.strSql=this.strSql + DeleteGoodsID + ")";
boolean isDelete = super.exeSql(this.strSql);
return isDelete;
}
//获取所有购物信息,返回一个boolean类型对象
public boolean showform()
{
this.strSql="select * from formsendno ";
try
{
ResultSet rs = super.exeSqlQuery(this.strSql);
if (rs.next())
{
this.FormID=rs.getString("FormID");
this.Totals=rs.getFloat("Totals");
return true;
}
else
{
return false;
}
}
catch(Exception ex)
{
return false;
}
}
public ResultSet showsendno()
{
this.strSql="select * from formsendno where Send=0 and Pay=1 ";
ResultSet rs = null;
try
{
rs = super.exeSqlQuery(this.strSql);
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
return rs;
}
//设置类成员变量FormID的值
public void setFormID(String FormID)
{
this.FormID = FormID;
}
//获取类成员变量FormID的值
public String getFormID()
{
return this.FormID;
}
///
//设置类成员变量FormID的值
public void setTotals(float Totals)
{
this.Totals = Totals;
}
//获取类成员变量FormID的值
public float getTotals()
{
return this.Totals;
}
//设置类成员变量Key的值
public void setPayKey(String PayKey)
{
this.PayKey = PayKey;
}
//获取类成员变量FuKuan的值
public String getPayKey()
{
return this.PayKey;
}
//设置类成员变量UserID的值
public void setUserID(long UserID)
{
this.UserID = UserID;
}
//获取类成员变量UserID的值
public long getUserID()
{
return this.UserID;
}
//设置类成员变量CreateTime的值
public void setCreateTime(String CreateTime)
{
this.CreateTime = CreateTime;
}
//获取类成员变量CreateTime的值
public String getCreateTime()
{
return this.CreateTime;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -