using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//
using System.Data.OleDb;

namespace Gs_Class
{
public partial class _BaseQueryWeb : System.Web.UI.Page
{ //查询基类
//全局变量
public string sGlobalError = "";

public virtual void Page_Load(object sender, EventArgs e)
{ //初始化
if (Page.IsPostBack) return;
OleDbCommand cmd = null;
initializeFormView(cmd);
initializeDataView(cmd);
//设置SEO参数
try { setSeoParam(); }
catch (Exception x) { }
}

#region //设置SEO参数 setSeoParam
public virtual bool setSeoParam() { return true; }
#endregion

#region//生成查询条件 buildFilter
/// <summary>
/// 生成查询条件
/// </summary>
/// <param name="sFilter">返回的查询条件</param>
/// <returns></returns>
public virtual bool buildFilter(ref string sFilter)
{
return buildFilter("", ref sFilter);
}
public virtual bool buildFilter(string sAddinFilter, ref string sFilter)
{
sFilter = sAddinFilter;
if (string.IsNullOrEmpty(sFilter)) sFilter = "";
return true;
}
public virtual string buildFilter(string sAddinFilter)
{ //直接返回string
string sF = "";
buildFilter(sAddinFilter, ref sF);
return sF.Trim();
}
/// <summary>
/// 关联查询条件
/// </summary>
/// <param name="sBaseFilter">原来的查询条件</param>
/// <param name="sFilterToAdd">要加到原来条件中的新条件</param>
/// <returns></returns>
public virtual bool linkFilter(ref string sBaseFilter, string sFilterToAdd)
{
return Gs_DataFunction.linkFilter(ref sBaseFilter, sFilterToAdd);
}
#endregion

#region//生成sql查询脚本,buildSqlScript。由runQuery调用
/// <summary>
/// 生成sql查询脚本,由runQuery调用
/// </summary>
/// <param name="sAddinFilter">附加的查询条件</param>
/// <param name="sql">生成的完整脚本</param>
/// <returns></returns>
public virtual bool buildSqlScript(string sAddinFilter, ref string sql)
{ //生成查询脚本
sql = getSqlSelectScriptFullNamed();
string sF = sAddinFilter;
//重要修改:2012-2-20,周承昊。原来查询条件生成不在这里边,拿到里边来生成。这可能引起之前的查询条件出错
sF = buildFilter(sF);
//修改结束:2012-2-20
if (!string.IsNullOrEmpty(sF)) sql += " and (" + sF + ") ";
//
return true;
}
#endregion

#region //脚本定义:加载、写入、删除 getSqlXXXScript
public virtual string getSqlSelectScript(params object[] args) { return "select * from sysObjects "; }
public virtual string getSqlSelectScriptFullNamed(params object[] args) { return getSqlSelectScript(args); }
public virtual string getSqlSelectScriptList(params object[] args) { return "select * from sysObjects "; }
public virtual string getSqlSelectScriptFullNamedList(params object[] args) { return getSqlSelectScriptList(args); }
public virtual string getSqlSaveScript(params object[] args) { return "select * from sysObjects "; }
public virtual string getSqlDeleteScript(params object[] args) { return "select * from sysObjects "; }
public virtual string getSqlPassScript(params object[] args) { return ""; }
#endregion

#region//查询系列,runQuery,可显示、打印、输出excel
/// <summary>
/// 查询系列,runQuery,可显示、打印、输出excel
/// </summary>
/// <param name="sAddinFilter">附加查询条件</param>
/// <param name="lShow">显示,默认显示到grd_Main上</param>
/// <param name="lPrint">打印</param>
/// <param name="sExportToExcelFileName">输出到excel的文件名,没有则忽略</param>
/// <returns>成功与否</returns>
public virtual bool runQuery(string sAddinFilter, bool lShow, bool lPrint, string sExportToExcelFileName, params object[] args)
{ //查询3
bool result = false;
string s = "", sql = "";
//
GridView grd = null;
object lbl = null;
OleDbConnection conn = null;
OleDbDataAdapter da = null;
DataSet ds = null;
DataTable dt = null;
BoundField bf = null;
try
{
//开始前的检查
if (!beforeRunQuery(sAddinFilter, lShow, lPrint, sExportToExcelFileName, args)) return false;
//查找控件
string sGrd = defaultGridViewName;
grd = getDefaultGridView();
if (grd == null) throw new Exception(fanyiStr("没有找到控件") + ":" + sGrd);
//设置grid的空显示
if (string.IsNullOrEmpty(grd.EmptyDataText)) grd.EmptyDataText = getDefaultEmptyDataText();
//
lbl = FindControl("lbl_Info");
if (lbl is Label) (lbl as Label).Text = "";
//脚本
if (!buildSqlScript(sAddinFilter, ref sql)) return false;
//数据处理
conn = getNewConnection();
da = new OleDbDataAdapter(sql, conn);
setQueryDataAdapterParam(da);
ds = new DataSet();
da.Fill(ds, "QueryResult");
dt = ds.Tables["QueryResult"];
//查询到数据之后
onRunQueryGetDate(ds, sAddinFilter, lShow, lPrint, sExportToExcelFileName, args);
//设置默认数据外观
if (lShow || lPrint || !string.IsNullOrEmpty(sExportToExcelFileName)) setDefaultFieldView(dt, args);
//显示
if (lShow)
{
setDefaultFieldViewShow(dt, args);
grd.DataSource = dt.DefaultView;
grd.DataBind();
//如果是自动生成列,则自动显示名称
if (grd.AutoGenerateColumns)
foreach (DataControlField col in grd.Columns) if (col is BoundField)
{
bf = col as BoundField;
s = bf.DataField;
if (dt.Columns.Contains(s) && dt.Columns[s].Caption != s) bf.HeaderText = dt.Columns[s].Caption;
}
}
//打印
if (lPrint)
{ setDefaultFieldViewPrint(dt, args); }
//输出excel
if (!string.IsNullOrEmpty(sExportToExcelFileName))
{
setDefaultFieldViewExportExcel(dt, args);
dt = ds.Tables["QueryResult"];
if (!Gs_DataFunction.exportToExcel(sExportToExcelFileName, dt)) throw new Exception(fanyiStr("导出") + "excel" + fanyiStr("文件") + sExportToExcelFileName + fanyiStr("出错") + "!");
}
//查询完成之后,处理一下
afterRunQuery(ds, sAddinFilter, lShow, lPrint, sExportToExcelFileName, args);
onRunQueryEnd(ds, sAddinFilter, lShow, lPrint, sExportToExcelFileName, args);
//完成
result = true;
}
catch (Exception x)
{
if (lbl is Label) (lbl as Label).Text = fanyiStr("查询出错");
s = Gs_Class.getJspTipScriptQuoted(fanyiStr("查询出错") + "\r\n" + x.Message + (enableDebug ? "\r\n" + fanyiStr("错误来源") + ":[runQuery]" : ""));
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", s, true);
}
finally
{ if (conn != null) conn.Close(); }
//
return result;
}

/// <summary>
/// 查询之前的预处理,比如可以检查设置、权限等
/// </summary>
/// <param name="sAddinFilter"></param>
/// <param name="lShow"></param>
/// <param name="lPrint"></param>
/// <param name="sExportToExcelFileName"></param>
/// <param name="args"></param>
/// <returns></returns>
public virtual bool beforeRunQuery(string sAddinFilter, bool lShow, bool lPrint, string sExportToExcelFileName, params object[] args)
{
return true;
}

/// <summary>
/// 设置查询用的数据接口的参数
/// </summary>
/// <param name="db">要设置的数据对象,设置之后,会执行db.fill(ds,"result")的操作</param>
/// <returns>返回成功与否</returns>
public virtual bool setQueryDataAdapterParam(OleDbDataAdapter db, params object[] args)
{ //设置查询参数
bool result = false;
result = true;
return result;
}

/// <summary>
/// 查询:显示?打印?输出到Excel的文件名?
/// </summary>
/// <param name="lShow"></param>
/// <param name="lPrint"></param>
/// <param name="sExportToExcelFileName"></param>
/// <returns></returns>
public virtual bool runQuery(bool lShow, bool lPrint, string sExportToExcelFileName, params object[] args)
{ //查询2,带excel输出
string sF = "";
//重要修改,2012-2-20,周承昊。
//下边这行原来没有屏蔽,2012-2-20号屏蔽了他。因为会导致重复调用buildFilter。
//这可能会引起之前做的一些查询查询条件出错。
//以后生成查询条件,都要在buildFilter里自己生成
//if (!buildFilter(ref sF)) return false;
//修改结束:2012-2-20
return runQuery(sF, lShow, lPrint, sExportToExcelFileName, args);
}
public virtual bool runQuery(bool lShow, bool lPrint, params object[] args) //查询1
{ return runQuery(lShow, lPrint, "", args); }
/// <summary>
/// RunQuery查询获取到数据之后,处理别的之前
/// </summary>
/// <param name="db">数据对象,dataSet</param>
/// <param name="sAddinFilter">runQuery传入的条件</param>
/// <param name="lShow">显示</param>
/// <param name="lPrint">打印</param>
/// <param name="sExportToExcelFileName">数据EXCEL</param>
/// <param name="args">动态参数</param>
/// <returns></returns>
public virtual bool onRunQueryGetDate(object db, string sAddinFilter, bool lShow, bool lPrint, string sExportToExcelFileName, params object[] args)
{
return true;
}
/// <summary>
/// RunQuery完全执行完毕之后
/// </summary>
/// <param name="db">数据对象,DataSet</param>
/// <param name="sAddinFilter">runQuery传入的查询条件</param>
/// <param name="lShow">显示</param>
/// <param name="lPrint">打印</param>
/// <param name="sExportToExcelFileName">输出EXCEL的文件名</param>
/// <param name="args">附加的动态参数</param>
/// <returns></returns>
public virtual bool onRunQueryEnd(object db, string sAddinFilter, bool lShow, bool lPrint, string sExportToExcelFileName, params object[] args)
{ return true; }
public virtual bool afterRunQuery(DataSet ds, string sAddinFilter, bool lShow, bool lPrint, string sExportToExcelFileName, params object[] args)
{ return true; }
#endregion

#region //查询和常用的链接 getNewConnection getNewQueryConnection
public virtual OleDbConnection getNewConnection() { return Gs_DataFunction.getNewConnection(); }
public virtual OleDbConnection getNewQueryConnection() { return getNewConnection(); }
#endregion

#region //默认的设置数据字段外观 setDefaultFieldView、setDefaultFieldViewShow、setDefaultFieldViewPrint、setDefaultFieldViewExportExcel
public virtual bool setDefaultFieldView(DataTable data, params object[] args)
{
return true;
}
public virtual bool setDefaultFieldViewShow(DataTable data, params object[] args)
{
return setDefaultFieldView(data, args);
}
public virtual bool setDefaultFieldViewPrint(DataTable data, params object[] args)
{
return setDefaultFieldView(data, args);
}
public virtual bool setDefaultFieldViewExportExcel(DataTable data, params object[] args)
{
return setDefaultFieldView(data, args);
}
#endregion

#region //获取显示用的表格控件,getDefaultGridView
/// <summary>
/// 查找默认的用于显示的GridView控件,默认名字是grd_Main,在getDefaultGridViewName方法中设置名字
/// </summary>
/// <returns></returns>
public virtual GridView getDefaultGridView()
{
string sGrd = defaultGridViewName;
ContentPlaceHolder cp = null;
GridView grd = Page.FindControl(sGrd) as GridView;
if (grd == null && Master != null)
{ //是否框架页,是的话,循环所有placeholder
grd = Master.FindControl(sGrd) as GridView;
if (grd == null)
foreach (Control obj in Master.Controls)
{ //查找所有子项
grd = obj.FindControl(sGrd) as GridView; //if (obj is ContentPlaceHolder)
if (grd != null) break;
//强行转换成母版页的内容项
cp = obj as ContentPlaceHolder;
if (cp != null) grd = cp.FindControl(sGrd) as GridView;
if (grd != null) break;
}
if (grd == null)
{
cp = Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder; //
if (cp != null) grd = cp.FindControl(sGrd) as GridView;
}
}
return grd;
}
/// <summary>
/// 默认gridView的名字,defaultGridViewName,用于查找显示,绑定显示
/// </summary>
/// <returns></returns>
public virtual string getDefaultGridViewName() { return "grd_Main"; }
public string defaultGridViewName { get { return getDefaultGridViewName(); } }
#endregion

#region //执行处理系列 runWork
public virtual bool runWork(OleDbCommand command, bool lTransaction, params object[] args)
{ //处理
bool result = false, runResult = false;
//
OleDbConnection conn = null;
OleDbCommand cmd = command;
Gs_DataFunction.getDataCommand(cmd, ref conn, ref cmd);
OleDbTransaction trans = cmd.Transaction;
bool lConn = conn.State == ConnectionState.Open, lTrans = trans != null;
//
try
{
//检查数据可靠性
//数据准备
if (!lConn) conn.Open();
if (lTransaction && !lTrans) { trans = conn.BeginTransaction(); cmd.Transaction = trans; } //事务
//处理
runResult = runWorkRun(conn, cmd, trans, lTransaction, args);
//完成
if (lTransaction) trans.Commit();
result = runResult;
}
catch (Exception x)
{
if (lTransaction && trans != null) trans.Rollback(); //撤消事务
onErrorRun(null, null, x, "处理出错![runWork]");
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", Gs_Class.getJspTipScriptQuoted("处理出错!\r\n" + x.Message + (enableDebug ? "\r\n错误来源:[runWork]" : "")), true);
}
finally
{ if (!lConn) conn.Close(); }
//完成返回
return result;
}
public virtual bool runWorkRun(OleDbConnection conn, OleDbCommand cmd, OleDbTransaction trans, bool lTransaction, params object[] args)
{ //处理数据的执行部分,直接调用。考虑事务、command是否存在之类问题由上级负责
return true;
}
public virtual bool runWork()
{ return runWork(null as OleDbCommand, true); }
#endregion

#region//应用权限 applyPopedom getPopModule getPopUnit之类定义
protected string fPopModule = "";
protected string fPopUnit = "";
protected string fApplication = "";
public virtual string sPopModule { get { return getPopModule(); } set { setPopModule(value); } }
public virtual string sPopUnit { get { return getPopUnit(); } set { setPopUnit(value); } }
public virtual string getPopModule(params object[] args) { return fPopModule; }
public virtual string getPopUnit(params object[] args) { return fPopUnit; }
public virtual void setPopModule(string AModule, params object[] args) { fPopModule = AModule; }
public virtual void setPopUnit(string AUnit, params object[] args) { fPopUnit = AUnit; }
//项目
public virtual string sApplication { get { return getApplication(); } set { setApplication(value); } }
public virtual string getApplication(params object[] args) { return fApplication; }
public virtual void setApplication(string AValue, params object[] args) { fApplication = AValue; }

public virtual bool applyPopedom(string sUserID, string sApplication, string sPopModule, string sPopUnit, params object[] args)
{
return true;
}
public virtual bool applyPopedom(object _iUser_Of_iPublic, OleDbConnection connection, params object[] args)
{
OleDbConnection conn = connection;
if (conn == null) conn = new OleDbConnection(ConfigurationManager.AppSettings["ConnectionString"]);
OleDbCommand cmd = new OleDbCommand("", conn);
return applyPopedom(_iUser_Of_iPublic, cmd, args);
}
public virtual bool applyPopedom(object _iUser_Of_iPublic, OleDbCommand command, params object[] args)
{
bool result = false;
//
OleDbCommand cmd = command;
OleDbConnection conn = null;
if (cmd != null) conn = command.Connection; //else conn = user.dbConnection;
Gs_DataFunction.getDataCommand(cmd, ref conn, ref cmd);
//
bool lConn = conn.State == ConnectionState.Open;
//处理
try
{
Session.Add("CheckPopedomModule", sPopModule); //记录到Session中备用
Session.Add("CheckPopedomUnit", sPopUnit);
//
result = applyPopedomRun(_iUser_Of_iPublic, conn, command, args);
}
catch (Exception x)
{
onErrorRun(null, null, x, "应用权限出错![applyPopedom]");
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", Gs_Class.getJspTipScriptQuoted("应用权限出错!\r\n" + x.Message + "\r\n错误来源:[applyPopedom]"), true);
//throw new Exception("[applyPopedom]应用权限出错!\r\n" + x.Message);
}
finally
{ if (!lConn) conn.Close(); }
//
return result;
}
public virtual bool applyPopedomRun(object _iUser_Of_iPublic, OleDbConnection conn, OleDbCommand cmd, params object[] args)
{ //应用权限
return true;
}
#endregion

#region //出错时执行 onErrorRun
/// <summary>
/// 出错时执行
/// </summary>
/// <param name="sender">调用者</param>
/// <param name="x"></param>
/// <param name="sBindInfo"></param>
/// <returns></returns>
public virtual bool onErrorRun(object sender, EventArgs e, Exception x, string sBindInfo, params object[] args)
{ //出错时的执行
string s = sBindInfo + " " + x.Message;
//if (x != null) s += "\r\n" + x.Message;
//
object obj = Page.FindControl("lbl_Info");
if (obj is Label) (obj as Label).Text = s;
else if (obj is TextBox) (obj as TextBox).Text = s;
//完成
return true;
}
#endregion

#region //是否生效调试接口 enableDebug getEnableDebug
public bool enableDebug { get { return getEnableDebug(); } }
public virtual bool getEnableDebug() { return true; }
public virtual string ifDebugShow(string sInfo) { if (enableDebug) return sInfo; else return ""; }
#endregion

#region//取选定的项目 getIdsSelected
public virtual bool getIdsSelected(ref ArrayList sIDArray)
{
string sCheckBoxControlName = "chk_SelectList";
object obj = getDefaultGridView();
if (!(obj is GridView)) return false;
//
GridView grd = obj as GridView;
return getIdsSelected(ref sIDArray, grd, sCheckBoxControlName);
}
public virtual bool getIdsSelected(ref ArrayList sIDArray, GridView grd, string sCheckBoxControlName)
{ //获取check选定的id们
bool result = false;
int i = 0;
string sID = "";
//
GridViewRow row = null;
CheckBox chk = null;
sIDArray.Clear();
for (i = 0; i < grd.Rows.Count; i++)
{
row = grd.Rows[i];
chk = row.FindControl(sCheckBoxControlName) as CheckBox;
if (chk == null) throw new Exception("查找CheckBox出错:找不到[" + sCheckBoxControlName + "]命名的控件。");
if (!chk.Checked) continue;
//
sID = grd.DataKeys[i].Value.ToString().Trim();
sIDArray.Add(sID);
}
result = true;
//
return result;
}
#endregion

#region //默认的grid翻页处理 defaultGridViewOnPageIndexChanging
/// <summary>
/// 默认的grid翻页处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public virtual void defaultGridViewOnPageIndexChanging(object sender, GridViewPageEventArgs e)
{
if (!(sender is GridView)) return;
(sender as GridView).PageIndex = e.NewPageIndex;
if (!runQuery(true, false)) return;
}

protected void defaultGridViewOnRowDataBound(object sender, GridViewRowEventArgs e)
{ //默认的gridRow数据绑定处理
GridView grd = sender as GridView;
GridViewRow row = e.Row;
if (row.RowType == DataControlRowType.DataRow)
{ //数据行
}
if (e.Row.RowType == DataControlRowType.Footer)
{ //页脚
defaultShowGridFooter(grd, row, nColFooter0, nColFooter1);
}
}
public int nColFooter0 { get { return getColFooter0Index(); } }
public virtual int getColFooter0Index() { return 0; }
public int nColFooter1 { get { return getColFooter1Index(); } }
public virtual int getColFooter1Index() { return nColFooter0 + 1; }
#endregion

#region //默认的显示页脚 defaultShowGridFooter
public virtual bool defaultShowGridFooter(GridView grd, GridViewRow row, int nRecordCountCell, int nPageCountCell)
{ //显示页脚
bool result = false;
if (!(grd is GridView)) return result;
//
int nRecCount = -1, nPageCount = -1;
DataView dv = null;
DataTable dt = null;
OleDbDataReader dr = null;
//区分取什么类型
object gds = grd.DataSource;
if ((gds is DataView) && (dv = gds as DataView) != null)
nRecCount = dv.Count;
else
if ((gds is DataTable) && (dt = gds as DataTable) != null) nRecCount = dt.Rows.Count;
//显示
string sHangTitle = fanyiStr("行数") + ":", sYeTitle = fanyiStr("页数") + ":";
if (nPageCountCell == nRecordCountCell && nRecordCountCell > -1)
{ //显示在同一格里
row.Cells[nPageCountCell].Text = sHangTitle + nRecCount.ToString() + ";" + sYeTitle + grd.PageCount.ToString();
}
else
{ //显示在不同格里
if (nRecordCountCell > -1) //((row.Cells.Count - 1) >= nRecordCountCell)
row.Cells[nRecordCountCell].Text = sHangTitle + "" + nRecCount.ToString();
if (nPageCountCell > -1) //((row.Cells.Count - 1) >= nPageCountCell)
row.Cells[nPageCountCell].Text = sYeTitle + "" + grd.PageCount.ToString();
}
result = true;
//
return result;
}
#endregion

#region //初始化界面 initializeFormView、initializeDataView。
public virtual bool initializeFormView(OleDbCommand command, params object[] args)
{ //初始化界面
return true;
}
public virtual bool initializeDataView(OleDbCommand command, params object[] args)
{ //初始化数据
return true;
}
#endregion

#region //获取当前路径相访问root的相对路径 GetRootRelativePath
/// <summary>
/// 获取当前路径相访问root的相对路径,传入当前地址,传入空则默认为“。”,当前路径。
/// 返回这种格式:../../,然后程序可以这样用:../scripts/jPublic.js
/// </summary>
public virtual string getRootRelativePath()
{
return Gs_Class.getRootRelativeUrl("");
}
#endregion

#region //传入的URL参数,比如A.aspx?P1=1&P2=2&P3=3
/// <summary>
/// 传入的URL参数,比如A.aspx?P1=1&P2=2&P3=3
/// </summary>
/// <returns>Request.QueryString.ToString()</returns>
public virtual string get传入的全部参数URL字符串()
{
return HttpContext.Current.Request.QueryString.ToString();
}
#endregion

#region //消息提示 jsAlert
public static void jsAlert(Control obj, string str)
{
ScriptManager.RegisterStartupScript(obj, obj.GetType(), "js0044" + DateTime.Now.ToString("hhmmss"), Gs_Class.getJspTipScript(str), false);
}
#endregion

public virtual string fanyiStr(string sChina) { return fanyiStr(sChina, sChina); }
public virtual string fanyiStr(string sChina, string sDefault) { if (!string.IsNullOrEmpty(sChina)) return sChina; else return sDefault; }
public virtual string getDefaultEmptyDataText() { return fanyiStr("没有符合查询要求的数据"); }
//public virtual string get行数Title() { return fanyiStr("行数"); }
//public virtual string get页数Title() { return fanyiStr("页数"); }
public static object tryNullTo(object oValue, object oDefault) { return Gs_Class.tryNullTo(oValue, oDefault); }

}

}

