티스토리 뷰
728x90
반응형
group by
// group by
var purchaseOrders = from row in lorealPurchaseOrderDataTable.AsEnumerable()
group row by row.Field<long>("lpo_seq_no") into grp
select new
{
lpo_seq_no = grp.Max(r => r.Field<long>("lpo_seq_no")),
purchase_order_title = grp.Max(r => r.Field<string>("purchase_order_title")),
reg_dt = grp.Max(r => r.Field<DateTime>("reg_dt"))
};
foreach (var purchaseOrder in purchaseOrders)
{
lorealPurchaseOrders.Add(new LorealPurchaseOrder() {
LpoSeqNo = purchaseOrder.lpo_seq_no,
PurchaseOrderTitle = purchaseOrder.purchase_order_title,
RegDate = string.Format("{0}", purchaseOrder.reg_dt)
});
}
Where
// Where
var purchaseOrderSkus = from row in lorealPurchaseOrderDataTable.AsEnumerable()
where row.Field<long>("lpo_seq_no") == lorealPurchaseOrder.LpoSeqNo
select new
{
lpos_seq_no = row.Field<long>("lpos_seq_no"),
lps_seq_no = row.Field<long>("lps_seq_no"),
sku_no = row.Field<string>("sku_no"),
sku_name = row.Field<string>("sku_name"),
sku_option_name = row.Field<string>("sku_option_name"),
vendor_item_code = row.Field<string>("vendor_item_code"),
supply_price = row.Field<decimal>("supply_price"),
vat_price = row.Field<decimal>("vat_price"),
total_price = row.Field<decimal>("total_price"),
};
List<LorealPurchaseOrderSku> lorealPurchaseOrderSku = new List<LorealPurchaseOrderSku>();
foreach (var purchaseOrderSku in purchaseOrderSkus)
{
lorealPurchaseOrderSku.Add(new LorealPurchaseOrderSku() {
LposSeqNo = purchaseOrderSku.lpos_seq_no,
LpsSeqNo = purchaseOrderSku.lps_seq_no,
SkuNo = purchaseOrderSku.sku_no,
SkuName = purchaseOrderSku.sku_name,
SkuOptionName = purchaseOrderSku.sku_option_name,
VendorItemCode = purchaseOrderSku.vendor_item_code,
SupplyPrice = purchaseOrderSku.supply_price,
VatPrice = purchaseOrderSku.vat_price,
TotalPrice = purchaseOrderSku.total_price
});
}
728x90
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- .submit()
- REST API
- java web-mvc
- 스프링 프레임워크(spring framewordk)
- java-개발 환경 설정하기
- 스프링 시큐리티(spring security)-http basic 인증
- await
- 스프링 시큐리티(spring security)
- 메이븐(maven)
- 진수 변환
- jstl(java standard tag library)-core
- 표현 언어(expression language)
- React
- java.sql
- jsp 오픈 소스
- 제품 등록
- MainActor
- 상품 등록
- 인텔리제이(intellij)
- error-java
- 특정 문자를 기준으로 자르기
- 스프링 프레임워크(spring framework)
- 람다식(lambda expression)
- In App Purchase
- System.Diagnostics
- system.io
- java 키워드 정리
- nl2br
- jstl(java standard tag library)
- 문자 자르기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함