コード例 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (CharsChecker(InFName.Text) && CharsChecker(InLName.Text) &&
         NumsChecker(InCard.Text) && NumsChecker(InPhone.Text) &&
         InEmail.Text.Length > 0 && InPass.Text.Length > 0 &&
         InCountry.SelectedIndex != -1 && InAge.SelectedIndex != -1)
     {
         if (ClientsData.Registered(InEmail.Text.ToLower()))
         {
             Client newUser = new Client(InEmail.Text, InPass.Text, InFName.Text, InLName.Text, InCountry.Text,
                                         InAge.Text, InCard.Text, InPhone.Text, VipCheck.Checked);
             ClientsData.AddUser(newUser);
             MessageBox.Show("You Have Been Registered Successfully You Can Login Now!", "Congratulations");
             this.Close();
         }
         else
         {
             MessageBox.Show("You Have Already Registered An Account!", "Error");
         }
     }
     else
     {
         MessageBox.Show("Please Correct Your Info And Try Again!", "Error");
     }
 }
コード例 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are You Sure You Want To Delete Your Account ?!", "Confirmation",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         ClientsData.DeleteAccount();
         this.Close();
     }
 }
コード例 #3
0
        private void Payment_Click(object sender, EventArgs e)
        {
            (new PaymentService()).ShowDialog();
            string Temp = (ClientsData.Current.Am).ToString() + "$";

            if (Temp != Amount.Text)
            {
                dataGridView1.Rows.Add("Payment For " + PayMent.Pay + " : ", PayMent.Value.ToString() + "$");
                ClientsLogs.AddLog("Payment For " + PayMent.Pay + " : ", PayMent.Value.ToString() + "$");
                Amount.Text = Temp;
                ClientsData.UpdateAccount();
            }
        }
コード例 #4
0
        private void Transfer_Click(object sender, EventArgs e)
        {
            (new PayMent("Transfer")).ShowDialog();
            string Temp = (ClientsData.Current.Am).ToString() + "$";

            if (Temp != Amount.Text)
            {
                dataGridView1.Rows.Add("Transfer To Another The Account : ", PayMent.Value.ToString() + "$");
                ClientsLogs.AddLog("Transfer To Another The Account : ", PayMent.Value.ToString() + "$");
                Amount.Text = Temp;
                ClientsData.UpdateAccount();
            }
        }
コード例 #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (ClientsData.Transfer(Input.Text, Transfer))
     {
         ClientsData.Current.Am -= Transfer;
         MessageBox.Show("Your Order Has Been Processed!", "Confirm");
         this.Close();
     }
     else
     {
         MessageBox.Show("Sorry We Can't Find This Email!", "Error");
         this.Close();
     }
 }
コード例 #6
0
ファイル: Main.cs プロジェクト: codezips/bank-management-c-
 private void Main_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MessageBox.Show("Are You Sure To Exit?!", "Exit",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
     {
         e.Cancel = true;
     }
     else
     {
         if (!ClientsData.CloseStreams() || !ClientsLogs.CloseStreams())
         {
             MessageBox.Show("Data File Can't Be Closed Correctly!", "Error",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
コード例 #7
0
ファイル: Main.cs プロジェクト: codezips/bank-management-c-
        public Main()
        {
            InitializeComponent();
            string Replay = ClientsData.OpenStreams();

            if (Replay != "Opened")
            {
                MessageBox.Show(Replay, "Can't Open Data File",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Dispose();
            }
            Replay = ClientsLogs.OpenStreams();
            if (Replay != "Opened")
            {
                MessageBox.Show(Replay, "Can't Open Data File",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Dispose();
            }
        }
コード例 #8
0
ファイル: Main.cs プロジェクト: codezips/bank-management-c-
 private void button2_Click(object sender, EventArgs e)
 {
     if (EmLog.Text.Length < 1 || PassLog.Text.Length < 1)
     {
         MessageBox.Show("Please Enter Your Email & Password And Try Again!", "Error");
     }
     else
     {
         if (ClientsData.LogInChecker(EmLog.Text.ToLower(), PassLog.Text))
         {
             this.Hide();
             (new MyAccount()).ShowDialog();
             this.Show();
         }
         else
         {
             MessageBox.Show("Please Correct Your Email & Password And Try Again!", "Error");
         }
     }
 }