Gs_Class._BaseQueryWeb查询页面基类(aspx.net)的更多相关文章

  1. [转]后台页面访问权限:页面基类&内置票据认证 使用方法

    本文转自:http://www.cnblogs.com/fishtreeyu/archive/2011/01/29/1947421.html 一般网站后台页面除了登录页面login.aspx未登录用户 ...

  2. 《手把手教你》系列基础篇(九十七)-java+ selenium自动化测试-框架设计篇-Selenium方法的二次封装和页面基类(详解教程)

    1.简介 上一篇宏哥介绍了如何设计支持不同浏览器测试,宏哥的方法就是通过来切换配置文件设置的浏览器名称的值,来确定启动什么浏览器进行脚本测试.宏哥将这个叫做浏览器引擎类.这个类负责获取浏览器类型和启动 ...

  3. System.Web.UI.Page的页面基类

    服务器端的page类 所有我们编写的页面都继承自page类,可见page类是非常重要的,page类提供了哪些功能,直接决定了我们的页面类可以继承什么功能,或者说,直接决定了我们的页面类功能的强大与否! ...

  4. 继承System.Web.UI.Page的页面基类

    服务器端的page类      所有我们编写的页面都继承自page类,可见page类是非常重要的,page类提供了哪些功能,直接决定了我们的页面类可以继承什么功能,或者说,直接决定了我们的页面类功能的 ...

  5. Mybatis包分页查询java公共类

    Mybatis包分页查询java公共类   分页----对于数据量非常大的查询中.是不可缺少的. mybatis底层的分页sql语句因为须要我们自己去手动写.而实现分页显示的时候我们须要依据分页查询条 ...

  6. JQuery功能查询页

    JQuery在前端开发中已经是常用的不能再常用的库了.最近的项目中使用到了JQuery,我第一次接触它的时候为了学习,把常用的操作指令用比较小的字体写在一页word上,打印出来贴在桌子上,用来让自己时 ...

  7. avalonjs学习笔记之实现一个简单的查询页

    官网地址:http://avalonjs.coding.me/ 因为是为了学习js,所以对样式没什么要求,先放效果图: 步骤为:初始页面-------条件查询-------编辑员工1-------保存 ...

  8. Mybatis中多个参数的问题&&动态SQL&&查询结果与类的对应

    ### 1. 抽象方法中多个参数的问题 在使用MyBatis时,接口中的抽象方法只允许有1个参数,如果有多个参数,例如: Integer updatePassword( Integer id, Str ...

  9. php的分页查询建立分页类

    创建一个分页类 <?php /** file: page.class.php 完美分页类 Page */ class Page { private $total; //数据表中总记录数 priv ...

随机推荐

  1. 最受欢迎的Web开发工具

    1)WebBuilderWebBuilder是一款开源的可视化Web应用开发和运行平台.基于浏览器的集成开发环境,可视化和智能化的设计,能轻松完成常规应用和面向手机的移动应用开发:高效.稳定和可扩展的 ...

  2. JUnit java单元测试

    首先须导入JUnit包:所在项目右击->Build Path->Add Libraries->选择JUnit->选择一个版本->Finish 一.手动生成 1.测试方法, ...

  3. python email ==> send 发送邮件 :) [smtplib, email 模块]

    关于Email的预备知识: 原贴地址:http://www.cnblogs.com/lonelycatcher/archive/2012/02/09/2343480.html ############ ...

  4. Liferay的架构:缓存(第一部分)

    这次,我将要涉及到一个非常重要的概念:缓存.在当今的web应用中,如果没有设计一个比较好的缓存系统,在web中就不可能有一个良好的性能.所以我将要 提到的缓存不仅仅能够更好地理解Liferay架构,而 ...

  5. [Python]根据地址从maps文件中找相应的库名

    /proc/PID/maps提供了进程的memory layout,下面脚本根据给定地址找出相应的库名: #!/usr/bin/python from __future__ import print_ ...

  6. 设置代码ios 6添加日历事件No calendar has been set.错误

    查了好多资料,发明还是不全,干脆自己整理吧,至少保证在我的做法正确的,以免误导读者,也是给自己做个记录吧! 在iOS 6做日历事件添加时,来来回回报错,No calendar has been set ...

  7. 开发一个微信小程序教程

    一.注册小程序账号 1.进入微信公众平台(https://mp.weixin.qq.com/),注册小程序账号,根据提示填写对应的信息即可. 2.注册成功后进入首页,在 小程序发布流程->小程序 ...

  8. php钩子程序设计

      序   作为程序员,设计出优雅而完美的系统,永远是让我们非常兴奋的事情.高手不在于你会多少语言,而在于你有多高的思想.   在设计中,怎么体现自身价值,那就是要比别人多想几步.   讲钩子程序,起 ...

  9. 软件各种版本的含义!例如RC,M,GA等等

    RC版本   RC:(Release Candidate)   Candidate是候选人的意思,用在软件上就是候选版本.Release是发行.发布的意思.Release.Candidate.就是发行 ...

  10. java 实现Excel压缩成Zip导出

    1 概述 在web项目中常见的一种场景就是将文件导出为Excel,但是当需要导出多个Excel时,使用者将频繁操作,这样就严重降低了项目的友好交互性以及易用性,那么怎么才能优雅的解决这个问题呢?笔者今 ...