Пример #1
0
 public AllAccount GetAllData()
 {
     FunctionClasses account = new FunctionClasses();
     return account.GetAllContact();
 }
Пример #2
0
 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);
 }
Пример #3
0
        static void Main(string[] args)
        {
            bool flag=true;
            char select;

            Program function = new Program();
            FunctionClasses imp = new FunctionClasses();

            do
            {

                bool option = char.TryParse(function.Display(), out select);

                if (option)
                {

                    switch (select)
                    {
                        case 'c':
                            Console.Clear();
                            Console.WriteLine("\n\n\t\t\t\tCreate Contact\n\n");
                            if (function.CreateAccount()==null)
                            Console.Write("\n\t\t\tError in Creating Contact");
                            Console.Write("\n\t\t\tPress <Enter> to Continue");
                            Console.ReadLine();
                            Console.Clear();
                            break;
                        case 'u':
                            Console.Clear();

                            Console.WriteLine("\n\n\t\t\t\tUpdate Contact\n\n");
                            if (function.GetUpdate("\t\tEnter the AccountID to be Update: ") == null)
                                 Console.Write("\n\t\t\tI Can't Find AccountID");
                            else if(function.UpdateAccount() ==null)
                                Console.Write("\n\t\t\tError in Updating Contact");
                            Console.Write("\n\t\t\tPress <Enter> to Continue");
                            Console.ReadLine();
                            Console.Clear();
                            break;
                        case 'd':
                            Console.Clear();
                            Console.WriteLine("\n\n\t\t\t\tDelete Contact\n\n");
                            if (function.GetUpdate("\t\tEnter the AccountID to be Delete: ") == null)
                                 Console.Write("\n\t\t\tI Can't Find AccountID");
                            else if(function.DeleteAccount() ==null)
                                Console.Write("\n\t\t\tError in Delete Contact");
                            else
                                Console.Write("\n\t\t\tSuccessfully Deleted.");
                            Console.Write("\n\t\t\tPress <Enter> to Continue");
                            Console.ReadLine();
                            Console.Clear();
                            break;
                        case 'v':
                            Console.Clear();
                            Console.WriteLine("\n\n\t\t\tAll Contact Information\n\n");
                            if(function.GetAllData()==null)
                            Console.Write("\n\t\t\tNo Contact");
                            Console.Write("\n\t\t\tPress <Enter> to Continue");
                            Console.ReadLine();
                            Console.Clear();
                            break;
                        case 'x':
                            flag = false;
                            break;
                        default:
                            Console.Clear();
                            Console.WriteLine(string.Format("\n{0,40}", "Incorrect Option."));

                            break;
                    }

                }
                else
                {
                    Console.Clear();
                    Console.WriteLine(string.Format("\n{0,40}", "Invalid."));
                }
            }while(flag);
        }