当前位置: 首页>>代码示例>>C#>>正文


C# DataRow.ReadString方法代码示例

本文整理汇总了C#中System.Data.DataRow.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# DataRow.ReadString方法的具体用法?C# DataRow.ReadString怎么用?C# DataRow.ReadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.DataRow的用法示例。


在下文中一共展示了DataRow.ReadString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReservationOrder

            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")
                            },
//.........这里部分代码省略.........
开发者ID:alex-prokopenya,项目名称:GuestService_partner,代码行数:101,代码来源:BookingProvider.cs

示例2: ReservationOrderSorting

 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;
 }
开发者ID:alex-prokopenya,项目名称:GuestService_partner,代码行数:37,代码来源:BookingProvider.cs

示例3: PaymentMode

 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")
     };
 }
开发者ID:alex-prokopenya,项目名称:GuestService_partner,代码行数:20,代码来源:BookingProvider.cs


注:本文中的System.Data.DataRow.ReadString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。