private void Initialize() { if (this.curReplenishOrder == null) { return; } try { DataGridViewUtil.SetAlternatingColor(dataGridView1, Color.Gainsboro, Color.White); this.skinTextBox_OrderID.Text = "补货申请单号:" + this.curReplenishOrder.ID; this.skinLabel_ShopName.Text = "店铺名称:" + GlobalCache.GetShopName(this.curReplenishOrder.ShopID); curReplenishDetailList = GlobalCache.ServerProxy.GetReplenishDetail(this.curReplenishOrder.ID); foreach (var item in curReplenishDetailList) { Costume costume = CommonGlobalCache.GetCostume(item.CostumeID); if (costume != null) { item.CostPrice = costume.CostPrice; } } this.BindingSource(curReplenishDetailList); } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
/// <summary> /// 绑定RetailDetail数据源并设置下方的Label值 /// </summary> private void BindingDataSource( CostumeRetailAnalysisPage listPage) { this.dataGridViewDetail.DataSource = null; if (listPage != null && listPage.CostumeRetailAnalysisList != null) { foreach (CostumeRetailAnalysis item in listPage.CostumeRetailAnalysisList) { Costume costume = GlobalCache.GetCostume(item.CostumeID); //按款查询需要前端补充颜色信息 if (string.IsNullOrEmpty(item.ColorName)) { item.ColorName = costume.Colors; } item.Price = costume.Price; item.BigClass = costume.BigClass; item.SmallClass = costume.SmallClass; item.Season = costume.Season; item.Year = costume.Year; item.CostumeName = costume.Name; item.BrandName = GlobalCache.GetBrandName(costume.BrandID); item.ShopName = GlobalCache.GetShopName(item.ShopID); decimal totalPrice = item.Price * item.QuantityOfSale; if (totalPrice == 0) { item.AvgDiscount = 100; } else { item.AvgDiscount = MathHelper.Rounded(item.MoneyOfSale / totalPrice, 2); } } this.dataGridViewDetail.DataSource = listPage?.CostumeRetailAnalysisList; } }
/// <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; }
/// <summary> /// 绑定plenishOrderSource源到dataGridView中 /// </summary> /// <param name="listPage"></param> private void BindingPurchaseOrderSource(PurchaseCostumePage listPage) { if (listPage != null && listPage.PurchaseOrderList != null && listPage.PurchaseOrderList.Count > 0) { List <PurchaseOrder> details = listPage.PurchaseOrderList; foreach (var item in details) { if (!String.IsNullOrEmpty(item.DestShopID)) { item.ShopName = GlobalCache.GetShopName(item.DestShopID); item.UserName = GlobalCache.GetUserName(item.AdminUserID); } } } this.dataGridViewPagingSumCtrl.BindingDataSource(listPage?.PurchaseOrderList, null, listPage?.TotalEntityCount, listPage?.PurchaseOrderSum); this.skinSplitContainer1.Panel2Collapsed = true; }
/// <summary> /// 绑定RefundOrder数据源 /// </summary> private void BindingRefundOrderDataSource(RefundListPage listPage) { if (listPage != null) { this.refundOrderList = listPage.ResultList; if (this.refundOrderList != null && this.refundOrderList.Count > 0) { foreach (RetailOrder refundOrder in this.refundOrderList) { refundOrder.GuideName = GlobalCache.GetUserName(refundOrder.GuideID); refundOrder.ShopName = GlobalCache.GetShopName(refundOrder.ShopID); } } } this.dataGridViewPagingSumCtrl.BindingDataSource(listPage?.ResultList, null, listPage?.TotalEntityCount, listPage?.RetailOrderSum); this.dataGridView_RefundOrder.Refresh(); this.dataGridView_RefundDetail.Visible = false; }
/// <summary> /// 绑定RetailDetail数据源并设置下方的Label值 /// </summary> private void BindingDataSource(List <SalesQuantityRanking> retailDetailList) { this.dataGridViewDetail.DataSource = null; if (retailDetailList != null && retailDetailList.Count > 0) { foreach (SalesQuantityRanking detail in retailDetailList) { Costume costume = GlobalCache.GetCostume(detail.CostumeID); detail.CostumeName = costume?.Name; //按款查询需要前端补充颜色信息 if (string.IsNullOrEmpty(detail.ColorName)) { detail.ColorName = costume?.Colors; } detail.ShopName = GlobalCache.GetShopName(detail.ShopID); } this.dataGridViewDetail.DataSource = retailDetailList; } }
/// <summary> /// 绑定RetailDetail数据源并设置下方的Label值 /// </summary> private void BindingDataSource(List <PriceRangeReport> retailDetailList) { this.dataGridViewDetail.DataSource = null; if (retailDetailList != null && retailDetailList.Count > 0) { foreach (PriceRangeReport detail in retailDetailList) { //Costume costume= GlobalCache.GetCostume(detail.CostumeID); //detail.CostumeName = costume.Name; ////按款查询需要前端补充颜色信息 //if (string.IsNullOrEmpty(detail.ColorName)) //{ // detail.ColorName = costume.Colors; //} detail.ShopName = GlobalCache.GetShopName(detail.ShopID); } // this.dataGridViewDetail.DataSource = retailDetailList; this.dataGridViewPagingSumCtrl.BindingDataSource <PriceRangeReport>(DataGridViewUtil.ToDataTable <PriceRangeReport>(retailDetailList)); } }
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.RowIndex < -1 || e.ColumnIndex < -1) { return; } if (e.Value == null) { return; } DataGridView view = sender as DataGridView; ScrapOrder order = view.Rows[e.RowIndex].DataBoundItem as ScrapOrder; if (e.ColumnIndex == ShopNameColumn.Index) { e.Value = GlobalCache.GetShopName(e.Value.ToString()); } else if (e.ColumnIndex == AdminUserColumn.Index) { e.Value = GlobalCache.GetUserName(e.Value.ToString()); } else if (e.ColumnIndex == ColumnCancel.Index) { if (order.IsCancel) { e.Value = null; } } else if (e.ColumnIndex == ColumnRedo.Index) { if (!order.IsCancel) { e.Value = null; } } }