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"); } }
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(); } }
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(); } }
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(); } }
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(); } }
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); } } }
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(); } }
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"); } } }