Beispiel #1
0
        public static TGuaranteeFee ConvertToTGuaranteeFee(GuaranteeFeeConfiguration fee)
        {
            TGuaranteeFee tprice = new TGuaranteeFee();

            tprice.Id        = fee.id;
            tprice.Fee       = double.Parse(fee.guarantee_fee.ToString());
            tprice.ValueFrom = double.Parse(fee.value_from.ToString());
            tprice.ValueTo   = double.Parse(fee.value_to.ToString());

            return(tprice);
        }
Beispiel #2
0
        public static GuaranteeFeeConfiguration ConvertToGuaranteeFee(TGuaranteeFee tfee)
        {
            GuaranteeFeeConfiguration price = new GuaranteeFeeConfiguration();

            price.id            = tfee.Id;
            price.guarantee_fee = decimal.Parse(tfee.Fee.ToString());
            price.value_from    = decimal.Parse(tfee.ValueFrom.ToString());
            price.value_to      = decimal.Parse(tfee.ValueTo.ToString());

            return(price);
        }
        public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            Configurations = new List <TConfiguration>();
                            TList _list0 = iprot.ReadListBegin();
                            for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                            {
                                TConfiguration _elem2 = new TConfiguration();
                                _elem2 = new TConfiguration();
                                _elem2.Read(iprot);
                                Configurations.Add(_elem2);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            SaleTicketDates = new List <TSaleTicketDate>();
                            TList _list3 = iprot.ReadListBegin();
                            for (int _i4 = 0; _i4 < _list3.Count; ++_i4)
                            {
                                TSaleTicketDate _elem5 = new TSaleTicketDate();
                                _elem5 = new TSaleTicketDate();
                                _elem5.Read(iprot);
                                SaleTicketDates.Add(_elem5);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.List)
                    {
                        {
                            TicketPrices = new List <TTicketPrice>();
                            TList _list6 = iprot.ReadListBegin();
                            for (int _i7 = 0; _i7 < _list6.Count; ++_i7)
                            {
                                TTicketPrice _elem8 = new TTicketPrice();
                                _elem8 = new TTicketPrice();
                                _elem8.Read(iprot);
                                TicketPrices.Add(_elem8);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.List)
                    {
                        {
                            TransportPrices = new List <TTransportPrice>();
                            TList _list9 = iprot.ReadListBegin();
                            for (int _i10 = 0; _i10 < _list9.Count; ++_i10)
                            {
                                TTransportPrice _elem11 = new TTransportPrice();
                                _elem11 = new TTransportPrice();
                                _elem11.Read(iprot);
                                TransportPrices.Add(_elem11);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            GuaranteeFees = new List <TGuaranteeFee>();
                            TList _list12 = iprot.ReadListBegin();
                            for (int _i13 = 0; _i13 < _list12.Count; ++_i13)
                            {
                                TGuaranteeFee _elem14 = new TGuaranteeFee();
                                _elem14 = new TGuaranteeFee();
                                _elem14.Read(iprot);
                                GuaranteeFees.Add(_elem14);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 6:
                    if (field.Type == TType.List)
                    {
                        {
                            Buses = new List <TBus>();
                            TList _list15 = iprot.ReadListBegin();
                            for (int _i16 = 0; _i16 < _list15.Count; ++_i16)
                            {
                                TBus _elem17 = new TBus();
                                _elem17 = new TBus();
                                _elem17.Read(iprot);
                                Buses.Add(_elem17);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 7:
                    if (field.Type == TType.List)
                    {
                        {
                            Tours = new List <TTour>();
                            TList _list18 = iprot.ReadListBegin();
                            for (int _i19 = 0; _i19 < _list18.Count; ++_i19)
                            {
                                TTour _elem20 = new TTour();
                                _elem20 = new TTour();
                                _elem20.Read(iprot);
                                Tours.Add(_elem20);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }