Пример #1
0
        public omdlSendData getSendData2(DataModel data)
        {
            omdlSendData send = new omdlSendData();

            send.moduleType = data.modules.sendData.moduleType;// "OMDL_SEND_DATA";

            SendDataModules  sm  = new SendDataModules();
            receiverNameInfo rec = new receiverNameInfo();

            rec.firstName   = data.modules.sendData.moduleData.receiverName.firstName; // null;
            rec.lastName    = data.modules.sendData.moduleData.receiverName.lastName;  //null;
            sm.receiverName = rec;

            receiverTelInfo recTel = new receiverTelInfo();

            recTel.telCountryCode = data.modules.sendData.moduleData.receiverTel.telCountryCode; // "886";
            recTel.telNumber      = data.modules.sendData.moduleData.receiverTel.telNumber;      //"934233332";
            sm.receiverTel        = recTel;

            sendToCountryInfo  sendCountry = new sendToCountryInfo();
            receiveAddressInfo recAdd      = new receiveAddressInfo();

            recAdd.countryCode         = data.modules.sendData.moduleData.sendToCountry.receiveAddress.countryCode; // null;
            recAdd.cityCode            = data.modules.sendData.moduleData.sendToCountry.receiveAddress.cityCode;    // null;
            recAdd.zipCode             = data.modules.sendData.moduleData.sendToCountry.receiveAddress.zipCode;     //null;
            recAdd.address             = data.modules.sendData.moduleData.sendToCountry.receiveAddress.address;     //null;
            sendCountry.receiveAddress = recAdd;
            sm.sendToCountry           = sendCountry;

            sendToHotelInfo sendHtl = new sendToHotelInfo();

            sendHtl.hotelName    = data.modules.sendData.moduleData.sendToHotel.hotelName;    // null;
            sendHtl.hotelAddress = data.modules.sendData.moduleData.sendToHotel.hotelAddress; //null;
            sendHtl.hotelTel     = data.modules.sendData.moduleData.sendToHotel.hotelTel;     // null;
            buyerPassportEnglishNameInfo b = new buyerPassportEnglishNameInfo();

            b.firstName = data.modules.sendData.moduleData.sendToHotel.buyerPassportEnglishName.firstName;
            b.lastName  = data.modules.sendData.moduleData.sendToHotel.buyerPassportEnglishName.lastName;
            sendHtl.buyerPassportEnglishName = b;

            buyerLocalNameInfo b1 = new buyerLocalNameInfo();

            b1.firstName           = data.modules.sendData.moduleData.sendToHotel.buyerLocalName.firstName;
            b1.lastName            = data.modules.sendData.moduleData.sendToHotel.buyerLocalName.lastName;
            sendHtl.buyerLocalName = b1;

            sendHtl.bookingOrderNo = data.modules.sendData.moduleData.sendToHotel.bookingOrderNo;
            sendHtl.bookingWebsite = data.modules.sendData.moduleData.sendToHotel.bookingWebsite; // null;
            sendHtl.checkInDate    = data.modules.sendData.moduleData.sendToHotel.checkInDate;    //null;
            sendHtl.checkOutDate   = data.modules.sendData.moduleData.sendToHotel.checkOutDate;   // null;

            sm.sendToHotel = sendHtl;
            shipInfoInfo s = new shipInfoInfo();

            s.shipDate       = data.modules.sendData.moduleData.shipInfo.shipDate;       // null;
            s.trackingNumber = data.modules.sendData.moduleData.shipInfo.trackingNumber; // null;

            sm.shipInfo     = s;
            send.moduleData = sm;
            return(send);
        }
