Ejemplo n.º 1
0
        public Response GetIncludedMakesRequest(Dictionary <string, object> parameters)
        {
            try
            {
                var insReq  = new InsuranceRequest();
                var sess    = new SessionRequest();
                var vehicle = new VehicleRequest();
                var client  = new ClientRequest();
                var policy  = new PolicyRequest();

                sess.Username              = (String)parameters["username"];
                sess.AuthenticationKey     = (String)parameters["AuthenticationKey"];
                sess.Bordereaux            = (bool)parameters["bordereaux"];
                sess.Account               = (String)parameters["account"];
                sess.GuaranteeWarrantyDate = (DateTime)parameters["guarenteewarrantydate"];
                sess.PaidByCard            = (bool)parameters["paidbycard"];
                sess.DeliveryDate          = (DateTime)parameters["deliverydate"];
                sess.LoanProvided          = (bool)parameters["loanprovided"];

                client.FirstName   = (String)parameters["firstname"];
                client.Surname     = (String)parameters["surname"];
                client.Title       = (String)parameters["title"];
                client.HouseNumber = (String)parameters["housenumber"];
                client.Address     = (String)parameters["address"];
                client.Postcode    = (String)parameters["postcode"];
                client.Email       = (String)parameters["email"];
                client.Telephone   = (String)parameters["telephone"];
                client.IsCompany   = (bool)parameters["iscompany"];

                policy.Description  = (String)parameters["description"];
                policy.Plan         = (String)parameters["plan"];
                policy.GrossPremium = (decimal)parameters["grosspremium"];
                policy.Product      = (String)parameters["product"];
                policy.CoverPeriod  = (int)parameters["coverperiod"];

                vehicle.Make           = (String)parameters["make"];
                vehicle.Model          = (String)parameters["model"];
                vehicle.Registration   = (String)parameters["registration"];
                vehicle.Price          = (decimal)parameters["price"];
                vehicle.Mileage        = (int)parameters["mileage"];
                vehicle.DateRegistered = (DateTime)parameters["dateregistered"];
                vehicle.EngineSize     = (int)parameters["enginesize"];
                vehicle.Fuel           = (String)parameters["fuel"];
                vehicle.NewVehicle     = (bool)parameters["newvehicle"];
                vehicle.Motorcycle     = (bool)parameters["motorcycle"];

                insReq.Session = sess;
                insReq.Client  = client;
                insReq.Policy  = policy;
                insReq.Vehicle = vehicle;

                var response = insuranceWebService.GetIncludedMakesRequest(insReq);
                return(MethodRespToObject(response));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.InnerException.Message);
                return(null);
            }
        }
Ejemplo n.º 2
0
        static void sadMain(string[] args)
        {
            InsuranceWebService insuranceWebService = new InsuranceWebService();
            var insRequest = new InsuranceRequest();
            var mySession  = new SessionRequest();
            var myPolicy   = new PolicyRequest();
            var myClient   = new ClientRequest();
            var myVehicle  = new VehicleRequest();

            mySession.Username              = "";
            mySession.AuthenticationKey     = "";
            mySession.Bordereaux            = false;
            mySession.Account               = "";
            mySession.GuaranteeWarrantyDate = new DateTime();
            mySession.PaidByCard            = true;
            mySession.DeliveryDate          = new DateTime();
            mySession.LoanProvided          = false;

            myClient.FirstName   = "";
            myClient.Surname     = "";
            myClient.Title       = "";
            myClient.HouseNumber = "";
            myClient.Address     = "";
            myClient.Postcode    = "";
            myClient.Email       = "";
            myClient.Telephone   = "";
            myClient.IsCompany   = false;

            myPolicy.Description  = "";
            myPolicy.Plan         = "";
            myPolicy.GrossPremium = 0;
            myPolicy.Product      = "";
            myPolicy.CoverPeriod  = 0;

            myVehicle.Make           = "";
            myVehicle.Model          = "";
            myVehicle.Registration   = "";
            myVehicle.Price          = 0;
            myVehicle.Mileage        = 0;
            myVehicle.DateRegistered = new DateTime();
            myVehicle.EngineSize     = 0;
            myVehicle.Fuel           = "";
            myVehicle.NewVehicle     = false;
            myVehicle.Motorcycle     = false;


            insRequest.Session = mySession;
            insRequest.Vehicle = myVehicle;
            insRequest.Client  = myClient;
            insRequest.Policy  = myPolicy;

            var response = insuranceWebService.GetIncludedMakesRequest(insRequest);

            foreach (var p in response.GetVehicleList)
            {
                Console.WriteLine(p);
            }
            Console.ReadKey();
        }