本文整理汇总了C#中System.Data.DataRow.ReadDecimal方法的典型用法代码示例。如果您正苦于以下问题:C# DataRow.ReadDecimal方法的具体用法?C# DataRow.ReadDecimal怎么用?C# DataRow.ReadDecimal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.DataRow
的用法示例。
在下文中一共展示了DataRow.ReadDecimal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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")
},
//.........这里部分代码省略.........
示例2: 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")
};
}
示例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")
};
}
示例4: ReservationState
public ReservationState ReservationState(DataRow row)
{
return new ReservationState
{
claimId = row.ReadNullableInt("claim_id"),
status = row.IsNull("status_id") ? null : new ReservationStatus
{
id = row.ReadInt("status_id"),
description = row.ReadNullableTrimmedString("status_name")
},
partner = row.IsNull("partner_id") ? null : new ReservationPartner
{
id = row.ReadInt("partner_id"),
name = row.ReadNullableTrimmedString("partner_name")
},
confirmation = row.IsNull("confirm_id") ? null : new ReservationConfirmStatus
{
id = row.ReadInt("confirm_id"),
description = row.ReadNullableTrimmedString("confirm_name")
},
price = (row.IsNull("payprice") || row.IsNull("payrest") || row.IsNull("paycurrency")) ? null : new ReservationPrice
{
total = row.ReadDecimal("payprice"),
topay = row.ReadDecimal("payrest"),
currency = row.ReadNullableTrimmedString("paycurrency")
},
action = new ReservationAction
{
canshowprice = row.ReadBoolean("showprice", false),
canprintvoucher = row.ReadBoolean("printvoucher", false),
canpay = row.ReadBoolean("canpay", false)
},
timelimit = GetClaimTimelimit(row.ReadNullableInt("claim_id"))
};
}