private void button1_Click(object sender, EventArgs e) { ReportStockInParam reportStockInParam = new ReportStockInParam(); reportStockInParam.FromDate = dtpReportTimeFrom.Value; reportStockInParam.ToDate = dtpReportTimeTo.Value; ReportStockInEventArgs eventArgs = new ReportStockInEventArgs(); eventArgs.ReportStockInParam = reportStockInParam; EventUtility.fireEvent(CreateReportStockIn,this,eventArgs); Close(); }
private void ok_Click(object sender, EventArgs e) { pSODetResultList.Clear(); ReportStockInEventArgs eventArgs = new ReportStockInEventArgs(); ReportStockInParam stockInParam = new ReportStockInParam(); stockInParam.FromDate = DateUtility.ZeroTime(dtpFrom.Value); stockInParam.ToDate = DateUtility.MaxTime(dtpTo.Value); eventArgs.ReportStockInParam = stockInParam; EventUtility.fireEvent(LoadStockInByRangeEvent,this,eventArgs); // get result resultList = eventArgs.ResultStockInList; IList stockDetailByPMList = eventArgs.ProductMastersInList; if(stockDetailByPMList.Count == 0) { MessageBox.Show("Không tìm thấy hàng nào","Kết quả"); } foreach (var o in stockDetailByPMList) { IList stockDetailByPM = (IList) o; ProductMasterGlobal productMasterGlobal = new ProductMasterGlobal(); productMasterGlobal.ProductName = ((ProductMaster) stockDetailByPM[0]).ProductName; productMasterGlobal.ProductMaster = (ProductMaster)stockDetailByPM[0]; StockInResultDetail stockInResultDetail = new StockInResultDetail(); stockInResultDetail.ProductMasterGlobal = productMasterGlobal; stockInResultDetail.StockInQuantities = (long)stockDetailByPM[1]; stockInResultDetail.StockInTotalAmounts = (long) stockDetailByPM[2]; pSODetResultList.Add(stockInResultDetail); } bdsStockInResultPM.EndEdit(); PopulateGrid(); }