asp.net (C #) +sql Server three-tier architecture data access scheme (vi)

Source: Internet
Author: User
Tags bool constructor contains
asp.net|server| Schema | Data #region Constructors

Public scoresetting ()

{

}

<summary>

Overloaded constructors

</summary>

<param name= "id" > integral setting id</param>

public scoresetting (int id)

{

This.id=id;

}

#endregion



#region Public methods

<summary>

Get integration setup information based on ID

</summary>

<returns> success true, Failure false</returns>

public bool Getinfobyid ()

{

Code slightly

}



<summary>

Add Integration settings

</summary>

<returns> success true, Failure false</returns>

public bool Add ()

{

Code slightly

}

<summary>

Programming Integration Settings

</summary>

<returns> returns true successfully, Failure returns false</returns>

public bool Edit ()

{

Code slightly

}

<summary>

Remove integration settings

</summary>

<returns> returns true successfully, Failure returns false</returns>

public bool Remove ()

{

Code slightly

}

}



Note: This class contains four parts, private members, constructors, public properties, public methods, and private members correspond to the fields of the database table, and the properties are relative to the private members. The constructor initializes the key of the data table, and, of course, the original additional private member of the constructor can be overloaded. This class contains four methods, which are the four operations of the data: read, write, delete, and change.



One, presentation layer (UI layer)

This layer is mainly read data. is basically populated with different server controls as required.



Scoresettingcollection SSC = new Scoresettingcollection ();

Functioncollection FUNCC = new Functioncollection ();

FUNCC. Getinfobyfunctionname ("edition name Management");

int functionid=funcc[0].id;

SSc. Getspecialinfo (functionid,0,roletypeid,bbstypeid,-1,-1,-1,-1);

int SSCCOUNT=SSC. Count;







The above code is the data reading process, according to Ssccount can be judged to have no data. Before populating the control with the data, the data is recycled to form a DataTable and then bound to the data.



Related Article

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.