public DTO.ReportStockList.StockListDetail GetStockListDetail(string keyID, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.ReportStockList.StockListDetail data = new DTO.ReportStockList.StockListDetail(); try { using (ReportStockListEntities context = CreateContext()) { data.SaleOrderDetails = converter.DB2DTO_SaleOrderDetail(context.ReportMng_StockList_SaleOrderDetail_View.Where(o => o.KeyID == keyID).ToList()); data.WarehouseImportDetails = converter.DB2DTO_WarehouseImportDetail(context.ReportMng_StockList_WarehouseImportDetail_View.Where(o => o.KeyID == keyID).ToList()); data.WarehousePickingListDetails = converter.DB2DTO_WarehousePickingListDetail(context.ReportMng_StockList_WarehousePickingListDetail_View.Where(o => o.KeyID == keyID).ToList()); data.LoadingPlanDetails = converter.DB2DTO_LoadingPlanDetail(context.ReportMng_StockList_LoadingPlanDetail_View.Where(o => o.KeyID == keyID).ToList()); } return(data); } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; notification.DetailMessage.Add(ex.Message); if (ex.GetBaseException() != null) { notification.DetailMessage.Add(ex.GetBaseException().Message); } return(new DTO.ReportStockList.StockListDetail()); } }
public IHttpActionResult GetStockListDetail(string keyID) { Library.DTO.Notification notification; BLL.ReportStockList bll = new BLL.ReportStockList(); DTO.ReportStockList.StockListDetail data = bll.GetStockListDetail(keyID, out notification); return(Ok(new Library.DTO.ReturnData <DTO.ReportStockList.StockListDetail>() { Data = data, Message = notification })); }