コード例 #1
0
            public ReservationOrder ReservationOrder(DataRow row, string language, int? claimId, string orderNote)
            {
                ReservationOrder result = new ReservationOrder
                {
                    id = (!row.IsNull("orderid")) ? row.ReadNullableTrimmedString("orderid") : row.ReadNullableInt("localid").ToString(),
                    localid = row.ReadNullableInt("localid"),
                    status = new ReservationStatus
                    {
                        id = row.ReadInt("actstatusid"),
                        description = row.ReadNullableTrimmedString("actstatusname")
                    },
                    datefrom = row.ReadUnspecifiedDateTime("datefrom"),
                    datetill = row.ReadUnspecifiedDateTime("datetill"),
                    partner = row.IsNull("partnerid") ? null : new ReservationPartner
                    {
                        id = row.ReadInt("partnerid"),
                        name = row.ReadNullableTrimmedString("partnername")
                    },
                    pax = new ReservationPax
                    {
                        adult = row.ReadInt("adult"),
                        child = row.ReadInt("child"),
                        infant = row.ReadInt("infant"),
                        extra = row.ReadInt("addinfant")
                    },
                    note = row.ReadNullableTrimmedString("note"),
                    price = (row.IsNull("saleprice") || row.IsNull("salecurrency")) ? null : new ReservationOrderPrice
                    {
                        total = row.ReadDecimal("saleprice"),
                        currency = row.ReadNullableTrimmedString("salecurrency")
                    }
                };
                XElement peopleXml = row.ReadXml("peoples");
                if (peopleXml != null)
                {
                    result.peopleids = new System.Collections.Generic.List<string>();
                    foreach (XElement peopleNode in peopleXml.DescendantsAndSelf("People"))
                    {
                        XElement idNode = peopleNode.Element("Id");
                        XElement localidNode = peopleNode.Element("LocalId");
                        result.peopleids.Add((idNode != null) ? idNode.Value : ((localidNode != null) ? localidNode.Value : ""));
                    }
                }
                string orderType = row.ReadString("type").ToLower();
                if (orderType == "hotel")
                {
                    result.hotel = new HotelReservationOrder
                    {
                        id = row.ReadInt("hotelid"),
                        name = row.ReadNullableTrimmedString("hotelname"),
                        room = row.IsNull("roomid") ? null : new HotelReservationRoom
                        {
                            id = row.ReadInt("roomid"),
                            name = row.ReadNullableTrimmedString("roomname")
                        },
                        htplace = row.IsNull("htplaceid") ? null : new HotelReservationHtplace
                        {
                            id = row.ReadInt("htplaceid"),
                            name = row.ReadNullableTrimmedString("htplacename")
                        },
                        meal = row.IsNull("mealid") ? null : new HotelReservationMeal
                        {
                            id = row.ReadInt("mealid"),
                            name = row.ReadNullableTrimmedString("mealname")
                        }
                    };
                }
                else
                {
                    if (orderType == "excursion")
                    {
                        result.excursion = new ExcursionReservationOrder
                        {
                            id = row.ReadInt("excursid"),
                            name = row.ReadNullableTrimmedString("excursname"),
                            time = row.IsNull("extimeid") ? null : new ExcursionReservationTime
                            {
                                id = row.ReadInt("extimeid"),
                                description = row.ReadNullableTrimmedString("extimename")
                            },
                            grouptype = row.IsNull("exgrouptypeid") ? null : new ExcursionReservationGroup
                            {
                                id = row.ReadInt("exgrouptypeid"),
                                description = row.ReadNullableTrimmedString("exgrouptypename")
                            },
                            language = row.IsNull("languageid") ? null : new ExcursionReservationLanguage
                            {
                                id = row.ReadInt("languageid"),
                                description = row.ReadNullableTrimmedString("languagename")
                            },
                            pickuppoint = row.IsNull("geopointfromid") ? null : new PickupPlace
                            {
                                id = row.ReadInt("geopointfromid"),
                                name = row.ReadNullableTrimmedString("geopointfromname")
                            },
                            pickuphotel = row.IsNull("fromhotelid") ? null : new PickupPlace
                            {
                                id = row.ReadInt("fromhotelid"),
                                name = row.ReadNullableTrimmedString("fromhotelname")
                            },

                            included = GetExcursionIncluded(row.ReadInt("excursid"), language),

                            pickup = GetExcursionPickup(row.ReadInt("excursid"), language, claimId, orderNote)
                        };
                    }
                    else
                    {
                        if (orderType == "transport")
                        {
                            result.freight = new FreightReservationOrder
                            {
                                id = row.ReadInt("freightid"),
                                name = row.ReadNullableTrimmedString("freightname"),
                                bookingclass = row.IsNull("classid") ? null : new FreightReservationBookingclass
                                {
                                    id = row.ReadInt("classid"),
                                    name = row.ReadNullableTrimmedString("classname")
                                },
                                place = row.IsNull("frplaceid") ? null : new FreightReservationPlace
                                {
                                    id = row.ReadInt("frplaceid"),
                                    name = row.ReadNullableTrimmedString("frplacename")
                                }
                            };
                        }
                        else
                        {
                            if (orderType == "transfer")
                            {
                                result.transfer = new TransferReservationOrder
                                {
                                    id = row.ReadInt("serviceid"),
                                    name = row.ReadNullableTrimmedString("servicename")
                                };
                            }
                            else
                            {
                                if (orderType == "service")
                                {
                                    result.service = new ServiceReservationOrder
                                    {
                                        id = row.ReadInt("serviceid"),
                                        name = row.ReadNullableTrimmedString("servicename"),
                                        servicetype = row.IsNull("servtypeid") ? null : new ServiceReservationServicetype
                                        {
                                            id = row.ReadInt("servtypeid"),
                                            name = row.ReadNullableTrimmedString("servtypename")
                                        }
                                    };
                                }
                            }
                        }
                    }
                }
                return result;
            }
コード例 #2
0
 public string ReservationOrderSorting(DataRow row)
 {
     System.DateTime datefrom = row.ReadUnspecifiedDateTime("datefrom");
     datefrom.ToString();
     string text = row.ReadString("type").ToLower();
     string result;
     if (text != null)
     {
         if (text == "hotel")
         {
             result = string.Format("A.{0:s}", datefrom);
             return result;
         }
         if (text == "transport")
         {
             result = string.Format("B.{0:s}", datefrom);
             return result;
         }
         if (text == "transfer")
         {
             result = string.Format("C.{0:s}", datefrom);
             return result;
         }
         if (text == "service")
         {
             result = string.Format("D.{0:s}", datefrom);
             return result;
         }
         if (text == "excursion")
         {
             result = string.Format("E.{0:s}", datefrom);
             return result;
         }
     }
     result = "Z";
     return result;
 }
コード例 #3
0
 public PaymentMode PaymentMode(DataRow row)
 {
     return new PaymentMode
     {
         id = row.ReadString("id"),
         name = row.ReadNullableTrimmedString("name"),
         processing = row.ReadNullableTrimmedString("processing"),
         comission = row.IsNull("comission") ? null : new ReservationOrderPrice
         {
             total = row.ReadDecimal("comission"),
             currency = row.ReadNullableTrimmedString("currency")
         },
         payrest = row.IsNull("payrest") ? null : new ReservationOrderPrice
         {
             total = row.ReadDecimal("payrest"),
             currency = row.ReadNullableTrimmedString("currency")
         },
         paymentparam = row.ReadNullableTrimmedString("params")
     };
 }