Example #1
0
        private void btnGuest_Click(object sender, EventArgs e)
        {
            DBFactoryEnums db      = (DBFactoryEnums)cboDbOption.SelectedIndex + 1;
            LibraryProxy   library = LibraryProxy.GetInstance(db);

            library.GuestAccount();
            GoToMain();
        }
        private void frmBorrowReprot_Load(object sender, EventArgs e)
        {
            ReportDataSource rds = new ReportDataSource("DataSet1", LibraryProxy.GetInstance().GetReport());

            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.DataSources.Add(rds);
            reportViewer1.RefreshReport();
        }
Example #3
0
        private void btnLogIn_Click(object sender, EventArgs e)
        {
            DBFactoryEnums db      = (DBFactoryEnums)cboDbOption.SelectedIndex + 1;
            LibraryProxy   library = LibraryProxy.GetInstance(db);

            if (!library.Login(txtUsername.Text.Trim(), txtPassword.Text))
            {
                MessageBox.Show("Please Insert Username and Password");
            }
            if (library.account.AccountLevel >= AccountLevelEnums.Patron)
            {
                MessageBox.Show("Login success.");
                GoToMain();
            }
        }
Example #4
0
        public void LoadLevel()
        {
            switch (LibraryProxy.GetInstance((DBFactoryEnums)cboDbOption.SelectedIndex + 1).account.AccountLevel)
            {
            case AccountLevelEnums.Librarian:
                cboLevel.Items.Add(AccountLevelEnums.Patron);
                cboLevel.Items.Add(AccountLevelEnums.Librarian);
                break;

            case AccountLevelEnums.Manager:
                cboLevel.Items.Add(AccountLevelEnums.Patron);
                cboLevel.Items.Add(AccountLevelEnums.Librarian);
                cboLevel.Items.Add(AccountLevelEnums.Manager);
                break;

            default:
                cboLevel.Items.Add(AccountLevelEnums.Patron);
                break;
            }
            cboLevel.SelectedIndex = 0;
        }
Example #5
0
        private void btnSignIn_Click(object sender, EventArgs e)
        {
            var               libraryApp = LibraryProxy.GetInstance((DBFactoryEnums)cboDbOption.SelectedIndex + 1);
            string            address    = txtAddress.Text.Trim();
            string            phone      = txtPhone.Text.Trim();
            AccountLevelEnums level      = (AccountLevelEnums)cboLevel.SelectedIndex + 1;
            string            fullname   = txtFullname.Text.Trim();
            string            username   = txtUsername.Text.Trim();
            string            password   = txtPassword.Text;

            if (libraryApp.SignIn(fullname, address, phone, level, username, password))
            {
                MessageBox.Show("Sign In Success");
                txtAddress.Text  = "";
                txtFullname.Text = "";
                txtPassword.Text = "";
                txtPhone.Text    = "";
                txtUsername.Text = "";
            }
            else
            {
                MessageBox.Show("One or more field haven't been filled correctly");
            }
        }
Example #6
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     libraryapp = LibraryProxy.GetInstance();
     setLabelAccount();
     HideTab();
 }
 private void frmBookList_Load(object sender, EventArgs e)
 {
     libraryapp = LibraryProxy.GetInstance();
     loadAll();
 }
Example #8
0
 private void frmDeleteAccount_Load(object sender, EventArgs e)
 {
     libraryApp = LibraryProxy.GetInstance();
 }
 private void frmReturnedBook_Load(object sender, EventArgs e)
 {
     libraryApp = LibraryProxy.GetInstance();
 }
 public frmUpdateAccount(int id) : this()
 {
     lblID.Text = id.ToString();
     libraryApp = LibraryProxy.GetInstance();
     LoadAccount(Convert.ToInt32(lblID.Text));
 }
Example #11
0
 private void InputBook_Load(object sender, EventArgs e)
 {
     btnSelect.Enabled = false;
     libraryapp        = LibraryProxy.GetInstance();
     loadDataGrid(loadAll());
 }
Example #12
0
 private void frmSearchBook_Load(object sender, EventArgs e)
 {
     libraryapp = LibraryProxy.GetInstance();
     loadAllBook();
 }
Example #13
0
 private void frmChangePassword_Load(object sender, EventArgs e)
 {
     libraryApp = LibraryProxy.GetInstance();
 }
 private void frmBorrowHistory_Load(object sender, EventArgs e)
 {
     libraryApp = LibraryProxy.GetInstance();
     LoadAll();
 }