private void btnSbmt_Click(object sender, EventArgs e)
        {
            string confirme    = txtBoxCurrPass.Text;
            string newUsername = txtBoxNewUsername.Text;

            if (info.GetType() == typeof(AdminClass))
            {
                AdminClass admin = (AdminClass)info;
                bool       done  = admin.ChangeUsername(confirme, newUsername);
                if (done)
                {
                    MessageBox.Show("Username updated succssesfully");
                    Application.Exit();
                }
                else
                {
                    MessageBox.Show("Enter a correct password");
                }
            }
            else if (info.GetType() == typeof(CustomerClass))
            {
                CustomerClass customer = (CustomerClass)info;
                bool          done     = customer.ChangeUserName(confirme, newUsername);
                if (done)
                {
                    MessageBox.Show("Username updated succssesfully");
                    Application.Exit();
                }
                else
                {
                    MessageBox.Show("Enter a correct password");
                }
            }
        }
Example #2
0
        public ViewTransactions(Object o)
        {
            InitializeComponent();
            dataGridView1.AutoGenerateColumns                       = true;
            dataGridView1.RowsDefaultCellStyle.BackColor            = Color.LightGray;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
            if (o.GetType() == typeof(AdminClass))
            {
                AdminClass adminInfo = (AdminClass)o;
                dataGridView1.DataSource = adminInfo.GetTransactionReport().Tables[0];
            }
            else if (o.GetType() == typeof(CustomerClass))
            {
                CustomerClass customer = (CustomerClass)o;
                dataGridView1.DataSource = customer.getTransactions().Tables[0];
            }
            dataGridView1.Columns[3].DisplayIndex = 0;
            dataGridView1.Columns[0].DisplayIndex = 1;
            dataGridView1.Columns[1].DisplayIndex = 2;
            dataGridView1.Columns[2].DisplayIndex = 3;
            dataGridView1.Columns[4].DisplayIndex = 4;

            dataGridView1.Columns[0].HeaderText = "From Account Number";
            dataGridView1.Columns[1].HeaderText = "To Account Number";
            dataGridView1.Columns[2].HeaderText = "IBAN";
            dataGridView1.Columns[3].HeaderText = "Date / Time";
            dataGridView1.Columns[4].HeaderText = "Transfer Amount";
        }
Example #3
0
        public PayBills(CustomerClass cl)
        {
            List <string> l = new List <string>();

            c  = cl;
            ds = c.GetCooperativeName();
            foreach (DataTable table in ds.Tables)
            {
                foreach (DataRow dr in table.Rows)
                {
                    l.Add(dr[0].ToString());
                }
            }
            if (l.Count == 0)
            {
                MessageBox.Show("There Is No Bills !!");
                this.Close();
            }
            else
            {
                InitializeComponent();
                foreach (string s in l)
                {
                    comboBox1.Items.Add(s);
                }
                this.Show();
            }
        }
Example #4
0
        private void btnSbmtLogin_Click(object sender, EventArgs e)
        {
            int idx = cmboUserType.SelectedIndex;

            if (idx == 0)
            {
                this.Hide();
                AdminMasterClass master = new AdminMasterClass(txtbxUsernameLogin.Text, txtbxPassLogin.Text);
                if (master.Login())
                {
                    AdminMaster adminMaster = new AdminMaster(master);
                    adminMaster.Show();
                }
                else
                {
                    MessageBox.Show("Please Enter Correct Username and Password");
                    Application.Restart();
                }
            }
            else if (idx == 1)
            {
                this.Hide();
                AdminClass a = new AdminClass(txtbxUsernameLogin.Text, txtbxPassLogin.Text);
                if (a.Login())
                {
                    Admin admin = new Admin(a);
                    admin.Show();
                }
                else
                {
                    MessageBox.Show("Please Enter Correct Username and Password!");
                    Application.Restart();
                }
            }
            else if (idx == 2)
            {
                this.Hide();
                CustomerClass cstmr = new CustomerClass(txtbxUsernameLogin.Text, txtbxPassLogin.Text);
                if (cstmr.Login())
                {
                    Customer customer = new Customer(cstmr);
                    customer.Show();
                }
                else
                {
                    MessageBox.Show("Please Enter Correct Username and Password!");
                    Application.Restart();
                }
            }
        }
 public ShowCustomerInfo(CustomerClass cus)
 {
     InitializeComponent();
     txtBxAccount.Text      = cus.AccountNumber;
     txtBxAccountType.Text  = cus.AccountType;
     txtBxAddress.Text      = cus.StreetAddress;
     txtBxBalance.Text      = cus.Balance.ToString();
     txtBxCreationDate.Text = cus.Created.ToString();
     txtBxDateOfBirth.Text  = cus.Birth.ToString();
     txtBxExpDate.Text      = cus.Expired.ToString();
     txtBxFName.Text        = cus.Fname;
     txtBxGender.Text       = cus.Gender;
     txtBxLName.Text        = cus.Lname;
     txtBxMName.Text        = cus.Mname;
     txtBxNationality.Text  = cus.Nation;
     txtBxPhone.Text        = cus.PhoneNumber;
 }
Example #6
0
        public Customer(CustomerClass c)
        {
            InitializeComponent();
            customerInfo = c;
            string username = c.UserName;

            if (username.Length > 8)
            {
                string tmp = "";
                for (int i = 0; i < 8; i++)
                {
                    tmp += username[i];
                }
                tmp     += "..";
                username = tmp;
            }
            lblUserName.Text = username;
        }
Example #7
0
        private void btnSbmt_Click(object sender, EventArgs e)
        {
            string confirme       = txtBoxCurrPass.Text;
            string newPass        = txtBoxNewPass.Text;
            string confirmNewPass = txtBoxConfirmPass.Text;

            if (newPass.Equals(confirmNewPass))
            {
                if (info.GetType() == typeof(AdminClass))
                {
                    AdminClass admin = (AdminClass)info;
                    bool       done  = admin.ChangePassword(confirme, newPass);
                    if (done)
                    {
                        MessageBox.Show("Password updated succssesfully");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Enter a correct password");
                    }
                }
                else if (info.GetType() == typeof(CustomerClass))
                {
                    CustomerClass customer = (CustomerClass)info;
                    bool          done     = customer.ChangePassword(confirme, newPass, confirmNewPass);
                    if (done)
                    {
                        MessageBox.Show("Password updated succssesfully");
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Enter a correct password");
                    }
                }
            }
            else
            {
                MessageBox.Show("New passwords don't match!");
            }
        }
 public TransferSameBank(CustomerClass customerinfo)
 {
     InitializeComponent();
     c = customerinfo;
 }