General table method

Source: Internet
Author: User

 

The following is a summary .. Thinking about a table is the most basic .. ..

Assume that the table user has two field IDs: username userpass (no less, I have never seen it before. An ID is used in a table.

.. Haha)

Next we will build our classes

Public class ubase
{
Public String ID;
Public String username;
Public String userpass;
}
------------------------------------------
Public class ubaseget
{
//////////////////////////////////////// //////////////////
/// Obtain the object
Public static user. ubase getubaseid (string ID)
Public static user. ubase getubasename (string username)
Public static user. ubase getubasedr (system. Data. datarow Dr)
}
Public class ubaseisext
{
//////////////////////////////////////// //////////////////
/// Check whether an object exists
Public static bool isextid (string ID)
Public static bool isextname (string username)
Public static bool isextnamepass (string username, string userpass)
}
Public class ubasedo
{
//////////////////////////////////////// //////////////////
/// Add deletion and modification actions
Public static void insert (user. ubase UB)
Public static void Update (user. ubase UB)
Public static void Delete (user. ubase UB)
}
Public class ubaselist
{
// Public String classid;
Public String page;
Public String pagesize = "10 ";

Public String firstpage;
Public String prevpage;
Public String nextpage;
Public String pagecount;
Public String listcount;

// The list content category is set to the top or not set to the top and the delimiter
Public String listtopstr;
Public String listloopstr;
Public String listlinemb;
Public String listlineover;

Public String liststr;
}
Public class ubaselistget
{
//////////////////////////////////////// ////////////////////
/// Obtain the list
Public static ubaselist getlist ()
Public static ubaselist getlisttopn (string topn)
Public static ubaselist getlistpagen (string pagenum)
}
------------------------------------------
Work is coming again .. Roar .. Busy .. Come back and try again .. The idea is probably like this .. Pagination depends on your needs .. The iner of the presentation layer has not been written yet, which is similar to the above .. Create a class .. Hurry up .. Haha ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.