private void SearchAllocation(DateTime start) { int rowHandle = gvAllocation.FocusedRowHandle; List <Alading.Entity.StockInOut> stockInOutList = StockInOutService.GetStockInOut(i => i.InOutType == (int)InOutType.AllocateIn); gridAllocation.DataSource = stockInOutList.Where(i => i.InOutTime >= start).ToList(); if (rowHandle == 0 && gvAllocation.FocusedRowHandle > -1) { FocusedRowChange(); } }
/// <summary> /// 初始化、刷新 /// </summary> private void Init() { int rowHandle = gvAllocation.FocusedRowHandle; List <Alading.Entity.StockInOut> stockInOutList = StockInOutService.GetStockInOut(i => i.InOutType == (int)InOutType.AllocateIn); gridAllocation.DataSource = stockInOutList; if (rowHandle == 0 && gvAllocation.FocusedRowHandle > -1) { FocusedRowChange(); } //gvAllocation.FocusedRowChanged += gvAllocation_FocusedRowChanged; //} }
public bool ExistInOutCode(string inOutCode) { Alading.Entity.StockInOut stockInOut = StockInOutService.GetStockInOut(inOutCode); if (stockInOut != null) { //存在 return(true); } else { return(false); } }
/// <summary> /// 搜索 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void simpleBtnSearch_Click(object sender, EventArgs e) { int rowHandle = gvAllocation.FocusedRowHandle; if (textKeyWord.Text == string.Empty) { XtraMessageBox.Show("请输入关键词", Constants.SYSTEM_PROMPT); return; } List <Alading.Entity.StockInOut> stockInOutList = StockInOutService.GetStockInOut(i => i.InOutType == (int)InOutType.AllocateIn); gridAllocation.DataSource = stockInOutList.Where(i => i.InOutCode.Contains(textKeyWord.Text) || i.InOutTime.ToString().Contains(textKeyWord.Text) || i.OperatorName.Contains(textKeyWord.Text)).ToList(); if (rowHandle == 0 && gvAllocation.FocusedRowHandle > -1) { FocusedRowChange(); } }