//public void Logout()
        //{}
        //Function: initialize a customer, and insert a new record of custoemr into db
        //Return: custoemr newd if user name is valid
        //    null if pName exists in db
        //user注册后,返回custoemr,把注册记录插到SysUser表
        public static Customer Register(string pName, string pPwd, string pMail)
        {
            Customer custom = null;
            bool? isExist = false;

            DataContextDataContext dc = new DataContextDataContext();
            dc.is_registered(pName, ref isExist);

            if (isExist == true)
            { } //custom = null
            else // not exist, can insert
            {
                try
                {
                    dc.insert_customer(pName, pPwd, pMail);
                    custom = new Customer(pName, pPwd, pMail);
                }
                catch (Exception ex)
                { } //custom = null;

            }

            return custom;
        }
        //Function: register a new manager of the system
        //Return: a manager newd if the record is creaded successfully
        //        null if returned if the manager with a same name exists in db
        public Manager RegisterManager(string pName, string pPwd, string pMail)
        {
            Manager manager = null;
            bool? isExist = false;

            DataContextDataContext dc = new DataContextDataContext();
            dc.is_registered(pName, ref isExist);

            if (isExist == true)
            { } //manager = null
            else // not exist, can insert
            {
                try
                {
                    dc.insert_manager(pName, pPwd, pMail);
                    manager = new Manager(pName, pPwd, pMail);
                }
                catch (Exception ex)
                { } //custom = null;

            }

            return manager;
        }