maily89 / fbdm

Automatically exported from code.google.com/p/fbdm
0 stars 0 forks source link

[RNK-INV] CustomerIndividualRanking.SelectRankingByDateAndCustomer #161

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
"Khi mà chọn khách hàng để chấm điểm tại step ""Choose 
Customer"". Khi chọn một số ngày để chấm mới thì có ngày 
không bị lỗi, có ngày thì hiện ra thông báo lỗi không cho chọn.
Nguyên nhân:
Trong hàm SelectRankingByDateAndCustomer thì không catch Exception vào. 
Bởi vì hàm First() nếu không chọn được mapped value thì luôn 
tung ra Exception (CẦN CHECK LẠI OÀN BỘ MODULE CÓ DÙNG HÀM FIRST MÀ 
CHƯA CATCH THÀNH NULL).
var result = entities.CustomersIndividualRanking
                        .Include(""CustomersIndividual"")
                        .Include(""Date"")
                        .Where(i => i.CustomersIndividuals.IndividualID == customerID && i.Date.Value <= date)
                        .Any();
            if (result)
            {
                return  entities.CustomersIndividualRanking
                        .Include(""CustomersIndividual"")
                        .Include(""Date"")
                        .First(i => i.CustomersIndividuals.IndividualID == customerID && i.Date.Value == date);
            }
Trong câu lệnh trên thì tại sao phần điều kiện Where lại có 
Date.Value <= date (Có phải là == không và viết nhầm?)"

Original issue reported on code.google.com by longnhi....@gmail.com on 18 Apr 2011 at 7:24

GoogleCodeExporter commented 9 years ago
fixed. Mot so ham dung trong phan report cung su dung cau lenh .First chua 
catch.

Original comment by maily...@gmail.com on 18 Apr 2011 at 8:06

GoogleCodeExporter commented 9 years ago

Original comment by maily...@gmail.com on 18 Apr 2011 at 4:34