/// <summary> /// 将CostumeStore转化为ReplenishDetail /// </summary> /// <param name="store"></param> /// <returns></returns> private ReplenishDetail CostumeStoreConvertToReplenishDetail(CostumeStore store, string replenishOrderID) { if (store == null) { return(null); } ReplenishDetail detail = new ReplenishDetail(); return(new ReplenishDetail() { ReplenishOrderID = replenishOrderID, CostumeID = store.CostumeID, CostumeName = GlobalCache.GetCostumeName(store.CostumeID), ColorName = store.ColorName, CostPrice = store.CostPrice, XS = store.XS, S = store.S, M = store.M, L = store.L, F = store.F, XL = store.XL, XL2 = store.XL2, XL3 = store.XL3, XL4 = store.XL4, XL5 = store.XL5, XL6 = store.XL6, Price = store.Price }); }
/// <summary> /// 绑定RefundDetail数据源 /// </summary> private void BindingRefundDetailDataSource(RetailOrder refundOrder) { if (refundOrder == null) { this.dataGridView_RefundDetail.DataSource = null; } else { List <RetailDetail> refundDetailList = GlobalCache.ServerProxy.GetRetailDetailList(refundOrder.ID); this.dataGridView_RefundDetail.DataSource = null; if (refundDetailList != null && refundDetailList.Count > 0) { foreach (RetailDetail detail in refundDetailList) { detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID); detail.SizeDisplayName = CommonGlobalUtil.GetCostumeSizeName(detail.CostumeID, detail.SizeName); } this.dataGridView_RefundDetail.DataSource = refundDetailList; } } this.dataGridView_RefundDetail.Refresh(); this.dataGridView_RefundDetail.Visible = true; }
/// <summary> /// 将CostumeStore转化为OutboundDetail /// </summary> /// <param name="store"></param> /// <returns></returns> private BoundDetail CostumeStoreConvertToOutboundDetail(CostumeStore store) { if (store == null) { return(null); } return(new BoundDetail() { CostumeID = store.CostumeID, CostumeName = GlobalCache.GetCostumeName(store.CostumeID), ColorName = store.ColorName, XS = store.XS, S = store.S, M = store.M, L = store.L, F = store.F, XL = store.XL, XL2 = store.XL2, XL3 = store.XL3, XL4 = store.XL4, XL5 = store.XL5, XL6 = store.XL6, Price = store.Price, CostPrice = store.CostPrice, Comment = store.Remarks }); }
//将绑定的RetailDetail源转换成RefundDetail private RetailDetail RetailDetailToRefundDetail(RetailDetail retailDetail, string orderID) { return(new RetailDetail() { RetailOrderID = orderID, CostumeID = retailDetail.CostumeID, CostumeName = GlobalCache.GetCostumeName(retailDetail.CostumeID), ColorName = retailDetail.ColorName, SizeName = retailDetail.SizeName, Discount = retailDetail.Discount, DiscountOrigin = retailDetail.DiscountOrigin, IsRefund = true, Price = retailDetail.Price, BuyCount = retailDetail.RefundCount * -1, IsBuyout = retailDetail.IsBuyout, BrandName = ValidateUtil.CheckNotNullValue(retailDetail.BrandName), GiftTicketMoney = retailDetail.GiftTicketMoney, //268 畅滞排行榜:商品退货后,零售金额变成0 //20180820 summoney 修改为除以购买数量再乘以退货数量 SalePrice = Math.Round((retailDetail.SumMoney / retailDetail.BuyCount) * -1, 1, MidpointRounding.AwayFromZero),//每件商品退货单价 SumMoney = Math.Round(retailDetail.RefundCount * (retailDetail.SumMoney / retailDetail.BuyCount) * -1, 1, MidpointRounding.AwayFromZero), SumMoneyActual = Math.Round(retailDetail.RefundCount * retailDetail.Price * -1, 1, MidpointRounding.AwayFromZero), SizeDisplayName = retailDetail.SizeDisplayName, //retailDetail.RefundCount * retailDetail.Price * -1, CostPrice = retailDetail.CostPrice * -1, SumCost = retailDetail.RefundCount * retailDetail.CostPrice * -1, Remarks = retailDetail.Remarks, InSalesPromotion = retailDetail.InSalesPromotion, GiftTickets = retailDetail.GiftTickets, RefundCount = retailDetail.RefundCount, OccureTime = dateTimePicker_Start.Value, GuideID = retailDetail.GuideID, }); }
/// <summary> /// 绑定选定款号对应的CostumeStore集合 /// </summary> private void BindingSelectedCostumeStoreSource() { if (this.curSelectedCostumeStoreList == null) { this.dataGridView1.DataSource = null; } else { dataGridViewPagingSumCtrl.DisableStyle(); this.dataGridView1.DataSource = null; if (this.curSelectedCostumeStoreList != null && this.curSelectedCostumeStoreList.Count > 0) { List <CostumeStore> tempList = new List <CostumeStore>(); foreach (CostumeStore store in this.curSelectedCostumeStoreList) { store.Title = "库存"; store.CostumeName = GlobalCache.GetCostumeName(store.CostumeID); CostumeStore tempStore = this.BuildCostumeStore4NeedReplenish(store); //CJBasic.Helpers.ReflectionHelper.CopyProperty(store, obj); tempList.Add(store); tempList.Add(tempStore); } this.curSelectedCostumeStoreList = tempList; ////重新排序,同款同颜色排一起,且将补货数量拍在库存后面 //this.curSelectedCostumeStoreList.Sort((x, y) => //{ // int sort = x.ColorName.CompareTo(y.ColorName); // if (sort == 0) // { // sort = -x.Title.CompareTo(y.Title); // } // return sort; //}); this.dataGridView1.DataSource = this.curSelectedCostumeStoreList; foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Index % 2 == 0) { row.ReadOnly = true; row.HeaderCell.Value = "库存"; } else { row.ReadOnly = false; row.HeaderCell.Value = "补货申请"; } } dataGridViewPagingSumCtrl.EnableStyle(); } } this.dataGridView1.Refresh(); dataGridViewPagingSumCtrl.AutoFocusToWritableCell(); }
/// <summary> /// 绑定要补货的集合源 /// </summary> private void BindingReplenishDetailSource() { if (this.curReplenishDetailList != null && this.curReplenishDetailList.Count > 0) { foreach (ReplenishDetail detail in this.curReplenishDetailList) { detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID); } } dataGridViewPagingSumCtrl2.BindingDataSource <ReplenishDetail>(this.curReplenishDetailList); }
/// <summary> /// 绑定要报损的集合源 /// </summary> private void BindingOutboundDetailSource() { if (this.curOutboundDetailList != null && this.curOutboundDetailList.Count > 0) { foreach (BoundDetail detail in this.curOutboundDetailList) { detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID); } } dataGridViewPagingSumCtrl2.BindingDataSource <BoundDetail>(DataGridViewUtil.ListToBindingList(this.curOutboundDetailList)); }
//将绑定的PfCustomerRetailDetail源转换成RefundDetail private PfCustomerRetailDetail PfCustomerRetailDetailToRefundDetail(PfCustomerRetailDetail PfCustomerRetailDetail, string orderID) { return(new PfCustomerRetailDetail() { CostumeID = PfCustomerRetailDetail.CostumeID, CostumeName = GlobalCache.GetCostumeName(PfCustomerRetailDetail.CostumeID), ColorName = PfCustomerRetailDetail.ColorName, SizeName = PfCustomerRetailDetail.SizeName, BuyCount = PfCustomerRetailDetail.BuyCount, SizeDisplayName = PfCustomerRetailDetail.SizeDisplayName, }); }
private void BindingSource(List <BoundDetail> list) { this.dataGridView2.DataSource = null; if (list != null && list.Count > 0) { foreach (BoundDetail detail in list) { detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID); } this.dataGridView2.DataSource = DataGridViewUtil.ListToBindingList(list); } }
private void BindingSource(List <ReplenishDetail> list) { this.dataGridView2.DataSource = null; if (list != null && list.Count > 0) { foreach (ReplenishDetail detail in list) { detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID); } dataGridViewPagingSumCtrl2.BindingDataSource <ReplenishDetail>(list); // this.dataGridView2.DataSource = list; } }
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { DataGridViewRow row = dataGridView1.Rows[e.RowIndex]; CostumeStore item = (CostumeStore)row.DataBoundItem; if (row.DataBoundItem != null) { if (costumeNameDataGridViewTextBoxColumn.Index == e.ColumnIndex) { e.Value = GlobalCache.GetCostumeName(item.CostumeID); } } }
private void BindingRetailCostumeSource() { string selectShopid = ValidateUtil.CheckEmptyValue(this.skinComboBoxShopID.SelectedValue); List <Guide> guideList = CommonGlobalCache.GuideList.FindAll(t => t.State == 0 && t.ShopID == selectShopid); this.GuideName.DataSource = guideList; this.GuideName.DisplayMember = "Name"; this.GuideName.ValueMember = "ID"; if (this.currentRetailCostume.RetailDetailList != null && this.currentRetailCostume.RetailDetailList.Count > 0) { foreach (RetailDetail detail in this.currentRetailCostume.RetailDetailList) { detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID); detail.SizeDisplayName = CommonGlobalUtil.GetCostumeSizeName(detail.CostumeID, detail.SizeName); } } this.dataGridViewPagingSumCtrl.SetDataSource <RetailDetail>(DataGridViewUtil.ListToBindingList(this.currentRetailCostume?.RetailDetailList)); }