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


C# DataRow.ReadUnspecifiedDateTime方法代码示例

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


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

示例1: 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

示例2: 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

示例3: FillFreightInfo

 public void FillFreightInfo(FreightReservationOrder freight, DataRow row)
 {
     if (row != null)
     {
         System.TimeSpan? freightDepartureTime = row.ReadNullableUnspecifiedTime("stime");
         FreightPoint freightPoint = new FreightPoint();
         FreightPoint arg_5C_0 = freightPoint;
         System.DateTime dateTime = row.ReadUnspecifiedDateTime("sdate");
         dateTime = dateTime.Date;
         arg_5C_0.date = dateTime.Add(freightDepartureTime ?? System.TimeSpan.FromTicks(0L));
         freightPoint.port = new Airport
         {
             id = row.ReadInt("sport$inc"),
             alias = row.ReadNullableTrimmedString("sport$alias"),
             name = row.ReadNullableTrimmedString("sport$name"),
             town = new Town
             {
                 id = row.ReadInt("stown$inc"),
                 name = row.ReadNullableString("stown$name")
             }
         };
         freight.departure = freightPoint;
         System.TimeSpan? freightArrivalTime = row.ReadNullableUnspecifiedTime("dtime");
         FreightPoint freightPoint2 = new FreightPoint();
         FreightPoint arg_147_0 = freightPoint2;
         dateTime = freight.departure.date;
         dateTime = dateTime.Date;
         dateTime = dateTime.AddDays((double)row.ReadInt("daysinway"));
         arg_147_0.date = dateTime.Add(freightArrivalTime ?? System.TimeSpan.FromTicks(0L));
         freightPoint2.port = new Airport
         {
             id = row.ReadInt("dport$inc"),
             alias = row.ReadNullableTrimmedString("dport$alias"),
             name = row.ReadNullableTrimmedString("dport$name"),
             town = new Town
             {
                 id = row.ReadInt("dtown$inc"),
                 name = row.ReadNullableString("dtown$name")
             }
         };
         freight.arrival = freightPoint2;
     }
 }
开发者ID:alex-prokopenya,项目名称:GuestService_partner,代码行数:43,代码来源:BookingProvider.cs

示例4: ExcursionOrderCalculatePrice

 public ExcursionOrderCalculatePrice ExcursionOrderCalculatePrice(DataRow row)
 {
     return new ExcursionOrderCalculatePrice
     {
         id = row.ReadInt("excursion$inc"),
         name = row.ReadNullableTrimmedString("excursion$name"),
         date = row.ReadUnspecifiedDateTime("date"),
         time = row.IsNull("time$inc") ? null : new ExcursionTime
         {
             id = row.ReadInt("time$inc"),
             name = row.ReadNullableTrimmedString("time$name")
         },
         language = row.IsNull("lang$inc") ? null : new Language
         {
             id = row.ReadInt("lang$inc"),
             name = row.ReadNullableTrimmedString("lang$name"),
             alias = row.ReadNullableTrimmedString("lang$alias")
         },
         group = row.IsNull("group$inc") ? null : new ExcursionGroup
         {
             id = row.ReadInt("group$inc"),
             name = row.ReadNullableTrimmedString("group$name")
         },
         departure = row.IsNull("departure$inc") ? null : new GeoArea
         {
             id = row.ReadInt("departure$inc"),
             name = row.ReadNullableTrimmedString("departure$name"),
             alias = row.ReadNullableTrimmedString("departure$alias")
         },
         pax = new BookingPax
         {
             adult = row.ReadInt("adult", 0),
             child = row.ReadInt("child", 0),
             infant = row.ReadInt("infant", 0)
         },
         contact = new ExcursionContact
         {
             name = row.ReadNullableTrimmedString("contact$name")
         },
         note = row.ReadNullableTrimmedString("note"),
         price = row.IsNull("price") ? null : new OrderPrice
         {
             price = row.ReadDecimal("price"),
             currency = row.ReadNullableTrimmedString("currency$alias")
         },
         closesaletime = row.ReadNullableUnspecifiedDateTime("closesaletime"),
         issaleclosed = row.ReadBoolean("isclosed"),
         isstopsale = row.ReadBoolean("isstopsale")
     };
 }
开发者ID:alex-prokopenya,项目名称:GuestService_partner,代码行数:50,代码来源:BookingProvider.cs

示例5: ExcursionTransfer

 internal ExcursionTransfer ExcursionTransfer(DataRow row)
 {
     return new ExcursionTransfer
     {
         claim = row.ReadNullableInt("claim"),
         order = row.ReadNullableInt("order"),
         exsale = row.ReadNullableInt("exsale"),
         voucher = row.ReadNullableTrimmedString("voucher"),
         excursion = row.ReadNullableTrimmedString("excurs$name"),
         excursiontime = row.ReadNullableTrimmedString("excurs$time"),
         transferident = row.ReadNullableTrimmedString("transfer$ident"),
         transfernote = row.ReadNullableTrimmedString("transfer$note"),
         date = row.ReadUnspecifiedDateTime("date"),
         pickup = (!row.IsNull("picktime")) ? new System.DateTime?(row.ReadUnspecifiedDateTime("date").Date.Add(row.ReadUnspecifiedTime("picktime"))) : null,
         pickupplace = row.ReadNullableTrimmedString("pickup$name"),
         guide = (!row.IsNull("guide$name")) ? new DepartureWorker
         {
             name = row.ReadNullableTrimmedString("guide$name"),
             phone = row.ReadNullableTrimmedString("guide$mobile")
         } : null,
         guide2 = (!row.IsNull("guide2$name")) ? new DepartureWorker
         {
             name = row.ReadNullableTrimmedString("guide2$name"),
             phone = row.ReadNullableTrimmedString("guide2$mobile")
         } : null
     };
 }
