Ejemplo n.º 1
0
        private void AddEmployeeAction(object sender, EventArgs eventArgs)
        {
            var employee = new EmployeeModel()
            {
                FirstName = FindViewById <TextView>(Resource.Id.firstNameInput).Text,
                LastName  = FindViewById <TextView>(Resource.Id.lastNameInput).Text,
                Mail      = FindViewById <TextView>(Resource.Id.mailInput).Text,
            };

            eh.AddEmployee(employee);
            StartActivity(typeof(MainActivity));
        }
Ejemplo n.º 2
0
        private static void ExecuteCommand(string command)
        {
            string pattern = @"^(\S+)\s+(.+)";
            Match  m       = Regex.Match(command, pattern);
            var    value   = m.Groups[2].Value;

            switch (m.Groups[1].Value)
            {
            case "add":
                emplHelper.AddEmployee(value);
                Console.WriteLine("Added");
                break;

            case "get":
                Console.WriteLine(GetEmployee(value));
                break;
            }
        }