/// <summary> /// 绑定选定款号对应的CostumeStore集合 /// </summary> private void BindingSelectedCostumeStoreSource() { if (this.curSelectedCostumeStoreList != null && this.curSelectedCostumeStoreList.Count > 0) { List <CostumeStore> tempList = new List <CostumeStore>(); foreach (CostumeStore store in this.curSelectedCostumeStoreList) { store.Title = "店铺库存"; CostumeStore tempStore = this.BuildCostumeStore4NeedReplenish(store); tempList.Add(store); tempList.Add(tempStore); } this.curSelectedCostumeStoreList = tempList; } this.dataGridViewPagingSumCtrl.SetDataSource <CostumeStore>(DataGridViewUtil.ListToBindingList(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 = "发货"; } } // cell获取焦点 dataGridViewPagingSumCtrl.AutoFocusToWritableCell(); }
/// <summary> /// 绑定选定款号对应的CostumeStore集合 /// </summary> private void BindingSelectedCostumeStoreSource() { if (this.InvokeRequired) { this.BeginInvoke(new CbGeneric(this.BindingSelectedCostumeStoreSource)); } else { this.dataGridViewPagingSumCtrl.SetDataSource <CostumeStore>(DataGridViewUtil.ListToBindingList(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 = "退货"; } } // cell获取焦点 dataGridViewPagingSumCtrl.AutoFocusToWritableCell(); } }
/// <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(); }
private void BindingSelectedCostumeStoreSource(BoundDetail detail) { if (this.curSelectedCostumeStoreList == null) { this.dataGridView1.DataSource = null; } else { 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 = "库存"; CostumeStore tempStore = this.BuildCostumeStore4NeedReplenish(store, detail); //CJBasic.Helpers.ReflectionHelper.CopyProperty(store, obj); tempList.Add(store); tempList.Add(tempStore); } this.curSelectedCostumeStoreList = tempList; this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(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 = "退货"; } } // cell获取焦点 dataGridViewPagingSumCtrl1.AutoFocusToWritableCell(); // this.dataGridView1.Refresh(); }
/// <summary> /// 绑定选定款号对应的CostumeStore集合 /// </summary> private void BindingSelectedCostumeStoreSource() { if (this.curSelectedCostumeStoreList == null) { this.dataGridView1.DataSource = null; } else { this.dataGridView1.DataSource = null; if (this.curSelectedCostumeStoreList != null && this.curSelectedCostumeStoreList.Count > 0) { //重新排序,同款同颜色排一起,且将报损数量拍在库存后面 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 = DataGridViewUtil.ListToBindingList(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 = "报损"; } } this.dataGridView1.Refresh(); dataGridViewPagingSumCtrl1.AutoFocusToWritableCell(); }
/// <summary> /// 绑定选定款号对应的CostumeStore集合 /// </summary> private void BindingSelectedCostumeStoreSource(BoundDetail detail) { try { if (this.curSelectedCostumeStoreList != null && this.curSelectedCostumeStoreList.Count > 0) { List <CostumeStore> tempList = new List <CostumeStore>(); foreach (CostumeStore store in this.curSelectedCostumeStoreList) { store.Title = "库存"; // store.Price = 0; // store.CostumeName = CommonGlobalCache.GetCostumeName(store.CostumeID); //CJBasic.Helpers.ReflectionHelper.CopyProperty(store, obj); // this.ReadOnly = true; List <CostumeItem> resultList = CommonGlobalCache.ServerProxy.GetCostumeStoreList( new CostumeStoreListPara() { CostumeID = store.CostumeID, ShopID = ValidateUtil.CheckEmptyValue(skinComboBoxShopID.SelectedValue), IsOnlyShowValid = false }); CostumeItem item = resultList?.Find(t => t.Costume.ID == store.CostumeID); CostumeStore destShopStore = item?.CostumeStoreList?.Find(t => t.CostumeID == store.CostumeID && t.ColorName == store.ColorName); if (destShopStore != null) { //取收货方的吊牌价售价 store.Price = destShopStore.Price; store.SalePrice = destShopStore.SalePrice; } CostumeStore tempStore = this.BuildCostumeStore4NeedReplenish(store, detail); tempList.Add(store); tempList.Add(tempStore); } this.curSelectedCostumeStoreList = tempList; } List <CostumeStore> selectResultList = new List <CostumeStore>(); /* if (this.skinComboBox_Color.DataSource!= null && this.curSelectedCostumeStoreList != null && this.skinComboBox_Color.SelectedValue != null) * { * selectResultList = this.curSelectedCostumeStoreList.FindAll(t => t.ColorName == ValidateUtil.CheckEmptyValue(this.skinComboBox_Color.SelectedValue)); * } */ dataGridViewPagingSumCtrl1.BindingDataSource(DataGridViewUtil.ListToBindingList(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 = "调拨"; } } // curSelectedCostumeStoreList = null; dataGridViewPagingSumCtrl1.AutoFocusToWritableCell(); } catch (Exception ex) { CommonGlobalUtil.ShowError(ex); } finally { // this.ReadOnly = false; } }