コード例 #1
0
ファイル: User.cs プロジェクト: mushky21/LibraryProject
        //private int codeCredit;


        //option credit of History Actions+event of warning message?can be from type of guid

        //ctor
        public User(string userName, string password, string phone, string city, string birthDate, CodeOccupation codeOccupation = 0)//OPTIONAL FOR REGISTER OF USER!!
        {
            _userName         = userName;
            _password         = password;
            _codeOccupation   = codeOccupation;
            _phone            = phone;
            _city             = city;
            _rentedItems      = new List <RentItem>();
            _NumOfRentedItems = 0;
            _birthDate        = birthDate;
        }
コード例 #2
0
        //add user to user collection
        private void AddUser(CodeOccupation code)
        {
            User user    = new User(Username.Text, Password.Password, Phone.Text, City.Text, birthDate.Date.ToString("dd/MM/yyyy"), code);
            bool isAdded = MainPage.Users.AddUser(user);//check if adding of user Succeeded

            if (!isAdded)
            {
                MessageErrorUsername();
            }
            else
            {
                MessageSuccessRegistration();
            }
        }