Пример #2
0
        //假聯絡人
        //public static distributorInfo fakeContact()
        //{

        //    distributorInfo fake = new distributorInfo()
        //    {
        //        companyXid = "1",
        //        channelOid = "111",
        //        userid = "2",
        //        firstName = "sharon",
        //        lastName = "chang",
        //        areatel = "886",
        //        tel = "3939889",
        //        email = "*****@*****.**",
        //        countryCd = "TW",
        //        lang = "zh-tw",
        //        currency = "TWD",
        //        state="TW",
        //        memberUuid = "051794b8-db2a-4fe7-939f-31ab1ee2c719",
        //        tokenKey = "897af29c45ed180451c2e6bfa81333b6",
        //        deviceId = "3c2ab71448224d1d7148350f7972e96e"
        //    };

        //    return fake;
        //}

        //假國攷
        //public static List<Country> fakeCountry()
        //{
        //    Country c1 = new Country() { countryCd = "TW", countryName = "台灣", countryEngName = "TAIWAN" };
        //    Country c2 = new Country() { countryCd = "HK", countryName = "香港", countryEngName = "HONG KONG" };
        //    Country c3 = new Country() { countryCd = "MO", countryName = "澳門", countryEngName = "MO" };
        //    Country c4 = new Country() { countryCd = "CN", countryName = "中國", countryEngName = "CN" };
        //    Country c5 = new Country() { countryCd = "US", countryName = "美國", countryEngName = "US" };

        //    List<Country> lstCountry = new List<Country>();
        //    lstCountry.Add(c1);
        //    lstCountry.Add(c2);
        //    lstCountry.Add(c3);
        //    lstCountry.Add(c4);
        //    lstCountry.Add(c5);

        //    return lstCountry;
        //}

        //單純的目的是產出前台可以使用的object string
        public static DataModel getDefaultDataModel(int qty, string guidNo)
        {
            DataModel d = new DataModel();

            d.guidNo = guidNo;

            modulesData modules = new modulesData();

            otherDataM other = new otherDataM();

            other.moduleType = "OMDL_OTHER_DATA";
            moduleData_otherData mo = new moduleData_otherData();

            other.moduleData  = mo;
            modules.otherData = other;

            contactDataM contact = new contactDataM();

            contact.moduleType = "OMDL_CONTACT_DATA";
            moduleData_contactData mcontract = new moduleData_contactData();
            contactNameInfo        cni       = new contactNameInfo();
            contactTelInfo         cti       = new contactTelInfo();
            contactAppInfo         cai       = new contactAppInfo();

            mcontract.contactName = cni;
            mcontract.contactTel  = cti;
            mcontract.contactApp  = cai;
            contact.moduleData    = mcontract;


            modules.contactData = contact;

            sendDataM send = new sendDataM();

            send.moduleType = "OMDL_SEND_DATA";
            moduleData_sendData msend         = new moduleData_sendData();
            receiverNameInfo    receiverName  = new receiverNameInfo();
            receiverTelInfo     receiverTel   = new receiverTelInfo();
            sendToCountryInfo   sendToCountry = new sendToCountryInfo();

            receiveAddressInfo receiveAdd = new receiveAddressInfo();

            sendToCountry.receiveAddress = receiveAdd;

            sendToHotelInfo sendToHotel = new sendToHotelInfo();
            buyerPassportEnglishNameInfo buyerPassportEnglishName = new buyerPassportEnglishNameInfo();
            buyerLocalNameInfo           buyerLocalName           = new buyerLocalNameInfo();

            sendToHotel.buyerPassportEnglishName = buyerPassportEnglishName;
            sendToHotel.buyerLocalName           = buyerLocalName;
            shipInfoInfo shipInfo = new shipInfoInfo();

            msend.receiverName  = receiverName;
            msend.receiverTel   = receiverTel;
            msend.sendToCountry = sendToCountry;
            msend.sendToHotel   = sendToHotel;
            msend.shipInfo      = shipInfo;
            send.moduleData     = msend;
            modules.sendData    = send;

            passengerDataM passenger = new passengerDataM();

            passenger.moduleType = "OMDL_PSGR_DATA";
            moduleData_passenger mp            = new moduleData_passenger();
            qtyChildSeatInfo     qtyChildSeat  = new qtyChildSeatInfo();
            qtyInfantSeatInfo    qtyInfantSeat = new qtyInfantSeatInfo();

            mp.qtyChildSeat       = qtyChildSeat;
            mp.qtyInfantSeat      = qtyInfantSeat;
            passenger.moduleData  = mp;
            modules.passengerData = passenger;

            carRentingDataM carRentingData = new carRentingDataM();

            carRentingData.moduleType = "OMDL_RENT_CAR";
            moduleData_CarRent cm     = new moduleData_CarRent();
            pickUpInfo_forCar  pickUp = new pickUpInfo_forCar();

            dateTimeInfo t = new dateTimeInfo();

            pickUp.datetime = t;

            dropOffInfo_forCar dropOff = new dropOffInfo_forCar();

            dropOff.datetime          = t;
            cm.pickUp                 = pickUp;
            cm.dropOff                = dropOff;
            carRentingData.moduleData = cm;
            modules.carRentingData    = carRentingData;

            shuttleDataM shuttle = new shuttleDataM();

            shuttle.moduleType = "OMDL_SHUTTLE";
            moduleData_Shuttle     ms = new moduleData_Shuttle();
            designatedLocationInfo designatedLocation = new designatedLocationInfo();
            timeInfo   time = new timeInfo();
            pickUpInfo pp   = new pickUpInfo();

            pp.time = time;
            dropOffInfo dd = new dropOffInfo();
            designatedByCustomerInfo designatedByCustomer = new designatedByCustomerInfo();

            designatedByCustomer.pickUp  = pp;
            designatedByCustomer.dropOff = dd;
            charterRouteInfo charterRoute = new charterRouteInfo();

            ms.designatedLocation   = designatedLocation;
            ms.designatedByCustomer = designatedByCustomer;
            ms.charterRoute         = charterRoute;
            shuttle.moduleData      = ms;
            modules.shuttleData     = shuttle;

            flightInfoDataM flight = new flightInfoDataM();

            flight.moduleType = "OMDL_FLIGHT_INFO";
            moduleData_FlightInfo mf      = new moduleData_FlightInfo();
            arrivalInfo           arrival = new arrivalInfo();

            arrivalDatetimeInfo atime = new arrivalDatetimeInfo();

            arrival.arrivalDatetime = atime;
            departureInfo         departure = new departureInfo();
            departureDatetimeInfo dtime     = new departureDatetimeInfo();

            departure.departureDatetime = dtime;

            mf.arrival             = arrival;
            mf.departure           = departure;
            flight.moduleData      = mf;
            modules.flightInfoData = flight;

            d.modules = modules;


            List <CusDataInfo> LstCus = new List <CusDataInfo>();

            for (int i = 0; i < qty; i++)
            {
                CusDataInfo cus = new CusDataInfo();

                nationalityInfo nation = new nationalityInfo();
                cus.nationality = nation;
                passportInfo ppt = new passportInfo();
                cus.passport = ppt;

                englishNameInfo en = new englishNameInfo();
                cus.englishName = en;
                localNameInfo localName = new localNameInfo();
                cus.localName = localName;
                weightInfo weight = new weightInfo();
                cus.weight = weight;
                heightInfo height = new heightInfo();
                cus.height = height;
                shoeSizeInfo shoes = new shoeSizeInfo();
                cus.shoeSize = shoes;

                foodAllergyInfo food = new foodAllergyInfo();
                mealInfo        meal = new mealInfo();
                meal.foodAllergy     = food;
                meal.excludeFoodType = new string[] { };

                cus.meal = meal;
                LstCus.Add(cus);
            }
            d.travelerData = LstCus;

            cardInfo card = new cardInfo();

            d.card = card;

            return(d);
        }