Beispiel #1
0
        private void Checkbalance()
        {
            if (newtotal <= 0)
            {
                const string message = "This is the final payment on this account?";
                const string caption = "Account will be moved into the Archive's";
                var          result  = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    editfile();
                    string selectedfile   = Main.selectedfile;
                    var    plaintextbytes = System.Text.Encoding.UTF8.GetBytes(selectedfile);
                    var    finishbytes    = System.Convert.ToBase64String(plaintextbytes);

                    selectedfile   = Main.selectedfile;
                    plaintextbytes = System.Text.Encoding.UTF8.GetBytes(selectedfile);
                    finishbytes    = System.Convert.ToBase64String(plaintextbytes);
                    Directory.Move(@"c:\LayawayData\CustomerInfo\" + finishbytes, @"c:\LayawayData\Archive\" + finishbytes);
                }
                else
                {
                    this.Close(); ManageAccount nma = new ManageAccount(); nma.Show();
                }
            }
            else
            {
                editfile();
            }
        }
Beispiel #2
0
        private void Confirmbtn_Click(object sender, EventArgs e)
        {
            if (paymentbox.Text != "")
            {
                paymentbox.Hide();
                amountlabel.Show();
                if (Regex.IsMatch(paymentbox.Text, @"^[0-9]+$"))
                {
                    amountlabel.Text = paymentbox.Text.ToString() + ".00";
                    payment          = Decimal.Parse(paymentbox.Text.ToString() + ".00");
                    Warninglabel.Hide();
                }
                else if (Regex.IsMatch(paymentbox.Text, @"^[0-9]*(?:\.[0-9]*)?$"))
                {
                    amountlabel.Text = paymentbox.Text.ToString();
                    payment          = Decimal.Parse(paymentbox.Text.ToString());
                    Warninglabel.Hide();
                }
                else if (paymentbox.Text == "Default" || paymentbox.Text == "DEFAULT" || paymentbox.Text == "default")
                {
                    const string message2 = "Is this account in Default?" + "\n" + "You are about to move it to the Archives Folder";
                    const string caption2 = "Confirm Move to Archives";
                    var          result2  = MessageBox.Show(message2, caption2, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (result2 == DialogResult.Yes)
                    {
                        check = 1;
                        editfile();
                        string selectedfile   = Main.selectedfile;
                        var    plaintextbytes = System.Text.Encoding.UTF8.GetBytes(selectedfile);
                        var    finishbytes    = System.Convert.ToBase64String(plaintextbytes);

                        selectedfile   = Main.selectedfile;
                        plaintextbytes = System.Text.Encoding.UTF8.GetBytes(selectedfile);
                        finishbytes    = System.Convert.ToBase64String(plaintextbytes);
                        Directory.Move(@"c:\LayawayData\CustomerInfo\" + finishbytes, @"c:\LayawayData\Archive\" + finishbytes);

                        this.Close();
                    }

                    else
                    {
                        this.Close(); ManageAccount nma = new ManageAccount(); nma.Show();
                    }
                }
                else if (!Regex.IsMatch(paymentbox.Text, @"^[0-9]+$"))
                {
                    Warninglabel.Show();
                    amountlabel.Hide();
                    paymentbox.Show();
                    return;
                }
                else
                {
                    Warninglabel.Hide();
                    amountlabel.Text = paymentbox.Text.ToString();
                    payment          = Decimal.Parse(paymentbox.Text.ToString());
                }

                newbalancelabel.Show();

                newbalance           = cost - payment;
                newbalancelabel.Text = newbalance.ToString();
                label3.Show();

                const string message = "Is the Payement amount correct?";
                const string caption = "Confirm Payment Amount";
                var          result  = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    payment  = Decimal.Parse(amountlabel.Text);
                    newtotal = newbalance;
                    Checkbalance();
                    this.Close();
                }

                else
                {
                    this.Close(); ManageAccount nma = new ManageAccount(); nma.Show();
                }
            }
        }