/// <summary>
        /// 添加时间段
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_AddTimeInfo_Click(object sender, EventArgs e)
        {
            timeInfo timeInfo = new timeInfo((flowLayoutPanel1.Controls.Count + 1).ToString());

            flowLayoutPanel1.Controls.Add(timeInfo);
        }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="workername"></param>
        private void Initialize()
        {
            //参加人员姓名
            this.labName.Text = this.gWorkerName;

            #region 初始化日期
            string    sql    = "Select workername,workdate from WorkingHours where workername='" + DESJiaMi.Encrypt(this.gWorkerName) + "' and isdelete='1' order by workdate desc;";
            DataTable workdt = DbHelperOleDb.Query(sql, new Dictionary <string, object>()).Tables[0];
            if (workdt != null && workdt.Rows.Count > 0)
            {
                if (!string.IsNullOrEmpty(workdt.Rows[0]["workdate"].ToString()))
                {
                    DateTime dateTime = DateTime.Now;
                    if (DateTime.TryParse(workdt.Rows[0]["workdate"].ToString(), out dateTime))
                    {
                        dateWorkDate.Value = dateTime.AddDays(1);
                    }
                }
            }
            #endregion


            string ContinuousAddition = ConfigOperator.GetValueFromConfig("ContinuousAddition");
            if (!string.IsNullOrEmpty(ContinuousAddition) && ContinuousAddition == "true")
            {
                checkLianxu.Checked = true;
            }
            else
            {
                checkLianxu.Checked = false;
            }

            timeInfo timeInfo1 = new timeInfo("1");
            timeInfo timeInfo2 = new timeInfo("2");

            string defaultTimeSet = ConfigOperator.GetValueFromConfig("defaultTimeSet");
            if (!string.IsNullOrEmpty(defaultTimeSet) && defaultTimeSet == "true")
            {
                DateTime dateTime = DateTime.Now;

                string staTime1 = ConfigOperator.GetValueFromConfig("startTime1");
                if (!string.IsNullOrEmpty(staTime1) && DateTime.TryParse(staTime1, out dateTime))
                {
                    timeInfo1.startTime.Value = DateTime.Parse(staTime1);
                }

                string eTime = ConfigOperator.GetValueFromConfig("endTime1");
                if (!string.IsNullOrEmpty(eTime) && DateTime.TryParse(eTime, out dateTime))
                {
                    timeInfo1.endtime.Value = DateTime.Parse(eTime);
                }

                string staTime2 = ConfigOperator.GetValueFromConfig("startTime2");
                if (!string.IsNullOrEmpty(staTime2) && DateTime.TryParse(staTime2, out dateTime))
                {
                    timeInfo2.startTime.Value = DateTime.Parse(staTime2);
                }
                string eTime2 = ConfigOperator.GetValueFromConfig("endTime2");
                if (!string.IsNullOrEmpty(eTime2) && DateTime.TryParse(eTime2, out dateTime))
                {
                    timeInfo2.endtime.Value = DateTime.Parse(eTime2);
                }
            }

            flowLayoutPanel1.Controls.Add(timeInfo1);
            flowLayoutPanel1.Controls.Add(timeInfo2);
        }
Пример #3
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);
        }