Esempio n. 1
0
        private void createAccountButton_Click_1(object sender, EventArgs e)
        {
            DataAccess.LibraryInfo lib  = new DataAccess.LibraryInfo();
            Entities.Member        nmem = new Entities.Member();
            nmem.Username = userBox2.Text;
            nmem.Password = passwordBox2.Text;
            nmem.Name     = nameBox2.Text;
            nmem.Address  = addressBox2.Text;
            nmem.Phone    = mobileBox2.Text;
            int a = lib.SignUp(nmem);

            if (a == 1)
            {
                MessageBox.Show("Sign Up Successful");
            }
            else if (a == 0)
            {
                MessageBox.Show("Sign Up Unsuccessful");
            }
            else if (a == 6)
            {
                MessageBox.Show("Invalid UserID");
            }
            else if (a == 2)
            {
                MessageBox.Show("Invalid Name");
            }
            else if (a == 3)
            {
                MessageBox.Show("Invalid Password");
            }
            else if (a == 4)
            {
                MessageBox.Show("Invalid Address");
            }
            else if (a == 5)
            {
                MessageBox.Show("Invalid Phone");
            }
            else if (a == 404)
            {
                MessageBox.Show("UserID already taken.\nChoose Different userID.");
            }
        }
Esempio n. 2
0
 public bool DeleteAdmin(Member admin)
 {
     return(AdministratorList.Remove(admin));
 }
 public bool Delete(Entities.Member member)
 {
     return(_dataContext.Delete(member) > 0);
 }
 public bool Update(Entities.Member member)
 {
     return(_dataContext.Update(member) > 0);
 }
 public int Add(Entities.Member member)
 {
     return((int)_dataContext.Insert(member));
 }