/// <summary> /// Get User By ID /// </summary> public void GetUserById() { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); MemberParametersV4 @params = new MemberParametersV4 { member_id = 45844 }; // Run the query string errorString = ""; MemberResponseV4 result = route4Me.GetUserById(@params, out errorString); Console.WriteLine(""); if (result != null) { Console.WriteLine("GetUserById executed successfully"); Console.WriteLine("User: "******" " + result.member_last_name); Console.WriteLine("member_id: " + result.member_id); Console.WriteLine("---------------------------"); } else { Console.WriteLine("GetUserById error: {0}", errorString); } }
/// <summary> /// Update an User /// </summary> public void UpdateUser() { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); MemberParametersV4 @params = new MemberParametersV4 { member_id = 220461, member_phone = "571-259-5939" }; // Run the query string errorString = ""; MemberResponseV4 result = route4Me.UserUpdate(@params, out errorString); Console.WriteLine(""); if (result != null) { Console.WriteLine("UpdateUser executed successfully"); Console.WriteLine("status: " + result.member_first_name + " " + result.member_last_name); Console.WriteLine("member_id: " + result.member_id); Console.WriteLine("---------------------------"); } else { Console.WriteLine("UpdateUser error: {0}", errorString); } }
/// <summary> /// User Registration (v4) /// </summary> public void CreateUser() { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); MemberParametersV4 @params = new MemberParametersV4 { HIDE_ROUTED_ADDRESSES = false, member_phone = "571-259-5939", member_zipcode = "22102", member_email = "*****@*****.**", HIDE_VISITED_ADDRESSES = false, READONLY_USER = false, member_type = "SUB_ACCOUNT_DISPATCHER", date_of_birth = "2010", member_first_name = "Clay", member_password = "******", HIDE_NONFUTURE_ROUTES = false, member_last_name = "Abraham", SHOW_ALL_VEHICLES = false, SHOW_ALL_DRIVERS = false }; // Run the query string errorString = ""; MemberResponseV4 result = route4Me.CreateUser(@params, out errorString); Console.WriteLine(""); if (result != null) { Console.WriteLine("UserRegistration executed successfully"); Console.WriteLine("User: "******" " + result.member_last_name); Console.WriteLine("member_id: " + result.member_id); Console.WriteLine("---------------------------"); } else { Console.WriteLine("UserRegistration error: {0}", errorString); } }
/// <summary> /// Remove User /// </summary> public void DeleteUser() { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); MemberParametersV4 @params = new MemberParametersV4 { member_id = 147824 }; // Run the query string errorString = ""; bool result = route4Me.UserDelete(@params, out errorString); Console.WriteLine(""); if (result) { Console.WriteLine("DeleteUser executed successfully"); Console.WriteLine("---------------------------"); } else { Console.WriteLine("DeleteUser error: {0}", errorString); } }