public static Contact TblToData(tbl_ContactDB tblContactDB) { if (tblContactDB == null) return null; Contact account= new Contact(); try { Console.WriteLine(string.Format("{0,-30}", "\t\tAccountID : " + tblContactDB.AccountID + "\n")); Console.WriteLine(string.Format("{0,-30}", "\t\tFirstName : " + tblContactDB.FirstName)); Console.WriteLine(string.Format("{0,-30}", "\t\tMiddleName : " + tblContactDB.MiddleName)); Console.WriteLine(string.Format("{0,-30}", "\t\tLastName : " + tblContactDB.LastName)); Console.WriteLine(string.Format("{0,-30}", "\t\tAddress : " + tblContactDB.Address)); Console.WriteLine(string.Format("{0,-30}", "\t\tCity : " + tblContactDB.City)); Console.WriteLine(string.Format("{0,-30}", "\t\tProvince : " + tblContactDB.Province)); Console.WriteLine(string.Format("{0,-30}", "\t\tZipCode : " + (int)tblContactDB.ZipCode)); Console.WriteLine(string.Format("{0,-30}", "\t\tTelephoneNumber: " + (int)tblContactDB.TelephoneNumber)); Console.WriteLine(string.Format("{0,-30}", "\t\tMobileNumber : " + (int)tblContactDB.MobileNumber)); Console.WriteLine(string.Format("{0,-30}", "\t\tEmail : " + tblContactDB.Email)); Console.WriteLine(string.Format("{0,-30}", "\t\tTimeSubmitted : " + (DateTime)tblContactDB.TimeSubmitted + "\n\n")); } catch (Exception) { throw; } return account; }
public AccountConsole CreateAccount() { bool parsing; Contact account = new Contact(); Console.Write("\t\tFirstName : "); account.FirstName = Console.ReadLine(); Console.Write("\t\tMiddleName : "); account.MiddleName = Console.ReadLine(); Console.Write("\t\tLastName : "); account.LastName = Console.ReadLine(); Console.Write("\t\tAddress : "); account.Address = Console.ReadLine(); Console.Write("\t\tCity : "); account.City = Console.ReadLine(); Console.Write("\t\tProvince : "); account.Province = Console.ReadLine(); Console.Write("\t\tZipCode : "); parsing = int.TryParse(Console.ReadLine(),out account.ZipCode); if (!parsing) account.ZipCode = 0; Console.Write("\t\tTelephoneNumber: "); parsing = int.TryParse(Console.ReadLine(),out account.TelephoneNumber); if (!parsing) account.TelephoneNumber=0; Console.Write("\t\tMobileNumber : "); parsing = int.TryParse(Console.ReadLine(),out account.MobileNumber); if (!parsing) return null; Console.Write("\t\tEmail : "); account.Email = Console.ReadLine(); return client.CreateAccount(account.FirstName, account.MiddleName, account.LastName, account.Address, account.City, account.Province, account.ZipCode, account.TelephoneNumber, account.MobileNumber, account.Email); }
public AccountConsole DeleteAccount() { try { Contact accounts = new Contact(); Console.Write("\tAre You Sure You Want to Delete this Contact. [Y/N]?"); if (char.Parse(Console.ReadLine().ToLower()) == 'y') return client.DeleteAccount(temp); else return null; } catch (Exception) { return null; } }
public AllAccount GetUpdate(string s) { FunctionClasses account = new FunctionClasses(); Contact accounts = new Contact(); Console.Write(s); accounts.AccountID = Console.ReadLine(); temp = accounts.AccountID; return account.GetUpdate(accounts.AccountID); }