Beispiel #1
0
        public Response GetProductListRequest(Dictionary <string, object> parameters)
        {
            try
            {
                var insReq  = new InsuranceRequest();
                var sess    = new SessionRequest();
                var vehicle = new VehicleRequest();


                sess.Username              = (String)parameters["username"];
                sess.Password              = "";
                sess.AuthenticationKey     = (String)parameters["authenticationKey"];
                sess.GuaranteeWarrantyDate = (DateTime)parameters["guarenteewarrantydate"];
                sess.DeliveryDate          = (DateTime)parameters["deliverydate"];
                sess.LoanProvided          = (bool)parameters["loanprovided"];
                vehicle.Price              = (decimal)parameters["price"];

                insReq.Session = sess;
                insReq.Vehicle = vehicle;

                var response = insuranceWebService.GetProductListRequest(insReq);
                return(MethodRespToObject(response));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.InnerException.Message);
                return(null);
            }
        }
        static void TMain(string[] args)
        {
            InsuranceWebService insuranceWebService = new InsuranceWebService();
            var insReq = new InsuranceRequest();
            var sess   = new SessionRequest();
            var veh    = new VehicleRequest();

            sess.Username              = "";
            sess.Password              = "";
            sess.DeliveryDate          = new DateTime();
            sess.AuthenticationKey     = "";
            sess.GuaranteeWarrantyDate = new DateTime();
            sess.LoanProvided          = true;
            veh.Price      = 1;
            sess.Vehicle   = veh;
            insReq.Session = sess;
            insReq.Vehicle = veh;


            var response = insuranceWebService.GetProductListRequest(insReq);

            for (int i = 0; i < response.Plan.Length; i++)
            {
                Console.WriteLine(response.Plan[i]);
                Console.WriteLine(response.Description[i]);
            }
            Console.ReadKey();
        }