Example #1
0
        public bool AddDriver(string firstName, string lastName, int age)
        {
            bool isOperationSuccessful = false;
            //Route r = new Route();
            //r.Name = name;
                        
            Driver d = new Driver();
            d.FirstName = firstName;
            d.LastName = lastName;
            d.Age = age;

            try
            {
                d.SaveAndFlush();
                isOperationSuccessful = true;
            }
            catch (Exception ex)
            {
                EventLog el = new EventLog();
                el.Source = "Application";
                el.WriteEntry(ex.Message);
            }

            return isOperationSuccessful;
        }