/// <summary> /// 绑定plenishOrderSource源到dataGridView中 /// </summary> /// <param name="listPage"></param> private void BindingReturnOrderSource(ReturnOrderPage listPage) { // this.dataGridViewPagingSumCtrl.SetDataSource<PurchaseOrder>(null); if (listPage != null && listPage.ReturnOrderList != null && listPage.ReturnOrderList.Count > 0) { List <PurchaseOrder> details = listPage.ReturnOrderList; foreach (var item in details) { if (item.AdminUserID != null) { try { item.UserName = GlobalCache.GetUserName(item.AdminUserID); } catch (Exception ex) { item.UserName = ""; } } if (item.SupplierID != null) { item.SupplierName = GlobalCache.GetSupplierName(item.SupplierID); } item.DestShopName = GlobalCache.GetShopName(item.DestShopID); } } this.dataGridViewPagingSumCtrl.BindingDataSource(listPage?.ReturnOrderList, null, listPage?.TotalEntityCount, listPage?.ReturnOrderSum); this.skinSplitContainer1.Panel2Collapsed = true; }
private void dataGridViewPagingSumCtrl_CurrentPageIndexChanged(int index) { try { if (this.pagePara == null) { return; } pagePara.PageIndex = index; ReturnOrderPage listPage = GlobalCache.ServerProxy.GetReturnOrderPage(this.pagePara); this.BindingReturnOrderSource(listPage); } catch (Exception ee) { GlobalUtil.ShowError(ee); } }
private void BaseButton_Search_Click(object sender, EventArgs e) { try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } string orderID = string.IsNullOrEmpty(this.skinTextBox_OrderID.SkinTxt.Text) ? null : this.skinTextBox_OrderID.SkinTxt.Text; this.pagePara = new ReturnOrderPagePara() { ReturnOrderID = orderID, IsOpenDate = true, StartDate = new CJBasic.Date(this.dateTimePicker_Start.Value), EndDate = new CJBasic.Date(this.dateTimePicker_End.Value), PageIndex = 0, PageSize = this.dataGridViewPagingSumCtrl.PageSize, SupplierID = ValidateUtil.CheckEmptyValue(this.skinComboBoxSupplierID.SelectedValue), CostumeID = ValidateUtil.CheckEmptyValue(skinTextBox_costumeID.SkinTxt.Text), PurchaseOrderState = (PurchaseOrderState)rtType.SelectedValue, PurchaseOrderStateEnum = (PurchaseOrderStateEnum)skinComboBox_State.SelectedValue, DestShopID = ValidateUtil.CheckEmptyValue(skinComboBoxShopID.SelectedValue), Remarks = ValidateUtil.CheckEmptyValue(this.txtRemark.SkinTxt.Text), }; dataGridViewPagingSumCtrl.OrderPara = pagePara; ReturnOrderPage listPage = GlobalCache.ServerProxy.GetReturnOrderPage(this.pagePara); dataGridViewPagingSumCtrl.OrderPara = pagePara; this.dataGridViewPagingSumCtrl.Initialize(listPage); this.BindingReturnOrderSource(listPage); } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }