private void ManageAccount_Load_1(object sender, EventArgs e) { string selectedfile = Main.selectedfile; if (Main.archivecheck == 1) { confirmeditbtn.Hide(); Paymentbtn.Hide(); editcustinfobtn.Hide(); } var plaintextbytes = System.Text.Encoding.UTF8.GetBytes(selectedfile); var finishbytes = System.Convert.ToBase64String(plaintextbytes); RetrieveClient client = new Trading_Post.RetrieveClient(finishbytes); fnameprintlabel.Text = RetrieveClient.fname; mnameprintlabel.Text = RetrieveClient.mname; lnameprintlabel.Text = RetrieveClient.lname; homephonelabel.Text = RetrieveClient.homephone; cellphonelabel.Text = RetrieveClient.cellphone; workphonelabel.Text = RetrieveClient.workphone; addressline1data.Text = RetrieveClient.addressline1; addressline2data.Text = RetrieveClient.addressline2; citylabel.Text = RetrieveClient.city; statelabel.Text = RetrieveClient.state; makelabel.Text = RetrieveClient.make; modellabel.Text = RetrieveClient.model; yearlabel.Text = RetrieveClient.year; colorlabel.Text = RetrieveClient.color; VINlabel.Text = RetrieveClient.vin; Vehicleloclabel.Text = RetrieveClient.location; vehiclecostdatalabel.Text = RetrieveClient.originalcost.ToString(); remainbal.Text = RetrieveClient.newtotal.ToString(); taxtot = RetrieveClient.taxtot; taxtype = RetrieveClient.taxtype; taxrate = RetrieveClient.taxrate; billdate = Convert.ToDateTime(RetrieveClient.billdate); interestratelabel.Text = RetrieveClient.interestrate.ToString(); storagefeelabel.Text = RetrieveClient.storagefee.ToString(); interestrate = RetrieveClient.interestrate; storagefee = RetrieveClient.storagefee; itemid = RetrieveClient.itemid; itemidlabel.Text = itemid; duedatelabel.Text = RetrieveClient.billdate.ToString("MM/dd/yyyy"); var plaintextbytes2 = System.Text.Encoding.UTF8.GetBytes(selectedfile); var finishbytes2 = System.Convert.ToBase64String(plaintextbytes2); Font font = new Font("Times New Roman", 11.0f, FontStyle.Bold); string activeDir2 = Main.activeDir + finishbytes2 + @"\note.txt"; paymenthistorytxtbox.Font = font; using (var reader = new StreamReader(activeDir2)) { while (!reader.EndOfStream) { var line = reader.ReadLine(); var values = line.Split('~'); if (line.Contains("Account Created")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } const string format = "{0,0} {1,13} {2,14}{3,27}{2,44}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[2]); paymenthistorytxtbox.AppendText(test + "\n"); } if (line.Contains("(note)")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } if (templist[2].Length == 6) { paymenthistorytxtbox.AppendText(templist[0] + " " + templist[1] + " " + templist[3] + "\n"); } } if (line.Contains("Account Has Been Paid in Full.")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } paymenthistorytxtbox.AppendText(templist[0] + " " + templist[1] + " " + templist[2] + "\n"); } if (line.Contains("State Tax")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[3] = templist[3] + "%"; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,27}{4,22}{5,14}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); } if (line.Contains("State&County Tax")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[3] = templist[3] + "%"; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,27}{4,13} {5,13}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); } if (line.Contains("Storage Fee")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[4] = "$" + templist[4]; templist[3] = templist[3].Insert(12, "$"); int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } const string format = "{0,0} {1,13} {2,13}{3,26}{4,46}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4]); paymenthistorytxtbox.AppendText(test + "\n"); } if (line.Contains("Dealer Fee")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,25}{4,27} {5,12}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); } if (line.Contains("Payment")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,22}{4,32} {5,12}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); } if (line.Contains("Monthly Interest")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,28}{4,16} {5,10}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); } } paymenthistorytxtbox.AppendText(Environment.NewLine); } }
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { Graphics g = e.Graphics; string selectedfile = Main.selectedfile; label12.Text = selectedfile.ToString(); var plaintextbytes = System.Text.Encoding.UTF8.GetBytes(selectedfile); var finishbytes = System.Convert.ToBase64String(plaintextbytes); RetrieveClient client = new Trading_Post.RetrieveClient(finishbytes); fnameprintlabel.Text = RetrieveClient.fname; mnameprintlabel.Text = RetrieveClient.mname; lnameprintlabel.Text = RetrieveClient.lname; homephonelabel.Text = RetrieveClient.homephone; cellphonelabel.Text = RetrieveClient.cellphone; workphonelabel.Text = RetrieveClient.workphone; addressline1data.Text = RetrieveClient.addressline1; addressline2data.Text = RetrieveClient.addressline2; citylabel.Text = RetrieveClient.city; statelabel.Text = RetrieveClient.state; makelabel.Text = RetrieveClient.make; modellabel.Text = RetrieveClient.model; yearlabel.Text = RetrieveClient.year; colorlabel.Text = RetrieveClient.color; VINlabel.Text = RetrieveClient.vin; Vehicleloclabel.Text = RetrieveClient.location; vehiclecostdatalabel.Text = RetrieveClient.originalcost.ToString(); remainbal.Text = RetrieveClient.newtotal.ToString(); taxtot = RetrieveClient.taxtot; taxtype = RetrieveClient.taxtype; taxrate = RetrieveClient.taxrate; billdate = Convert.ToDateTime(RetrieveClient.billdate); interestratelabel.Text = RetrieveClient.interestrate.ToString(); storagefeelabel.Text = RetrieveClient.storagefee.ToString(); interestrate = RetrieveClient.interestrate; storagefee = RetrieveClient.storagefee; itemid = RetrieveClient.itemid; itemidlabel.Text = itemid; duedatelabel.Text = RetrieveClient.billdate.ToString("MM/dd/yyyy"); var plaintextbytes2 = System.Text.Encoding.UTF8.GetBytes(selectedfile); var finishbytes2 = System.Convert.ToBase64String(plaintextbytes2); Font font = new Font("Times New Roman", 11.0f, FontStyle.Bold); Font arial11 = new Font("Arial", 11, System.Drawing.GraphicsUnit.Point); Font arial24 = new Font("Arial", 24, System.Drawing.GraphicsUnit.Point); Font arial18 = new Font("Arial", 18, System.Drawing.GraphicsUnit.Point); Font arial14 = new Font("Arial", 14, System.Drawing.GraphicsUnit.Point); string activeDir2 = Main.activeDir + finishbytes2 + @"\note.txt"; paymenthistorytxtbox.Font = font; String temp = System.Environment.UserName; List <string> printlist = new List <string>(); using (var reader = new StreamReader(activeDir2)) { while (!reader.EndOfStream) { var line = reader.ReadLine(); var values = line.Split('~'); if (line.Contains("Account Created")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } const string format = "{0,0} {1,13} {2,14}{3,27}{2,44}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[2]); paymenthistorytxtbox.AppendText(test + "\n"); printlist.Add(test); } if (line.Contains("(note)")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } if (templist[2].Length == 6) { paymenthistorytxtbox.AppendText(templist[0] + " " + templist[1] + " " + templist[3] + "\n"); } } if (line.Contains("Account Has Been Paid in Full.")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } paymenthistorytxtbox.AppendText(templist[0] + " " + templist[1] + " " + templist[2] + "\n"); } if (line.Contains("State Tax")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[3] = templist[3] + "%"; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,27}{4,22}{5,14}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); printlist.Add(test); } if (line.Contains("State&County Tax")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[3] = templist[3] + "%"; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,27}{4,13} {5,13}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); printlist.Add(test); } if (line.Contains("Storage Fee")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[4] = "$" + templist[4]; templist[3] = templist[3].Insert(12, "$"); int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } const string format = "{0,0} {1,13} {2,13}{3,26}{4,46}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4]); paymenthistorytxtbox.AppendText(test + "\n"); printlist.Add(test); } if (line.Contains("Dealer Fee")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,25}{4,27} {5,12}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); printlist.Add(test); } if (line.Contains("Payment")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,22}{4,32} {5,12}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); printlist.Add(test); } if (line.Contains("Monthly Interest")) { String headache = values[0].ToString(); Char delimiter = ','; String[] substrings = headache.Split(delimiter); List <string> templist = new List <string>(); foreach (var substring in substrings) { templist.Add(substring); } templist[2] = "$" + templist[2]; templist[4] = "$" + templist[4]; templist[5] = "$" + templist[5]; int count2 = 11 - templist[2].Length; if (count2 > 0) { templist[2] += new string('_', count2); } int count4 = 11 - templist[4].Length; if (count4 > 0) { templist[4] += new string('_', count4); } int count5 = 11 - templist[5].Length; if (count5 > 0) { templist[5] = new string('_', count5) + templist[5]; } const string format = "{0,0} {1,13} {2,14}{3,28}{4,16} {5,10}"; string test = string.Format(format, templist[0], templist[1], templist[2], templist[3], templist[4], templist[5]); paymenthistorytxtbox.AppendText(test + "\n"); printlist.Add(test); } } } DateTime date = DateTime.Now.Date; int x = 100, y = 210; String Titletxt = System.Environment.UserName; String datetxt = System.Environment.UserName; String divideline = System.Environment.UserName; String datatypestop = System.Environment.UserName; String datatypesbottom = System.Environment.UserName; Titletxt = "Account History"; datetxt = date.ToString("MMMM dd, yyyy"); divideline = "\n" + "_________________________________________________" + "\n"; datatypestop = "Change +/- New" + "\n"; datatypesbottom = "Date Time Balance Made Balance Balance" + "\n"; g.DrawString(Titletxt, arial24, Brushes.Black, 300, 100); g.DrawString(datetxt, arial18, Brushes.Black, 320, 130); g.DrawString(divideline, arial18, Brushes.Black, 100, 105); g.DrawString(divideline, arial18, Brushes.Black, 100, 151); g.DrawString(datatypestop, arial11, Brushes.Black, 450, 170); g.DrawString(datatypesbottom, arial11, Brushes.Black, 100, 190); foreach (var astring in printlist) { temp = astring; g.DrawString(temp, arial11, Brushes.Black, x, y); y += 25; } }