Simple Web three-tier architecture system "Fifth Edition"

Source: Internet
Author: User

After a version, today is almost three-layer architecture behind the end of the code, this version is finished, the next is the foreground of the production, the front desk is not familiar with, still in-depth study. After a while to write, today first write the background code.

The three-tier architecture includes the DAL layer, the BLL layer, the UI layer (the Web layer), and the first few editions focus on the DAL, which is the writing of the data Access layer code. In fact, the code in the BLL layer is easy to write, really flexible to use, or need some algorithmic aspects of the base, the BLL business logic layer, mainly dealing with the logic of things, this layer does not involve and do not need to write the code in the database, because in the DAL layer has been written to complete, You only need to define it in the BLL.

Some of the code in the following HIBLL:

1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingSystem.Text;5 usingSystem.Threading.Tasks;6 7 usingSystem.Data;8 usingSystem.Data.SqlClient;9 usingDAL;Ten usingModel; One  A namespaceBLL - { -      Public classPERSONMG the     { -Persondao PD =NULL; -  -          Publicpersonmg () +         { -PD =NewPersondao (); +         } A  at         /// <summary> -         ///Increase Employee Information -         /// </summary> -         /// <param name= "name" >name of employee to add</param> -         /// <param name= "Sex" >the gender of the employee to be added</param> -         /// <param name= "Salary" >Employee pay to add</param> in         /// <returns>return True or False value: if it is true, add success if it is false display add failed</returns> -          Public BOOLInsert (person p) to         { +             returnPd.insert (p); -         } the          *         /// <summary> $         ///Delete Employee InformationPanax Notoginseng         /// </summary> -         /// <param name= "id" >to delete an employee's ID</param> the         /// <returns>return True or False value: If the deletion is true, the deletion is unsuccessful if it is a fake display</returns> +          Public BOOLDelete (person p) A         { the             returnPd.delete (p); +         } -          $         /// <summary> $         ///Change Employee Information -         /// </summary> -         /// <param name= "id" >employee number to change</param> the         /// <param name= "name" >name of employee to change</param> -         /// <param name= "Sex" >the gender of the employee to change</param>Wuyi         /// <param name= "Salary" >employee's salary to be changed</param> the         /// <returns>returns TRUE or false: If the change is true, the change is False if the display changes are unsuccessful</returns> -          Public BOOLUpdate (person p) Wu         { -             returnpd.update (p); About         } $        -         /// <summary> -         ///determine if employee names are duplicated -         /// </summary> A         /// <param name= "name" >name of employee to be judged</param> +         /// <returns>returns the True and False value: if it is really a duplicate, if it is false to add</returns> the          Public BOOLRepeat (person p) -         { $             returnpd.repeat (p); the         } the     } the}

Simple Web three-tier architecture system "Fifth Edition"

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.