Ejemplo n.º 1
0
        private void Cancelbtn_Click(object sender, EventArgs e)
        {
            phonewarninglabel.Hide();
            CustomerFirstNameTextbox.BackColor   = Color.White;
            CustomerMiddleNameTextbox.BackColor  = Color.White;
            CustomerLastNameTextbox.BackColor    = Color.White;
            HomePhoneTextbox1.BackColor          = Color.White;
            CellPhoneTextbox1.BackColor          = Color.White;
            AddressLine1TextBox.BackColor        = Color.White;
            AddressLine2TextBox.BackColor        = Color.White;
            VehicleMakeTextbox.BackColor         = Color.White;
            VehicleModelTextbox.BackColor        = Color.White;
            VehicleYearTextbox.BackColor         = Color.White;
            VehicleColorTextbox.BackColor        = Color.White;
            VehicleVINTextbox.BackColor          = Color.White;
            VehicleVINTextbox.BackColor          = Color.White;
            VehicleCostTextbox.BackColor         = Color.White;
            StateProvinceRegionTextBox.BackColor = Color.White;
            VehicleLocationTextbox.BackColor     = Color.White;
            CityTextBox.BackColor = Color.White;
            warninglabel.Hide();
            Main newmain = new Trading_Post.Main();

            newmain.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private void cancelchangesbtn_Click(object sender, EventArgs e)
        {
            if (marker == 1)
            {
                backagain();
                marker = 0;
            }
            else
            {
                Main openmain = new Trading_Post.Main();

                openmain.Show();
                this.Close();
            }
        }
Ejemplo n.º 3
0
        private void confirmeditbtn_Click(object sender, EventArgs e)
        {
            if (fnameprinttxtbox.Text != "" && mnameprinttxtbox.Text != "" && lnameprinttxtbox.Text != "" && statetxtbox.Text != "" && citytxtbox.Text != "" &&
                maketxtbox.Text != "" && modeltxtbox.Text != "" && yeartxtbox.Text != "" && colortxtbox.Text != "" && colortxtbox.Text != "" && Vehicleloctxtbox.Text != "" && vehiclecostdatalabel.Text != "")
            {
                if (homephonetxtbox.Text != "" || textBox2.Text != "")
                {
                    if (addressline1datatxtbox.Text != "" || addressline2datatxtbox.Text != "")
                    {
                        custcheck     = 1;
                        fname         = fnameprinttxtbox.Text;
                        mname         = mnameprinttxtbox.Text;
                        lname         = lnameprinttxtbox.Text;
                        homephone     = homephonetxtbox.Text;
                        cellphone     = textBox2.Text;
                        workphone     = textBox3.Text;
                        addressline1  = addressline1datatxtbox.Text;
                        addressline2  = addressline2datatxtbox.Text;
                        city          = citytxtbox.Text;
                        state         = statetxtbox.Text;
                        make          = maketxtbox.Text;
                        model         = modeltxtbox.Text;
                        year          = yeartxtbox.Text;
                        color         = colortxtbox.Text;
                        vin           = VINtxtbox.Text;
                        location      = Vehicleloctxtbox.Text;
                        cost          = Decimal.Parse(vehiclecostdatalabel.Text);
                        remainbalance = Decimal.Parse(remainbal.Text);

                        CustomerConfirm custconf = new Trading_Post.CustomerConfirm();
                        custconf.Show();
                        const string message = "Is the customer information correct?";
                        const string caption = "Confirm Customer Information";
                        label11.Text = cost + "  " + remainbalance;
                        var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                        if (result == DialogResult.Yes)
                        {
                            custcheck = 0;
                            editfile();
                            Main openmain = new Trading_Post.Main();
                            openmain.Show();
                            custconf.Close();
                            this.Close();
                        }
                        else
                        {
                            custconf.Close();
                            backagain();
                        }
                    }
                }
            }
            else
            if (fnameprinttxtbox.Text == "")
            {
                fnameprinttxtbox.BackColor = Color.Yellow;
                warninglabel.Show();
            }
            if (mnameprinttxtbox.Text == "")
            {
                mnameprinttxtbox.BackColor = Color.Yellow;
            }
            if (lnameprinttxtbox.Text == "")
            {
                lnameprinttxtbox.BackColor = Color.Yellow;
            }

            if (homephonetxtbox.Text == "")
            {
                homephonetxtbox.BackColor = Color.Yellow;
            }

            if (textBox2.Text == "")
            {
                if (textBox3.Text == "")
                {
                    textBox3.BackColor = Color.Yellow;
                    textBox2.BackColor = Color.Yellow;
                }
            }
            if (addressline1datatxtbox.Text == "")
            {
                addressline1datatxtbox.BackColor = Color.Yellow;
            }
            if (addressline2datatxtbox.Text == "")
            {
                addressline2datatxtbox.BackColor = Color.Yellow;
            }
            if (citytxtbox.Text == "")
            {
                citytxtbox.BackColor = Color.Yellow;
            }
            if (statetxtbox.Text == "")
            {
                statetxtbox.BackColor = Color.Yellow;
            }
            if (maketxtbox.Text == "")
            {
                maketxtbox.BackColor = Color.Yellow;
            }
            if (modeltxtbox.Text == "")
            {
                modeltxtbox.BackColor = Color.Yellow;
            }
            if (yeartxtbox.Text == "")
            {
                yeartxtbox.BackColor = Color.Yellow;
            }
            if (colortxtbox.Text == "")
            {
                colortxtbox.BackColor = Color.Yellow;
            }
            if (VINtxtbox.Text == "")
            {
                VINtxtbox.BackColor = Color.Yellow;
            }
            if (Vehicleloctxtbox.Text == "")
            {
                Vehicleloctxtbox.BackColor = Color.Yellow;
            }
        }
Ejemplo n.º 4
0
        private void editfile()
        {
            string selectedfile   = Main.selectedfile;
            var    plaintextbytes = System.Text.Encoding.UTF8.GetBytes(selectedfile);
            var    finishbytes    = System.Convert.ToBase64String(plaintextbytes);

            File.Copy(@"c:\LayawayData\CustomerInfo\" + finishbytes + @"\note.txt", @"c:\LayawayData\CustomerInfo\note.txt");
            string activeDir = @"c:\LayawayData\CustomerInfo\" + finishbytes + @"\Data.txt";

            File.Delete(activeDir);
            Directory.Delete(@"c:\LayawayData\CustomerInfo\" + finishbytes, true);
            if (!File.Exists(activeDir))
            {
                string activeDir1 = @"c:\LayawayData\CustomerInfo\";

                string custDir         = fname + "," + mname + "," + lname;
                var    plaintextbytes1 = System.Text.Encoding.UTF8.GetBytes(custDir);
                var    finishbytes1    = System.Convert.ToBase64String(plaintextbytes1);
                //Create a new subfolder under the current active folder
                string newPath = System.IO.Path.Combine(activeDir1, finishbytes1);

                // Create the subfolder
                System.IO.Directory.CreateDirectory(newPath);
                // createsavefile();
                string finalpath = System.IO.Path.Combine(activeDir1, finishbytes1);
                string path      = finalpath + @"\" + "Data.txt";

                if (!File.Exists(finalpath))
                {
                    using (StreamWriter sw = File.CreateText(path))
                    {
                        DateTime thisDay  = DateTime.Today;
                        DateTime thistime = DateTime.Now;
                        if (billdate <= thisDay)
                        {
                            billdate = billdate.AddMonths(1);
                        }

                        var plaintextbytest1 = System.Text.Encoding.UTF8.GetBytes(fname + "," + mname + "," + lname + "," + homephone + "," + cellphone +
                                                                                  "," + workphone + "," + addressline1 + "," + addressline2 + "," + city + "," + state + "," + make + "," + model + "," +
                                                                                  year + "," + color + "," + vin + "," + location + "," + cost + "," + originalcost + "," + taxtot + "," + taxtype + "," + taxrate + "," + newtotal + "," + billdate + "," + interestrate + "," + storagefee + "," + itemid);
                        var finishbytes2 = System.Convert.ToBase64String(plaintextbytest1);
                        sw.WriteLine(finishbytes2);
                        string path2 = finalpath + @"\" + "note.txt";
                        File.Copy(@"c:\LayawayData\CustomerInfo\note.txt", finalpath + @"\note.txt");
                        File.Delete(@"c:\LayawayData\CustomerInfo\note.txt");
                        using (StreamWriter aw = File.AppendText(path2))
                        {
                            if (newtotal == 0)
                            {
                                aw.WriteLine(DateTime.Today.ToString("MM-dd-yyyy") + "," + DateTime.Now.ToString("HH:mm:ss") + "," + "Account Has Been Paid in Full." + "~");
                            }
                            if (check == 1)
                            {
                                aw.WriteLine(DateTime.Today.ToString("MM-dd-yyyy") + "," + DateTime.Now.ToString("HH:mm:ss") + "," + "(note)" + "," + "Account is delinquent and moved to archives." + "~");
                            }
                            else
                            {
                                aw.WriteLine(DateTime.Today.ToString("MM-dd-yyyy") + "," + DateTime.Now.ToString("HH:mm:ss") + "," + cost + "," + "Payment" + "," + "-" + payment + "," + newtotal + "," + "~");
                            }
                        }
                    }
                }

                printPreviewDialog1.ShowDialog();
            }
            Main openmain = new Trading_Post.Main();

            openmain.Show();
        }