Esempio n. 1
0
        private static void displayAllRecs()
        {
            var recs = component.FindEmployee(UIInteraction.GetString("Enter the Name to search"));

            foreach (var rec in recs)
            {
                displayEmpInfo(rec);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var    fileName  = args[0];
            bool   @continue = true;
            string menu      = new StreamReader(fileName).ReadToEnd();

            do
            {
                string choice = UIInteraction.GetString(menu);
                @continue = processMenu(choice);
            } while (@continue);
        }
Esempio n. 3
0
 private static void deleteEmp()
 {
     try
     {
         int id = UIInteraction.GetInteger("Enter an ID to delete");
         component.DeleteEmployee(id);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Esempio n. 4
0
 private static void displayRec()
 {
     try
     {
         var id  = UIInteraction.GetInteger("Enter the ID to search");
         var emp = component.FindEmployee(id);
         displayEmpInfo(emp);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
        private static void saveFile()
        {
            var bill = new Bill();

            bill.BillNo      = UIInteraction.GetInteger("Enter the BillNo");
            bill.BillDate    = DateTime.Now;
            bill.Description = UIInteraction.GetString("Enter the Description");
            bill.Amount      = UIInteraction.GetInteger("Enter the Amount of the Bill");
            FileStream      fs = new FileStream("Data.Bin", FileMode.OpenOrCreate, FileAccess.Write);
            BinaryFormatter fm = new BinaryFormatter();

            fm.Serialize(fs, bill);
            fs.Close();
        }
Esempio n. 6
0
 private static void createEmp()
 {
     try
     {
         var emp = new Employee();
         emp.EmployeeID          = UIInteraction.GetInteger("Enter the ID of the Employee");
         emp.EmployeeName        = UIInteraction.GetString("Enter the Name");
         emp.EmployeeAddress     = UIInteraction.GetString("Enter the Address");
         emp.EmployeeDateOfBirth = UIInteraction.GetDate("Enter the date of birth in the format of dd/MM/yyyy");
         component.AddNewEmployee(emp);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }