📄 favoritesmanager.java
字号:
package com.gforce.gfoa;
/**
* <p>Title: 吉力科技办公自动化系统</p>
* <p>Description: 吉力科技办公自动化系统</p>
* <p>Copyright: 版权所有 2003 (c) 西安吉力科技发展有限公司 Copyright (c) 2003 GForce Sceince & Technology</p>
* <p>Company: 西安吉力科技发展有限公司 (GForce Sceince & Technology)</p>
* 收藏夹信息管理理类
* @author 王江涛
* @version 1.0
*/
import com.gforce.currency.database.*;
import com.gforce.currency.*;
import java.util.*;
public class FavoritesManager
extends RecordManager
{
public FavoritesManager()
{
}
protected final static String TableName = "Favorites"; //定义声明本类操作表名称
protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
protected final static String[] NumericFieldsName = {"ViewTimes", "KindsID", "IsOpen"}; //声明数值型字段名称
protected final static String[] StringFieldsName = {"Name", "URL"}; //声明字符型字段名称
protected final static String[] DatetimeFieldsName = {"LastViewTime"}; //声明日期时间型字段名称
protected final static String[] TextFieldsName = {}; //声明大字符串型字段名称
/**
* 根据字段名称获取插入数据时表单元素名称
* @param strFieldName 字段名称
* @return 表单素名称
*/
protected String InsertParament(String strFieldName)
{
return "" + strFieldName + ""; //可以根据需要加前缀、后缀
}
/**
* 根据字段名称获取修改数据时表单元素名称
* @param strFieldName 字段名称
* @return 表单素名称
*/
protected String UpdateParament(String strFieldName)
{
return "" + strFieldName + ""; //可以根据需要加前缀、后缀
}
/**
* 获取本类操作表名称
* @return 表名称
*/
public String getTableName()
{ //获取本类操作表名称
return TableName;
}
protected String getIDFieldName()
{ //获取主键或者可以确定唯一记录的字段名称
return IDFieldName;
}
protected String[] getNumericFieldsName()
{ //获取数值型字段名称
return NumericFieldsName;
}
protected String[] getStringFieldsName()
{ //获取字符型字段名称
return StringFieldsName;
}
protected String[] getDatetimeFieldsName()
{ //获取日期时间型字段名称
return DatetimeFieldsName;
}
protected String[] getTextFieldsName() { //获取大字符串型字段名称
return TextFieldsName;
}
public static Vector getAllRecord(String strKindsIDs)
{
Vector vt = SQLManager.GetResultSet("SELECT * FROM " + TableName +
" WHERE KindsID in( " + strKindsIDs + ") or IsOpen=1");
return vt;
}
public static Vector getAllRecord(int iKindsID)
{
Vector vt = new Vector();
if(iKindsID<1)
{
vt = SQLManager.GetResultSet("SELECT * FROM " + TableName + " WHERE IsOpen=1");
}
else
{
vt = SQLManager.GetResultSet("SELECT * FROM " + TableName + " WHERE KindsID=" + iKindsID + "");
}
return vt;
}
public static Vector getRecordByID(int intID, int intUserID)
{
Vector vt = SQLManager.GetResultSet("SELECT * FROM " + TableName +
" WHERE ID =" + intID +
" and (KindsID in (select ID from FavoritesKindInfo where UserID = " +
intUserID + ") or IsOpen=1)");
return vt;
}
public static void UpdateReocordView(int intID)
{
SQLManager.ExcuteSQL("Update " + TableName + " set LastViewTime='" + StringNew.GetDateString((new Date()),"yyyy-MM-dd HH:mm") + "',ViewTimes=(ViewTimes+1) where ID = " + intID);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -