private void btnSearch_Click(object sender, EventArgs e) { deptStockOutList.Clear(); StockOutConfirmEventArgs eventArgs = new StockOutConfirmEventArgs(); eventArgs.ReportDateStockOutParam = new ReportDateStockOutParam { FromDate = DateUtility.ZeroTime(dtpFrom.Value), ToDate = DateUtility.MaxTime(dtpTo.Value) }; EventUtility.fireEvent(LoadStockOutsEvent, this, eventArgs); if (eventArgs.ResultStockOutList != null) { foreach (IList result in eventArgs.ResultStockOutList) { StockOutView stockOutView = new StockOutView(); stockOutView.StockOut = (StockOut)result[0]; stockOutView.TotalQuantity = (long)result[1]; stockOutView.Department = (Department)result[3]; if (stockOutView.Department != null) { stockOutView.DepartmentName = stockOutView.Department.DepartmentName; } else { stockOutView.DepartmentName = " Kho chính"; } stockOutView.CreateDate = stockOutView.StockOut.CreateDate; deptStockOutList.Add(stockOutView); } } else { MessageBox.Show(" Không có hoá đơn xuất kho nào cần xác nhận."); } bdsDeptStockOut.EndEdit(); dgvStockOutDetail.Refresh(); dgvStockOutDetail.Invalidate(); //CreateCountOnList(); }
private void btnSearch_Click(object sender, EventArgs e) { stockOutList.Clear(); ReportStockOutEventArgs eventArgs = new ReportStockOutEventArgs(); eventArgs.ReportDateStockOutParam = new ReportDateStockOutParam { FromDate = DateUtility.ZeroTime(dtpFrom.Value), ToDate = DateUtility.MaxTime(dtpTo.Value) }; EventUtility.fireEvent(LoadStockOutsEvent,this,eventArgs); if(eventArgs.ResultStockOutList!=null) { foreach (IList result in eventArgs.ResultStockOutList) { StockOutView stockOutView = new StockOutView(); stockOutView.StockOut = (StockOut)result[0]; stockOutView.TotalQuantity = (long) result[1]; stockOutView.Department = (Department) result[3]; if (stockOutView.Department != null) { stockOutView.DepartmentName = stockOutView.DepartmentName; } else { stockOutView.DepartmentName = " Kho chinh"; } stockOutView.CreateDate = stockOutView.StockOut.CreateDate; bdsStockOut.Add(stockOutView); } } bdsStockOut.EndEdit(); dgvStock.Refresh(); dgvStock.Invalidate(); CreateCountOnList(); }