开发者ID:alex-prokopenya,项目名称:GuestService_design,代码行数:27,代码来源:GuestProvider.cs

示例6: DepartureTransfer

 internal DepartureTransfer DepartureTransfer(bool useNameField, DataRow row)
 {
     return new DepartureTransfer
     {
         id = row.ReadInt("transfer$inc"),
         ident = row.ReadNullableTrimmedString("transfer$ident"),
         date = row.ReadUnspecifiedDateTime("transfer$tdate"),
         pickup = (row.IsNull("transfer$pickdate") || row.IsNull("transfer$picktime")) ? null : new System.DateTime?(row.ReadUnspecifiedDateTime("transfer$pickdate").Date.Add(row.ReadUnspecifiedDateTime("transfer$picktime").TimeOfDay)),
         flight = (!(row.ReadNullableInt("transfer$freight") > 0)) ? null : new DepartureFlight
         {
             id = row.ReadInt("transfer$freight"),
             name = row.ReadNullableTrimmedString(useNameField ? "f$name" : "f$lname"),
             source = (!(row.ReadNullableInt("f$srcport") > 0)) ? null : new Airport
             {
                 id = row.ReadInt("f$srcport"),
                 alias = row.ReadNullableTrimmedString("port1$alias"),
                 name = row.ReadNullableTrimmedString(useNameField ? "port1$name" : "port1$lname"),
                 town = (!(row.ReadNullableInt("st$inc") > 0)) ? null : new Town
                 {
                     id = row.ReadInt("st$inc"),
                     name = row.ReadNullableTrimmedString("st$name")
                 }
             },
             target = (!(row.ReadNullableInt("f$trgport") > 0)) ? null : new Airport
             {
                 id = row.ReadInt("f$trgport"),
                 alias = row.ReadNullableTrimmedString("port2$alias"),
                 name = row.ReadNullableTrimmedString(useNameField ? "port2$name" : "port2$lname"),
                 town = (!(row.ReadNullableInt("tt$inc") > 0)) ? null : new Town
                 {
                     id = row.ReadInt("tt$inc"),
                     name = row.ReadNullableTrimmedString(useNameField ? "tt$name" : "tt$lname")
                 }
             },
             takeoff = (row.IsNull("transfer$fdate") || row.IsNull("f$srctime")) ? null : new System.DateTime?(row.ReadUnspecifiedDateTime("transfer$fdate").Date.Add(row.ReadUnspecifiedDateTime("f$srctime").TimeOfDay)),
             landingtime = row.IsNull("f$trgtime") ? null : new System.TimeSpan?(row.ReadUnspecifiedDateTime("f$trgtime").TimeOfDay)
         },
         hotel = (!(row.ReadNullableInt("transfer$hoteldest") > 0)) ? null : new DepartureDestinationHotel
         {
             id = row.ReadInt("transfer$hoteldest"),
             name = row.ReadNullableTrimmedString(useNameField ? "h2$name" : "h2$lname"),
             town = (!(row.ReadNullableInt("t2$inc") > 0)) ? null : new Town
             {
                 id = row.ReadInt("t2$inc"),
                 name = row.ReadNullableTrimmedString(useNameField ? "t2$name" : "t2$lname")
             },
             region = (!(row.ReadNullableInt("r2$inc") > 0)) ? null : new Region
             {
                 id = row.ReadInt("r2$inc"),
                 name = row.ReadNullableTrimmedString(useNameField ? "r2$name" : "r2$lname")
             }
         },
         note = row.ReadNullableTrimmedString("transfer$infonote"),
         language = row.ReadNullableTrimmedString("language$alias"),
         indiviadual = row.ReadNullableTrimmedString("transfer$indmark") == "IND",
         servicename = row.ReadNullableTrimmedString(useNameField ? "s$name" : "s$lname"),
         guide = (!(row.ReadNullableInt("transfer$guide") > 0)) ? null : new DepartureWorker
         {
             name = row.ReadNullableTrimmedString(useNameField ? "guide$name" : "guide$lname"),
             phone = row.ReadNullableTrimmedString("guide$mobile")
         },
         guide2 = (!(row.ReadNullableInt("transfer$guide2") > 0)) ? null : new DepartureWorker
         {
             name = row.ReadNullableTrimmedString(useNameField ? "guide2$name" : "guide2$lname"),
             phone = row.ReadNullableTrimmedString("guide2$mobile")
         }
     };
 }
开发者ID:alex-prokopenya,项目名称:GuestService_design,代码行数:68,代码来源:GuestProvider.cs


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