public void departmentStockInSearchView_SearchMainStockInEvent(object sender, MainStockInSearchEventArgs e) { var criteria = new ObjectCriteria(); criteria.AddGreaterOrEqualsCriteria("StockInDate", e.StockInDateFrom); criteria.AddLesserOrEqualsCriteria("StockInDate", e.StockInDateTo); criteria.AddLikeCriteria("StockInId", e.StockInId + "%"); criteria.AddEqCriteria("DelFlg", (long)0); e.StockInList = StockInLogic.FindAll(criteria); }
void _stockInSearchController_CompletedMainStockInSearchEvent(object sender, MainStockInSearchEventArgs e) { Enabled = true; StockInList = e.StockInList; if(StockInList!= null) PopulateDataGrid(); }
private void ViewStockInDetail(int rowIndex) { if (rowIndex >= 0 && rowIndex < dgvProduct.RowCount) { string stockInId = dgvProduct[STOCK_IN_ID_POS, rowIndex].Value.ToString(); StockIn selected = null; btnSelect.Enabled = false; var eventArgs = new MainStockInSearchEventArgs { StockInId = stockInId }; EventUtility.fireEvent(SearchSingleStockInEvent, this, eventArgs); selected = eventArgs.StockIn; if (selected != null) { ArrayList details = new ArrayList(); foreach (StockInDetail stockInDetail in selected.StockInDetails) { details.Add(stockInDetail); } selected.StockInDetails = SortDetail(details); var departmentStockIn = GlobalUtility.GetFormObject<MainStockInForm>(FormConstants.MAIN_STOCK_IN_FORM); departmentStockIn.deptSI = selected; departmentStockIn.ShowDialog(); // refresh list DateTime StockInDateFrom = chkImportDateFrom.Checked ? DateUtility.ZeroTime(dtpImportDateFrom.Value) : DateUtility.ZeroTime(DateTime.Now.Subtract(new TimeSpan(3, 0, 0))); DateTime StockInDateTo = chkImportDateTo.Checked ? DateUtility.MaxTime(dtpImportDateTo.Value) : DateUtility.MaxTime(DateTime.Now); stock_inTableAdapter.Fill(masterDB.stock_in, StockInDateFrom, StockInDateTo); stockinBindingSource.ResetBindings(false); dgvProduct.Refresh(); dgvProduct.Invalidate(); } btnSelect.Enabled = true; } }
void _stockInSearchView_SearchSingleStockInEvent(object sender, MainStockInSearchEventArgs e) { e.StockIn = StockInLogic.FindById(e.StockInId); }
private void btnSearch_Click(object sender, EventArgs e) { var eventArgs = new MainStockInSearchEventArgs { StockInId = txtBlockInDetailId.Text, StockInDateFrom = chkImportDateFrom.Checked ? DateUtility.ZeroTime(dtpImportDateFrom.Value) : DateTime.MinValue, StockInDateTo = chkImportDateTo.Checked ? DateUtility.MaxTime(dtpImportDateTo.Value) : DateTime.MaxValue }; EventUtility.fireEvent(SearchStockInEvent, this, eventArgs); CurrentEventArgs = eventArgs; StockInList = eventArgs.StockInList; if(StockInList!= null) PopulateDataGrid(); }
private void btnSearch_Click(object sender, EventArgs e) { stockInDetList.Clear(); var eventArgs = new MainStockInSearchEventArgs { StockInId = txtBlockInDetailId.Text, StockInDateFrom = chkImportDateFrom.Checked ? DateUtility.ZeroTime(dtpImportDateFrom.Value) : DateTime.MinValue, StockInDateTo = chkImportDateTo.Checked ? DateUtility.MaxTime(dtpImportDateTo.Value) : DateTime.MaxValue }; EventUtility.fireEvent(SearchStockInEvent, this, eventArgs); CurrentEventArgs = eventArgs; StockInList = eventArgs.StockInList; foreach (StockIn stockIn in StockInList) { foreach (StockInDetail detail in stockIn.StockInDetails) { stockInDetList.Add(detail); } } bdsStockIn.EndEdit(); dgvProduct.Refresh(); dgvProduct.Invalidate(); }