protected void StockGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { long recordCount = 0; IList <StorageRecordInfo> list = new List <StorageRecordInfo>(); if (IsPostBack) { //获取授权仓库列表 var warehouseList = CurrentSession.Personnel.WarehouseList; if (warehouseList.Count == 0) { RAM.Alert("没有授权的仓库,无法查询。"); } else { var startPage = StockGrid.CurrentPageIndex + 1; int pageSize = StockGrid.PageSize; List <StorageRecordType> storageRecordTypes = new List <StorageRecordType>(); if (SStockType != default(Int32)) { storageRecordTypes.Add((StorageRecordType)SStockType); } List <StorageRecordState> storageRecordStates = new List <StorageRecordState> { StorageRecordState.Finished }; list = _storageRecordDao.GetStorageRecordListToPages(WarehouseId, CompanyId, TB_GoodsName.Text.Trim(), OrderNof.Trim(), storageRecordTypes, storageRecordStates, default(Int32), default(Guid), StartTime, EndTime, 0, GlobalConfig.KeepYear, startPage, pageSize, out recordCount); } } StockGrid.DataSource = list; StockGrid.VirtualItemCount = (int)recordCount; }
protected void StockGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { IList <StorageRecordInfo> storageRecordList = new List <StorageRecordInfo>(); long recordCount = 0; var startPage = RG_StorageRecord.CurrentPageIndex + 1; int pageSize = RG_StorageRecord.PageSize; var warehouseId = new Guid(DDL_Waerhouse.SelectedValue); var storageType = string.IsNullOrEmpty(DDL_StorageAuth.SelectedValue) ? default(Int32) : int.Parse(DDL_StorageAuth.SelectedValue); var hostingFilialeId = string.IsNullOrEmpty(DDL_HostingFilialeAuth.SelectedValue) ? Guid.Empty : new Guid(DDL_HostingFilialeAuth.SelectedValue); var purchaseFilialeId = string.IsNullOrEmpty(DDL_PurchaseFiliale.SelectedValue) ? Guid.Empty : new Guid(DDL_PurchaseFiliale.SelectedValue); DateTime startTime = RDP_StartTime.SelectedDate ?? DateTime.MinValue; DateTime endTime = RDP_EndTime.SelectedDate ?? DateTime.Now; int mode = string.IsNullOrEmpty(DDL_Purchase.SelectedValue) ? 0 : Convert.ToInt32(DDL_Purchase.SelectedValue); var storageRecordTypes = new List <StorageRecordType>(); var storageRecordStates = new List <StorageRecordState>(); if (!string.IsNullOrEmpty(DDL_StorageType.SelectedValue)) { storageRecordTypes.Add((StorageRecordType)Convert.ToInt32(DDL_StorageType.SelectedValue)); } else { storageRecordTypes.Add(StorageRecordType.BorrowIn); storageRecordTypes.Add(StorageRecordType.SellReturnIn); storageRecordTypes.Add(StorageRecordType.BuyStockIn); storageRecordTypes.Add(StorageRecordType.LendIn); } if (!string.IsNullOrEmpty(DD_StorageState.SelectedValue)) { storageRecordStates.Add((StorageRecordState)Convert.ToInt32(DD_StorageState.SelectedValue)); } else { storageRecordStates.Add(StorageRecordState.WaitAudit); storageRecordStates.Add(StorageRecordState.Refuse); storageRecordStates.Add(StorageRecordState.Approved); storageRecordStates.Add(StorageRecordState.Finished); storageRecordStates.Add(StorageRecordState.Canceled); } if (warehouseId != Guid.Empty) { storageRecordList = _storageRecordDao.GetStorageRecordListToPages(warehouseId, purchaseFilialeId, String.Empty, RTB_No.Text, storageRecordTypes, storageRecordStates, storageType, hostingFilialeId, startTime, endTime, mode, GlobalConfig.KeepYear, startPage, pageSize, out recordCount); } if (!string.IsNullOrEmpty(DDL_SaleFiliale.SelectedValue) && DDL_SaleFiliale.SelectedValue != Guid.Empty.ToString()) { storageRecordList = storageRecordList.Where(p => p.ThirdCompanyID == new Guid(DDL_SaleFiliale.SelectedValue)).ToList(); } //SourceNos = warehouseId != Guid.Empty ? WMSSao.GetBillNosBySourceNos(warehouseId, storageRecordList.Select(act => act.TradeCode), true) : new Dictionary<string, string>(); RG_StorageRecord.DataSource = storageRecordList; RG_StorageRecord.VirtualItemCount = (int)recordCount; }
protected void StockGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { IList <StorageRecordInfo> storageRecordList = new List <StorageRecordInfo>(); long recordCount = 0; var startPage = RG_StorageRecord.CurrentPageIndex + 1; int pageSize = RG_StorageRecord.PageSize; var warehouseId = new Guid(DDL_Waerhouse.SelectedValue); var storageType = string.IsNullOrEmpty(DDL_StorageAuth.SelectedValue) ? default(Int32) : int.Parse(DDL_StorageAuth.SelectedValue); var hostingFilialeId = string.IsNullOrEmpty(DDL_HostingFilialeAuth.SelectedValue) ? Guid.Empty : new Guid(DDL_HostingFilialeAuth.SelectedValue); var thirdCompanyId = string.IsNullOrEmpty(RcbThirdCompany.SelectedValue) ? Guid.Empty : new Guid(RcbThirdCompany.SelectedValue); var shopId = string.IsNullOrEmpty(DDL_SaleFiliale.SelectedValue) ? Guid.Empty : new Guid(DDL_SaleFiliale.SelectedValue); DateTime startTime = RDP_StartTime.SelectedDate ?? DateTime.MinValue; DateTime endTime = RDP_EndTime.SelectedDate ?? DateTime.Now; var storageRecordTypes = new List <StorageRecordType>(); var storageRecordStates = new List <StorageRecordState>(); if (!string.IsNullOrEmpty(DDL_StorageType.SelectedValue)) { storageRecordTypes.Add((StorageRecordType)Convert.ToInt32(DDL_StorageType.SelectedValue)); } else { storageRecordTypes.Add(StorageRecordType.LendOut); storageRecordTypes.Add(StorageRecordType.AfterSaleOut); storageRecordTypes.Add(StorageRecordType.BuyStockOut); storageRecordTypes.Add(StorageRecordType.SellStockOut); storageRecordTypes.Add(StorageRecordType.BorrowOut); storageRecordTypes.Add(StorageRecordType.InnerPurchase); } if (!string.IsNullOrEmpty(DD_StorageState.SelectedValue)) { storageRecordStates.Add((StorageRecordState)Convert.ToInt32(DD_StorageState.SelectedValue)); } else { storageRecordStates.Add(StorageRecordState.WaitAudit); storageRecordStates.Add(StorageRecordState.Refuse); storageRecordStates.Add(StorageRecordState.Approved); storageRecordStates.Add(StorageRecordState.Finished); storageRecordStates.Add(StorageRecordState.Canceled); } if (warehouseId != Guid.Empty) { storageRecordList = _storageRecordDao.GetStorageRecordListToPages(warehouseId, shopId != Guid.Empty?shopId:thirdCompanyId, String.Empty, RTB_No.Text, storageRecordTypes, storageRecordStates, storageType, hostingFilialeId, startTime, endTime, 0, GlobalConfig.KeepYear, startPage, pageSize, out recordCount); } RG_StorageRecord.DataSource = storageRecordList; RG_StorageRecord.VirtualItemCount = (int)recordCount; }