private void InputAppointment() { Station.writer(39, 19, "Enter Name of Appointment Max(12)"); name = Station.MeteredInput(12, 39, 20); Station.writer(39, 22, "Enter year Max(4) i.e 2018"); year = Station.MeteredInputNum(4, 39, 23); DisplayMonths(); Station.writer(39, 25, "Enter month Max(2)"); month = Station.MeteredInputNum(2, 39, 26); if (Convert.ToInt32(year) == 2018) { if (Convert.ToInt32(month) == 6) { Station.writer(3, 27, "===June 2018==="); Calender.JuneCal(3, 28); } else if (Convert.ToInt32(month) == 7) { Station.writer(3, 28, "===July 2018==="); Calender.JulyCal(3, 29); } } Station.writer(39, 28, "Enter day Max(2)"); day = Station.MeteredInputNum(2, 39, 29); Station.writer(39, 31, "Enter hour Max(2)"); hour = Station.MeteredInputNum(2, 39, 32); Station.writer(39, 34, "Enter minute Max(2)"); minute = Station.MeteredInputNum(2, 39, 35); Station.writer(39, 37, "Enter Location Max(12)"); location = Station.MeteredInput(12, 39, 38); Station.writer(39, 39, "(P). PM or (A). AM"); EnterAmPm(39, 39); }
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 - 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(); }
private void CheckPreviousPassword() { //39, 21 - 23 Station.writerClearedRow(39, 21, "Enter previous password"); Station.clearRow(1, 23, 118); Console.CursorVisible = true; Console.SetCursorPosition(39, 22); string prevPassword = Station.PassWordStar(); if (prevPassword == Station.password) { Station.writerClearedRow(39, 24, "Enter New User Name"); newUsername = Station.MeteredInput(12, 39, 25); Station.writerClearedRow(39, 27, "Enter New Password"); Console.SetCursorPosition(39, 28); newPassword = Station.PassWordStar(); Station.writerClearedRow(39, 30, "Confirm New Password"); Console.SetCursorPosition(39, 31); string newPasswordConfirm = Station.PassWordStar(); if (newPassword == newPasswordConfirm) { Station.writerClearedRow(39, 33, "Press (Y) to save or (N) to cancel"); Console.CursorVisible = false; ConsoleKeyInfo key1; key1 = Console.ReadKey(true); if (key1.Key == ConsoleKey.Y) { SaveToSettingsFile(); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else if (key1.Key == ConsoleKey.N) { Station.writerClearedRow(39, 35, "Change Login Details Canceled"); Station.writerClearedRow(39, 36, "Press any key to exit"); Console.ReadKey(true); SettingsLoginDetails sld = new SettingsLoginDetails(); sld.Start(); } else { Station.BeepError(); Console.SetCursorPosition(39, 36); Console.WriteLine("Invalid Key."); Thread.Sleep(200); Station.clearRow(39, 36, 15); } } else { Console.CursorVisible = false; Station.writerClearedRow(39, 34, "The Passwords Do not Match"); Station.writerClearedRow(39, 35, "press anykey to try again"); Console.ReadKey(true); Start(); } } else { Console.CursorVisible = false; Station.writerClearedRow(39, 24, "The Password is Incorrect"); Station.writerClearedRow(39, 25, "press anykey to try again"); Console.ReadKey(true); Start(); } }
public void DisplayPassword() { Console.ForegroundColor = Station.consoleColMain; Console.Clear(); Border(5, 42, 35, 30); int left = 50; int top = 10; Console.SetCursorPosition(left, top); Console.WriteLine(" Login Page "); top++; Console.SetCursorPosition(left, top); Console.WriteLine("---------------"); top += 2; Console.SetCursorPosition(left, top); Console.WriteLine("Enter your Username"); top++; Console.SetCursorPosition(left, top); string username = Station.MeteredInput(12, left, top); top += 2; Console.SetCursorPosition(left, top); Console.WriteLine("Enter your Password"); string password = ""; if (Station.passHide == "A") { top++; Console.SetCursorPosition(left, top); password = Station.PassWordStar(); } else if (Station.passHide == "I") { top++; Console.SetCursorPosition(left, top); Console.ForegroundColor = ConsoleColor.Black; password = Station.MeteredInput(12, left, top); Console.ForegroundColor = Station.consoleColMain; } if (username == Station.username && password == Station.password) { Station.loggedIn = true; Console.SetCursorPosition(left, top + 5); Console.WriteLine("you have Logged in"); Console.CursorVisible = false; Console.SetCursorPosition(left, top + 3); Console.WriteLine("Press any key to continue"); Console.ReadKey(true); MainMenu mm = new MainMenu(); mm.Start(); } else { Console.SetCursorPosition(left, top + 5); Console.WriteLine("Login incorrect"); top += 2; Console.SetCursorPosition(left, top + 5); Console.WriteLine("Press any key"); top++; Console.SetCursorPosition(left, top + 5); Console.WriteLine("to try again"); Console.CursorVisible = false; Console.ReadKey(true); DisplayPassword(); } }
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(); }
public void Start() { Console.Title = "BlueMoon - Add Contacts"; Station.BlueMoonHeader(); AddContactsHeader(); // open file and a stream writer to write FileStream fs = new FileStream("Contacts.ebase", FileMode.Append, FileAccess.Write); StreamWriter w = new StreamWriter(fs); // Input Name Station.BorderThread(2, 20, 20, 6, 20); Station.writer(3, 21, "Enter Name : "); Station.writer(3, 22, "max letters(16)"); string name = Station.MeteredInput(16, 3, 23); // Input Phone Number Station.BorderThread(24, 20, 20, 6, 20); Station.writer(25, 21, "Enter Phone Number"); Station.writer(25, 22, "max letters(11)"); string phoneNumber = Station.MeteredInputNum(11, 25, 23); // Input Email Station.BorderThread(46, 20, 28, 6, 20); Station.writer(47, 21, "Enter Email"); Station.writer(47, 22, "max letters(25)"); string email = Station.MeteredInput(25, 47, 23); // Input State Station.BorderThread(76, 20, 19, 6, 20); Station.writer(77, 21, "Enter State"); Station.writer(77, 22, "max letters(10)"); string state = Station.MeteredInput(10, 77, 23); // Input City Station.BorderThread(97, 20, 19, 6, 20); Station.writer(98, 21, "Enter City"); Station.writer(98, 22, "max letters(12)"); string city = Station.MeteredInput(12, 98, 23); //Input Address Station.BorderThread(2, 27, 30, 6, 20); Station.writer(3, 28, "Enter street address : "); Station.writer(3, 29, "max letters(28)"); string address = Station.MeteredInput(28, 3, 30); // Ask user if sure to save data ToSaveData(); while (true) { Console.CursorVisible = false; ConsoleKeyInfo key; key = Console.ReadKey(true); if (key.Key == ConsoleKey.Y) { Console.SetCursorPosition(35, 28); Console.WriteLine(" "); Console.SetCursorPosition(35, 30); Console.WriteLine(" "); Console.SetCursorPosition(35, 32); Console.WriteLine(" "); Station.Blink("Saving Data.........", 3000, 35, 28); string cont = name + "~" + phoneNumber + "~" + email + "~" + state + "~" + city + "~" + address; w.WriteLine(cont); w.Flush(); w.Close(); fs.Close(); fs.Dispose(); w.Dispose(); Console.SetCursorPosition(35, 28); Console.Write("Data Saved. "); Console.SetCursorPosition(35, 30); Console.Write("press any key to return to previous Menu"); Console.ReadKey(true); ContactDetails cd = new ContactDetails(); cd.Start(); break; } else if (key.Key == ConsoleKey.N) { w.Flush(); w.Close(); fs.Close(); Start(); return; } else if (key.Key == ConsoleKey.Backspace) { w.Flush(); w.Close(); fs.Close(); ContactDetails cd = new ContactDetails(); cd.Start(); return; } else { Console.SetCursorPosition(63, 29); Console.WriteLine("Invalid Key."); Thread.Sleep(200); Console.SetCursorPosition(63, 29); Console.WriteLine(" "); } } }