such as Peng Network. NET three-tier architecture chapter II Login and Membership management

Source: Internet
Author: User

Explain the login function and member management function in the dining item

--------------------------------------------------------------------------------------------

Three-tier project: Relational data C # class data table name Class name field encapsulated into attribute three layer each function separate login window point login-"Call the BLL Method-" Call DAL Method-"Database Database-" dal-"bll-" ui- --------------------------------------------------------------------------------------------Singleton mode:
//private static readonly memberform Mf =new memberform ();        public static Memberform Getmemberform ()//{//return Mf;        } private static  memberform _instance; public static  Memberform Instance {get  {if (_instance = = NULL | |  _instance.                isdisposed) {_instance = new  memberform (); } return  _instance;}} Private  Memberform () {InitializeComponent ();}        
  Show only once, Singleton mode        private static membereditform _instance;  Show only once, Singleton mode        private static membereditform _instance;        <summary>//  /ture to modify false for new//        </summary>        private static bool _isedit;  Ture Modify false new//<summary>/////</summary>//        <param name= "Isedit" > Whether to modify </param>//        <param name= "Member" > Modified objects </param>///        <returns></ returns> public        static Membereditform single (bool isedit, Member Member)        {            if (_instance = = NULL || _instance. isdisposed)            {                _instance = new membereditform (member);            }            _isedit = isedit; return _instance;}      
Random number
               1. Generate random number                r=new random ();                int num = R.next (+ +);                String strdate = DateTime.Now.ToString ("Yyyymmddhhmmss");                Txtnum.text = strdate + num;  

Load list:

            MEMBERTYPEBLL BLL = new membertypebll ();            list<membertype> list = BLL. Getmembertypes (false);            List. Insert (0,new membertype () {Name = "Please select", Id =-1});            Cmbtype.datasource = list;            Cmbtype.displaymember = "Name"; Displayed value            cmbtype.valuemember = "Id";//Saved value   

Pop-up or close the window after the prompt window is finished

        Msgmd.msgdivshow ("Login succeeded. ", 1, Bind);                   .....        private void Bind ()        {            dialogresult=DialogResult.OK;            This. Cclose ();        }              

relational data is converted to object data, and special values are processed (null,<=0, etc.)

Write generic SQL statements as much as possible (do not have special functions in the statement, because the functions of each version function differently)

such as Peng Network: http://www.rupeng.com

such as Peng Network. NET three-tier architecture chapter II Login and Membership management

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.