private void ChangeUserPassUIHeader() { Console.Title = "BlueMoon - Change Username and Password"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(37, 13); Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION=========="); Console.SetCursorPosition(37, 15); Console.WriteLine("Change Username And password"); Console.SetCursorPosition(39, 17); Console.WriteLine(" ====== User Login Details ====== "); Station.writer(39, 19, "The current username is : " + Station.username); Station.writerClearedRow(39, 21, "press (C) to change User Login Details"); Station.writerClearedRow(39, 23, "press (R) to return to Login Settings Menu"); }
private void SettingsMenuUI() { Console.Title = "BlueMoon - Settings"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(left, top); Console.WriteLine("PERSONAL ASSISTANT APPLICATION"); top += 2; Console.SetCursorPosition(37, top); Console.WriteLine("=====Settings page====="); top += 3; topC = top; Console.SetCursorPosition(39, top); textC = "(C). Change Login and Display"; Console.WriteLine(textC); top += 2; topM = top; Console.SetCursorPosition(39, top); textM = "(V). Import/Export vcf"; Console.WriteLine(textM); top += 2; topR = top; Console.SetCursorPosition(39, top); textR = "(R). Return to Main Menu "; Console.WriteLine(textR); }
private void PasswordHideMenuUI() { Console.Title = "BlueMoon - Settings - Password hide type"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(left, top); Console.WriteLine("PERSONAL ASSISTANT APPLICATION"); top += 2; Console.SetCursorPosition(37, top); Console.WriteLine("=====Password hide type====="); top += 3; topA = top; Console.SetCursorPosition(39, top); textA = "(A). Use Asterix to Hide"; Console.WriteLine(textA); top += 2; topI = top; Console.SetCursorPosition(39, top); textI = "(I). Make Password Invisible"; Console.WriteLine(textI); top += 2; topR = top; Console.SetCursorPosition(39, top); textR = "(R). Return to Main Menu "; Console.WriteLine(textR); }
private void PersonalAssistantUI() { Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(left, top); Console.WriteLine("PERSONAL ASSISTANT APPLICATION"); top++; Console.SetCursorPosition(37, top); Console.WriteLine("=============================="); top += 3; topC = top; Console.SetCursorPosition(39, top); textC = "(C). Contacts"; Console.WriteLine(textC); top += 2; topM = top; Console.SetCursorPosition(39, top); textM = "(M). Meetings and appointment"; Console.WriteLine(textM); top += 2; topR = top; Console.SetCursorPosition(39, top); textR = "(R). Return to Main Menu "; Console.WriteLine(textR); }
public static void BlueMoonHeader() { Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); }
private void MeetingAppointmentUI() { Console.Title = "BlueMoon - Meeting Appointments"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(left, top); Console.WriteLine("PERSONAL ASSISTANT APPLICATION"); top++; Console.SetCursorPosition(37, top); Console.WriteLine("Appointments Details Page."); top += 3; topA = top; Console.SetCursorPosition(39, top); textA = "(A). Add Appointments"; Console.WriteLine(textA); top += 2; topE = top; Console.SetCursorPosition(39, top); textE = "(E). Edit Appointments"; Console.WriteLine(textE); top += 2; topV = top; Console.SetCursorPosition(39, top); textV = "(V). View Appointments "; Console.WriteLine(textV); top += 2; topS = top; Console.SetCursorPosition(39, top); textS = "(S). Search Appointments "; Console.WriteLine(textS); top += 2; topD = top; Console.SetCursorPosition(39, top); textD = "(D). Delete Appointments "; Console.WriteLine(textD); top += 2; topR = top; Console.SetCursorPosition(39, top); textR = "(R). Return to Main Page "; Console.WriteLine(textR); }
private void AddAppointmentHeader() { Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(37, 13); Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION=========="); Console.SetCursorPosition(37, 15); Console.WriteLine("Press any Key to View Contacts...."); Console.ReadKey(true); Console.SetCursorPosition(39, 17); Console.WriteLine(" ======Contact Details====== "); }
static void Main(string[] args) { Console.Title = "BlueMoon"; Console.SetWindowSize(120, 40); Console.SetBufferSize(120, 9001); /* */ AsciiClass ac = new AsciiClass(); ac.BlueMoon(7); LoadingPage.LoadPage(); /* * Encryption e = new Encryption(); * e.Start(); */ Console.ReadKey(); }
private void SettingsMenuUI() { Console.Title = "BlueMoon - Settings - Login and Display"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(left, top); Console.WriteLine("PERSONAL ASSISTANT APPLICATION"); top += 2; Console.SetCursorPosition(37, top); Console.WriteLine("=====Login Settings page====="); top += 3; topC = top; Console.SetCursorPosition(39, top); textC = "(C). Change Username and Password"; Console.WriteLine(textC); top += 2; topP = top; Console.SetCursorPosition(39, top); textP = "(P). Choose password hide Type"; Console.WriteLine(textP); top += 2; topT = top; Console.SetCursorPosition(39, top); textT = "(T). Change Theme color"; Console.WriteLine(textT); top += 2; topR = top; Console.SetCursorPosition(39, top); textR = "(R). Return to Main Menu "; Console.WriteLine(textR); }
private void DisplayMainMenu() { Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(37, 14); Console.WriteLine("press the letter in the bracket to select option."); Console.SetCursorPosition(37, 15); Console.WriteLine("Example : press 'p' for personal assistant."); Console.SetCursorPosition(39, 18); string textP = "(P). Personal Assistant Application"; Console.WriteLine(textP); Console.SetCursorPosition(39, 20); string textS = "(S). Settings"; Console.WriteLine(textS); Console.SetCursorPosition(39, 22); string textL = "(L). Log out"; Console.WriteLine(textL); Console.SetCursorPosition(39, 24); Console.WriteLine("(X). Exit"); Station.StartTimeThread(); Console.CursorVisible = false; ConsoleKeyInfo key; key = Console.ReadKey(true); if (key.Key == ConsoleKey.P) { Station.BeepClick(); Station.StopTimeThread(); Station.Highlight(39, 18, textP); PersonalAssistant pa = new PersonalAssistant(); pa.Start(); } else if (key.Key == ConsoleKey.S) { Station.BeepClick(); Station.StopTimeThread(); Station.Highlight(39, 20, textS); SettingsMenu sm = new SettingsMenu(); sm.Start(); } else if (key.Key == ConsoleKey.L) { Station.BeepClick(); Station.StopTimeThread(); Station.Highlight(39, 22, textL); Login l = new Login(); l.DisplayPassword(); } else if (key.Key == ConsoleKey.X) { Station.StopTimeThread(); Environment.Exit(0); Application.Exit(); } else { Station.StopTimeThread(); Station.BeepError(); Console.SetCursorPosition(39, 26); Console.WriteLine("Invalid Key."); Thread.Sleep(200); Console.Clear(); DisplayMainMenu(); } }
public void Start() { Console.Title = "BlueMoon - View Contacts"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(37, 13); Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION=========="); Console.SetCursorPosition(37, 15); Console.WriteLine("Press any Key to View Contacts...."); Console.ReadKey(true); Console.SetCursorPosition(39, 17); Console.WriteLine(" ======Contact Details======"); string curPath = Directory.GetCurrentDirectory(); string path = curPath + "\\Contacts.ebase"; string[] EbRows = File.ReadAllLines(path); string[] fieldName = { "Name", "Phone Number", "Email", "State", "City", "Address" }; int topDisplay = 20; int leftDisplay = 0; int countingLeft = 1; int displaySet = 0; Console.MoveBufferArea(0, 38, 40, 2, 1, 2); // Go over each row int initial = EbRows.Length - 1; for (int q = initial; q >= 0; q--) { // split rows into column string[] EbCol = EbRows[q].Split('~'); //determine left or right based on even or odd countingLeft++; // set left to right or left if (countingLeft % 2 == 0) { leftDisplay = 5; } else { leftDisplay = 62; topDisplay = displaySet; } // set display set to top display to determine height displaySet = topDisplay; for (int i = 0; i < EbCol.Length; i++) { Console.SetCursorPosition(leftDisplay, topDisplay); Console.WriteLine("{0,-12} : {1}", fieldName[i], EbCol[i]); topDisplay++; } topDisplay += 2; } // draw main border int count = displaySet; Station.BorderThread(2, 18, 115, count, 10); Console.CursorVisible = false; // draw book border int leftB = 60; int topB = 18; for (int i = 0; i < count; i++) { Console.SetCursorPosition(leftB, topB); Console.Write("|"); topB++; } // readkey to exit Console.SetCursorPosition(37, 15); Console.WriteLine("Press any Key to Return to previous Menu...."); Console.ReadKey(true); // Goto Contact details Menu ContactDetails cd = new ContactDetails(); cd.Start(); }
public void Start() { Console.Title = "BlueMoon - Delete Contacts"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(37, 13); Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION=========="); Console.SetCursorPosition(37, 15); Console.WriteLine("Press BackSpace to go to previous menu or any key to start delete...."); Console.CursorVisible = false; ConsoleKeyInfo key1; key1 = Console.ReadKey(true); if (key1.Key == ConsoleKey.Backspace) { ContactDetails cd2 = new ContactDetails(); cd2.Start(); return; } Console.SetCursorPosition(37, 15); Console.WriteLine(" "); Console.SetCursorPosition(37, 15); Console.WriteLine("Delete contact Menu"); Console.SetCursorPosition(39, 17); Console.WriteLine(" ======Contact Details======"); bool writeRow; string curPath = Directory.GetCurrentDirectory(); string path = curPath + "\\Contacts.ebase"; string tempPath = curPath + "\\temp.txt"; string[] EbRows = File.ReadAllLines(path); Console.SetCursorPosition(39, 19); Console.WriteLine("enter the name of the contact to delete"); Console.SetCursorPosition(39, 20); // Start add string name = Station.MeteredInput(12, 39, 20); name = name.ToLower(); bool editer = true; bool found = false; // end add string[] fieldName = { "Name", "Phone Number", "Email", "State", "City", "Address" }; List <string> newData = new List <string>(); while (editer) { newData = new List <string>(); //add found = false; for (int i = 0; i < EbRows.Length; i++) { string[] EbCol = EbRows[i].Split('~'); writeRow = true; for (int j = 0; j < EbCol.Length; j++) { //Start add if (editer) { string EbColtemp = EbCol[0].ToLower(); if (name == EbColtemp || EbColtemp.Contains(name)) { found = true; // End add make sure to complete } Console.SetCursorPosition(39, 22); Console.WriteLine("=======Contact Found======="); EditContactsClear(); Console.SetCursorPosition(39, 24); Console.WriteLine("{0,-12} : {1}", fieldName[0], EbCol[0]); Console.SetCursorPosition(39, 25); Console.WriteLine("{0,-12} : {1}", fieldName[1], EbCol[1]); Console.SetCursorPosition(39, 26); Console.WriteLine("{0,-12} : {1}", fieldName[2], EbCol[2]); Console.SetCursorPosition(39, 27); Console.WriteLine("{0,-12} : {1}", fieldName[3], EbCol[3]); Console.SetCursorPosition(39, 28); Console.WriteLine("{0,-12} : {1}", fieldName[4], EbCol[4]); Console.SetCursorPosition(39, 29); Console.WriteLine("{0,-12} : {1}", fieldName[5], EbCol[5]); Console.SetCursorPosition(15, 31); Console.WriteLine("(Y) Delete Contact -- (N) Next Search -- (AnyKey) Start Again -- (BackSpace) to Return to Menu"); Console.CursorVisible = false; ConsoleKeyInfo key; key = Console.ReadKey(true); if (key.Key == ConsoleKey.Y) { Station.clearRow(15, 31, 105); Console.SetCursorPosition(30, 31); Console.WriteLine("Are you sure you want to delete contact !! (Y). Yes or anykey to Cancel ?"); Console.CursorVisible = false; ConsoleKeyInfo key2; key2 = Console.ReadKey(true); if (key2.Key == ConsoleKey.Y) { writeRow = false; editer = false; Station.clearRow(30, 31, 90); } else if (key2.Key != ConsoleKey.Y) { MainMenu ddc = new MainMenu(); ddc.Start(); } } else if (key.Key == ConsoleKey.N) { break; } else if (key.Key == ConsoleKey.Backspace) { ContactDetails ccdc = new ContactDetails(); ccdc.Start(); } else { DeleteContacts ddc = new DeleteContacts(); ddc.Start(); } } } } if (writeRow) { newData.Add(EbRows[i]); } } if (!found) { Console.SetCursorPosition(48, 27); Console.Write("Contact Not Found"); Thread.Sleep(500); Start(); } } string[] newDataarr = newData.ToArray(); File.WriteAllLines(tempPath, newDataarr); File.Delete("Contacts.ebase"); Station.Blink("Deleting Contact Information.............", 5000, 39, 33); File.Move("temp.txt", "Contacts.ebase"); ContactDetails cd = new ContactDetails(); cd.Start(); }
public void Start() { Console.Title = "BlueMoon - View Appointments"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(37, 13); Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION=========="); Console.SetCursorPosition(37, 15); Console.WriteLine("Press any Key to View Appointments...."); Console.ReadKey(true); Console.SetCursorPosition(39, 17); Console.WriteLine(" ======Appointment Details======"); string curPath = Directory.GetCurrentDirectory(); string path = curPath + "\\Schedule.ebase"; string[] EbRows = File.ReadAllLines(path); string[] fieldName = { "Name of appointment", "Year", "Month", "Day", "Hour", "Minute", "Location" }; int topDisplay = 20; int leftDisplay = 0; int countingLeft = 1; //int countingtop = 0; int displaySet = 0; // Move logged in to upper left Console.MoveBufferArea(0, 38, 40, 2, 1, 2); Station.StopTimeThread(); int initial = EbRows.Length - 1; for (int q = initial; q >= 0; q--) { string[] EbCol = EbRows[q].Split('~'); countingLeft++; if (countingLeft % 2 == 0) { leftDisplay = 5; } else { leftDisplay = 62; topDisplay = displaySet; } displaySet = topDisplay; for (int i = 0; i < EbCol.Length; i++) { Console.SetCursorPosition(leftDisplay, topDisplay); Console.WriteLine("{0,-20} : {1}", fieldName[i], EbCol[i]); topDisplay++; } topDisplay += 2; } int count = displaySet; Station.BorderThread(2, 18, 115, count, 10); Console.CursorVisible = false; int leftB = 60; int topB = 18; for (int i = 0; i < count; i++) { Console.SetCursorPosition(leftB, topB); Console.Write("|"); topB++; } Console.SetCursorPosition(37, 15); Console.WriteLine("Press any Key to Return to previous Menu...."); Console.ReadKey(true); MeetingAppointment ma = new MeetingAppointment(); ma.Start(); }
public void Start() { Console.Title = "BlueMoon - Settings - Change Theme Color"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); int left = 37; int top = 14; Console.SetCursorPosition(left, top); Console.WriteLine("PERSONAL ASSISTANT APPLICATION"); top++; Console.SetCursorPosition(37, top); Console.WriteLine("Press the letter in brackets to select Theme Color"); top += 3; int topCyan = top; Console.SetCursorPosition(39, top); String textCyan = "(C). Theme Cyan (default)"; Console.WriteLine(textCyan); top += 2; int topGreen = top; Console.SetCursorPosition(39, top); string textGreen = "(G). Theme Green"; Console.WriteLine(textGreen); top += 2; int topBlue = top; Console.SetCursorPosition(39, top); string textBlue = "(B). Theme Blue "; Console.WriteLine(textBlue); top += 2; int topMagenta = top; Console.SetCursorPosition(39, top); string textMagenta = "(M). Theme Magenta "; Console.WriteLine(textMagenta); top += 2; int topGray = top; Console.SetCursorPosition(39, top); string textGray = "(A). Theme Gray "; Console.WriteLine(textGray); top += 2; int topYellow = top; Console.SetCursorPosition(39, top); string textYellow = "(Y). Theme Yellow"; Console.WriteLine(textYellow); top += 2; int topRed = top; Console.SetCursorPosition(39, top); string textRed = "(R). Theme Red"; Console.WriteLine(textRed); top += 2; int topX = top; Console.SetCursorPosition(39, top); string textX = "(X). Exit this page "; Console.WriteLine(textX); Station.StartTimeThread(); Console.CursorVisible = false; ConsoleKeyInfo key; key = Console.ReadKey(true); if (key.Key == ConsoleKey.C) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topCyan, textCyan); // Station.writerClearedRow(39, 34, "Theme Cyan Selected."); Station.writerClearedRow(39, 35, "Press any key to save and return to settings"); SaveToSettingsFile("Cyan"); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else if (key.Key == ConsoleKey.G) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topGreen, textGreen); Station.writerClearedRow(39, 34, "Theme Green Selected."); Station.writerClearedRow(39, 35, "Press any key to save and return to settings"); SaveToSettingsFile("Green"); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else if (key.Key == ConsoleKey.B) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topBlue, textBlue); Station.writerClearedRow(39, 34, "Theme Blue Selected."); Station.writerClearedRow(39, 35, "Press any key to save and return to settings"); SaveToSettingsFile("Blue"); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else if (key.Key == ConsoleKey.M) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topMagenta, textMagenta); Station.writerClearedRow(39, 34, "Theme Magenta Selected."); Station.writerClearedRow(39, 35, "Press any key to save and return to settings"); SaveToSettingsFile("Magenta"); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else if (key.Key == ConsoleKey.A) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topGray, textGray); Station.writerClearedRow(39, 34, "Theme Gray Selected."); Station.writerClearedRow(39, 35, "Press any key to save and return to settings"); SaveToSettingsFile("Gray"); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else if (key.Key == ConsoleKey.Y) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topYellow, textYellow); Station.writerClearedRow(39, 34, "Theme Yellow Selected."); Station.writerClearedRow(39, 35, "Press any key to save and return to settings"); SaveToSettingsFile("Yellow"); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else if (key.Key == ConsoleKey.R) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topRed, textRed); Station.writerClearedRow(39, 34, "Theme Red Selected."); Station.writerClearedRow(39, 35, "Press any key to save and return to settings"); SaveToSettingsFile("Red"); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else if (key.Key == ConsoleKey.X) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topX, textX); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else { Station.StopTimeThread(); top += 4; Station.BeepError(); Console.SetCursorPosition(39, top); Console.WriteLine("Invalid Key."); Thread.Sleep(200); Console.Clear(); Start(); } }
public void Start() { Console.Title = "BlueMoon - Contacts Application"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); int left = 37; int top = 14; Console.SetCursorPosition(left, top); Console.WriteLine("PERSONAL ASSISTANT APPLICATION"); top++; Console.SetCursorPosition(37, top); Console.WriteLine("Contact Details Page."); top += 3; int topA = top; Console.SetCursorPosition(39, top); String textA = "(A). Add contacts"; Console.WriteLine(textA); top += 2; int topE = top; Console.SetCursorPosition(39, top); string textE = "(E). Edit Contacts"; Console.WriteLine(textE); top += 2; int topV = top; Console.SetCursorPosition(39, top); string textV = "(V). View Contacts "; Console.WriteLine(textV); top += 2; int topS = top; Console.SetCursorPosition(39, top); string textS = "(S). Search Contacts "; Console.WriteLine(textS); top += 2; int topD = top; Console.SetCursorPosition(39, top); string textD = "(D). Delete Contacts "; Console.WriteLine(textD); top += 2; int topR = top; Console.SetCursorPosition(39, top); string textR = "(R). Return to Main Page "; Console.WriteLine(textR); Station.StartTimeThread(); Console.CursorVisible = false; ConsoleKeyInfo key; key = Console.ReadKey(true); if (key.Key == ConsoleKey.A) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topA, textA); AddContacts ad = new AddContacts(); ad.Start(); } else if (key.Key == ConsoleKey.E) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topE, textE); EditContacts ec = new EditContacts(); ec.Start(); } else if (key.Key == ConsoleKey.V) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topV, textV); ViewContacts vc = new ViewContacts(); vc.Start(); } else if (key.Key == ConsoleKey.S) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topS, textS); SearchContacts sc = new SearchContacts(); sc.Start(); } else if (key.Key == ConsoleKey.D) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topD, textD); DeleteContacts dc = new DeleteContacts(); dc.Start(); } else if (key.Key == ConsoleKey.R) { Station.StopTimeThread(); Station.BeepClick(); Station.Highlight(39, topR, textR); PersonalAssistant pa = new PersonalAssistant(); pa.Start(); } else { Station.StopTimeThread(); top += 4; Station.BeepError(); Console.SetCursorPosition(39, top); Console.WriteLine("Invalid Key."); Thread.Sleep(200); Console.Clear(); Start(); } }
public void Start() { Console.Title = "BlueMoon - Search Appointments"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(37, 13); Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION=========="); Console.SetCursorPosition(37, 15); Console.WriteLine("Press BackSpace to go to previous menu or any key to start Search...."); Console.CursorVisible = false; ConsoleKeyInfo key1; key1 = Console.ReadKey(true); if (key1.Key == ConsoleKey.Backspace) { MeetingAppointment ma1 = new MeetingAppointment(); ma1.Start(); return; } Console.SetCursorPosition(37, 15); Console.WriteLine(" "); Console.SetCursorPosition(37, 15); Console.WriteLine("Search Appointments Menu"); string curPath = Directory.GetCurrentDirectory(); string path = curPath + "\\Schedule.ebase"; string[] EbRows = File.ReadAllLines(path); Console.SetCursorPosition(39, 19); Console.WriteLine("enter the name of the Appointments to search"); Console.SetCursorPosition(39, 20); // Start add string name = Station.MeteredInput(12, 39, 20); name = name.ToLower(); bool editer = true; bool found = false; // end add string[] fieldName = { "Name", "Year", "Month", "Day", "Hour", "Minute", "Location" }; while (editer) { //add found = false; for (int i = 0; i < EbRows.Length; i++) { string[] EbCol = EbRows[i].Split('~'); for (int j = 0; j < EbCol.Length; j++) { //Start add if (editer) { string EbColtemp = EbCol[0].ToLower(); if (name == EbColtemp || EbColtemp.Contains(name)) { found = true; // End add make sure to complete } Console.SetCursorPosition(39, 22); Console.WriteLine("=======Appointments Found======="); EditContactsClear(); Console.SetCursorPosition(39, 24); Console.WriteLine("{0,-12} : {1}", fieldName[0], EbCol[0]); Console.SetCursorPosition(39, 25); Console.WriteLine("{0,-12} : {1}", fieldName[1], EbCol[1]); Console.SetCursorPosition(39, 26); Console.WriteLine("{0,-12} : {1}", fieldName[2], EbCol[2]); Console.SetCursorPosition(39, 27); Console.WriteLine("{0,-12} : {1}", fieldName[3], EbCol[3]); Console.SetCursorPosition(39, 28); Console.WriteLine("{0,-12} : {1}", fieldName[4], EbCol[4]); Console.SetCursorPosition(39, 29); Console.WriteLine("{0,-12} : {1}", fieldName[5], EbCol[5]); Console.SetCursorPosition(39, 30); Console.WriteLine("{0,-12} : {1}", fieldName[6], EbCol[6]); Console.SetCursorPosition(25, 32); Console.WriteLine("(Backspace) to return -- (N) to Next Search -- (any key) to start again"); Console.CursorVisible = false; ConsoleKeyInfo key; key = Console.ReadKey(true); if (key.Key == ConsoleKey.Backspace) { Station.clearRow(25, 32, 90); editer = false; } else if (key.Key == ConsoleKey.N) { break; } else { SearchAppointments sa2 = new SearchAppointments(); sa2.Start(); } } } } } if (!found) { Console.SetCursorPosition(48, 27); Console.Write("Contact Not Found"); Thread.Sleep(500); Start(); } } MeetingAppointment ma2 = new MeetingAppointment(); ma2.Start(); }
public void Start() { Console.Title = "BlueMoon - Edit Contacts"; Console.Clear(); AsciiClass ac = new AsciiClass(); ac.BlueMoon(3); Console.SetCursorPosition(37, 13); Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION=========="); Console.SetCursorPosition(37, 15); Console.WriteLine("Press any Key to Edit Contacts...."); Console.ReadKey(true); Console.SetCursorPosition(39, 17); Console.WriteLine(" ====== Contact Details ====== "); string curPath = Directory.GetCurrentDirectory(); string path = curPath + "\\Contacts.ebase"; string tempPath = curPath + "\\temp.txt"; string[] EbRows = File.ReadAllLines(path); Console.SetCursorPosition(39, 19); Console.WriteLine("enter the name of the contact to Edit"); Console.SetCursorPosition(39, 20); string name = Station.MeteredInput(12, 39, 20); name = name.ToLower(); bool editer = true; bool found = false; string[] fieldName = { "Name", "Phone Number", "Email", "State", "City", "Address" }; List <string> newData = new List <string>(); while (editer) { found = false; newData = new List <string>(); for (int i = 0; i < EbRows.Length; i++) { string[] EbCol = EbRows[i].Split('~'); #region editer loop for (int j = 0; j < EbCol.Length; j++) { if (editer) { string EbColtemp = EbCol[0].ToLower(); if (name == EbColtemp || EbColtemp.Contains(name)) { found = true; Console.SetCursorPosition(39, 22); Console.WriteLine("=======Contact=============="); EditContactsClear(); Console.SetCursorPosition(39, 24); Console.WriteLine("{0,-12} : {1}", fieldName[0], EbCol[0]); Console.SetCursorPosition(39, 25); Console.WriteLine("{0,-12} : {1}", fieldName[1], EbCol[1]); Console.SetCursorPosition(39, 26); Console.WriteLine("{0,-12} : {1}", fieldName[2], EbCol[2]); Console.SetCursorPosition(39, 27); Console.WriteLine("{0,-12} : {1}", fieldName[3], EbCol[3]); Console.SetCursorPosition(39, 28); Console.WriteLine("{0,-12} : {1}", fieldName[4], EbCol[4]); Console.SetCursorPosition(39, 29); Console.WriteLine("{0,-12} : {1}", fieldName[5], EbCol[5]); Console.SetCursorPosition(15, 31); Console.WriteLine("(E). edit contact -- (Backspace) to return -- (N) to Next Search -- (any key) to start again"); Console.CursorVisible = false; ConsoleKeyInfo key; key = Console.ReadKey(true); if (key.Key == ConsoleKey.E) { Station.clearRow(15, 31, 105); Station.clearRow(39, 32, 30); Station.clearRow(39, 33, 30); Console.SetCursorPosition(39, 32); Console.WriteLine("Enter Name : "); Console.SetCursorPosition(39, 33); string newName = Console.ReadLine(); Station.clearRow(39, 32, 30); Station.clearRow(39, 33, 30); Console.SetCursorPosition(39, 32); Console.WriteLine("Enter Phone Number : "); Console.SetCursorPosition(39, 33); string phoneNumber = Station.MeteredInputNum(11, 39, 33); Station.clearRow(39, 32, 30); Station.clearRow(39, 33, 30); Console.SetCursorPosition(39, 32); Console.WriteLine("Enter Email : "); Console.SetCursorPosition(39, 33); string email = Console.ReadLine(); Station.clearRow(39, 32, 30); Station.clearRow(39, 33, 30); Console.SetCursorPosition(39, 32); Console.WriteLine("Enter State : "); Console.SetCursorPosition(39, 33); string state = Console.ReadLine(); Station.clearRow(39, 32, 30); Station.clearRow(39, 33, 30); Console.SetCursorPosition(39, 32); Console.WriteLine("Enter City : "); Console.SetCursorPosition(39, 33); string city = Console.ReadLine(); Station.clearRow(39, 32, 30); Station.clearRow(39, 33, 30); Console.SetCursorPosition(39, 32); Console.WriteLine("Enter Street Address : "); Console.SetCursorPosition(39, 33); string address = Console.ReadLine(); EbRows[i] = newName + "~" + phoneNumber + "~" + email + "~" + state + "~" + city + "~" + address; editer = false; } else if (key.Key == ConsoleKey.Backspace) { ContactDetails cd1 = new ContactDetails(); cd1.Start(); } else if (key.Key == ConsoleKey.N) { break; } else { EditContacts edc = new EditContacts(); edc.Start(); } } } } #endregion newData.Add(EbRows[i]); } if (!found) { Console.SetCursorPosition(48, 27); Console.Write("Contact Not Found"); Thread.Sleep(500); Start(); } } string[] newDataarr = newData.ToArray(); File.WriteAllLines(tempPath, newDataarr); File.Delete("Contacts.ebase"); Station.Blink("Editing Contact Information.............", 5000, 39, 35); File.Move("temp.txt", "Contacts.ebase"); ContactDetails cd = new ContactDetails(); cd.Start(); }