private void LoadOrder(PfOrder order) { if (order != null) { //冲单重做 skinComboBox_PfCustomer.SelectedValue = order.PfCustomerID; dateTimePicker_Start.Value = order.CreateTime; numericTextBoxMoney.Value = order.PayMoney; SetPayType(order.PayType); skinComboBoxShopID.SelectedValue = order.ShopID; curInboundDetailList = GlobalCache.ServerProxy.GetPfOrderDetails(order.ID); if (curInboundDetailList != null) { foreach (var item in curInboundDetailList) { Costume costume = CommonGlobalCache.GetCostume(item.CostumeID); item.CostumeName = costume.Name; item.CustomerID = order.PfCustomerID; item.BrandName = CommonGlobalCache.GetBrandName(costume.BrandID); item.CustomerName = PfCustomerCache.GetPfCustomerName(item.CustomerID); } } skinTextBox_Remarks.Text = order.Remarks; } this.BindingInboundDetailSource(); }
private void dataGridView1_SelectionChanged(object sender, EventArgs e) { try { PfOrder order = (PfOrder)this.dataGridView1.CurrentRow.DataBoundItem; if (order != null && order != curOrder) { List <PfOrderDetail> curInboundDetailList = CommonGlobalCache.ServerProxy.GetPfOrderDetails(order.ID); if (curInboundDetailList != null) { foreach (var item in curInboundDetailList) { Costume costume = CommonGlobalCache.GetCostume(item.CostumeID); item.BrandName = CommonGlobalCache.GetBrandName(costume.BrandID); item.CostumeName = costume.Name; } } dataGridViewPagingSumCtrl1.BindingDataSource(curInboundDetailList); curOrder = order; } } catch (Exception ex) { // CommonGlobalUtil.ShowError(ex); } }
private void SetDataSource(List <Costume> items) { //this.currentSource = items; this.currentSource.Clear(); for (int i = 0; i < items.Count; i++) { items[i].BrandName = CommonGlobalCache.GetBrandName(items[i].BrandID); //items[i].Costume.SupplierName = CommonGlobalCache.GetSupplierName(items[i].Costume.SupplierID); //if (items[i].CostumeStoreList != null) //{ // foreach (var item in items[i].CostumeStoreList) // { // item.CostumeName = items[i].Costume.Name; // item.BrandName = items[i].Costume.BrandName; // item.Price = items[i].Costume.Price; // item.CostPrice = items[i].Costume.CostPrice; // } //} this.currentSource.Add(items[i]); } this.dataGridView1.DataSource = null; this.dataGridView1.DataSource = this.currentSource; }
/// <summary> /// 将集合中GuideName赋值 /// </summary> /// <param name="memberList"></param> private void SetOtherValue(List <Costume> list) { foreach (Costume item in list) { String name = CommonGlobalCache.GetSupplierName(item.SupplierID); item.SupplierName = name; item.BrandName = CommonGlobalCache.GetBrandName(item.BrandID); } }
private void SkinTxt_TextChanged(object sender, EventArgs e) { if (this.Text.Contains("costumeInfoText") || this.SkinTxt.Text.Contains("costumeInfoText")) { this.Text = ""; this.SkinTxt.Text = ""; return; } if (this.Text != "costumeInfoText1" && this.SkinTxt.Text != "costumeInfoText1") { if (String.IsNullOrEmpty(this.Text)) { this.CostumeSelected?.Invoke(null, false); } else { string costumeID = this.Text.Trim(); //条形码,先根据条形码获取款号 //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper())); ////,条形码为一条,找到这个款号 //if (barCodes != null && barCodes.Count == 1) //{ // costumeID = barCodes[0].CostumeID; // isBarCode = true; //} //BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID); //if (costume != null) //{ // costumeID = costume.CostumeID; // SkinTxt.Text = costume.BarCode; // isBarCode = true; //} List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.ID.ToUpper().Equals(costumeID.ToUpper())); if (filterValid) { resultList = resultList.FindAll(t => t.IsValid); } if (resultList == null || resultList.Count == 0) { this.CostumeSelected?.Invoke(null, false); return; } if (resultList.Count == 1) { resultList[0].BrandName = CommonGlobalCache.GetBrandName(resultList[0].BrandID); resultList[0].SupplierName = CommonGlobalCache.GetSupplierName(resultList[0].SupplierID); CostumeSelected?.Invoke(resultList[0], false); } } } }
private void ShowDiff() {//显示盘点录入中有差异的商品 List <CheckStoreDiff> diffList = new List <CheckStoreDiff>(); foreach (var item in costumeStores) { if (!CheckBrand(item)) { continue; } CheckStoreDetail real = item; CostumeStoreHistory shot = shots.Find(t => t.CostumeID.ToUpper() == item.CostumeID.ToUpper() && item.ColorName == t.ColorName); if (shot == null) { WebResponseObj <List <CostumeStoreHistory> > result = CommonGlobalCache.ServerProxy.GetCostumeStoreHistory4CheckStore( this.shopId, item.CostumeID, new Date(this.date), true ); if (result?.Data != null && result?.Data.Count > 0) { shot = result.Data.Find(t => t.CostumeID.ToUpper() == item.CostumeID.ToUpper() && item.ColorName == t.ColorName); } } CheckStoreDetail quick = ToCheckStoreDetail(shot); CheckStoreDetail liaojian = new CheckStoreDetail(); CheckStoreDetail diff = null; diff = SetCostumeStoreDiff(real, liaojian, quick, "差异"); foreach (string sizeName in CostumeStoreHelper.CostumeSizeColumn) { String dbSize = sizeName; //CostumeStoreHelper.GetCostumeSize(sizeName, sizeGroup); int differenceCount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(diff, sizeName + "WinLost")); if (differenceCount != 0) { int realcount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(real, sizeName)); int changeCount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(liaojian, sizeName)); int storeCount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(quick, sizeName + "Atm")); CheckStoreDiff storeDiff = new CheckStoreDiff(); ReflectionHelper.CopyProperty(real, storeDiff); Costume costume = CommonGlobalCache.GetCostume(storeDiff.CostumeID); String sizeDisplayName = CostumeStoreHelper.GetCostumeSizeName(sizeName, CommonGlobalCache.GetSizeGroup(costume.SizeGroupName)); storeDiff.SizeName = sizeDisplayName; storeDiff.BrandName = CommonGlobalCache.GetBrandName(costume.BrandID); storeDiff.DiffCount = differenceCount; storeDiff.RealCount = realcount; storeDiff.QuickCount = storeCount; storeDiff.ChangeCount = changeCount; diffList.Add(storeDiff); } } } dataGridViewPagingSumCtrl2.BindingDataSource(diffList); }
private void SetDataSource(List <Costume> items) { this.dataGridView1.DataSource = null; this.currentCostumes = items; this.currentSource.Clear(); for (int i = 0; i < items.Count; i++) { items[i].BrandName = CommonGlobalCache.GetBrandName(items[i].BrandID); items[i].SupplierName = CommonGlobalCache.GetSupplierName(items[i].SupplierID); this.currentSource.Add(items[i]); } this.dataGridView1.DataSource = this.currentSource; }
private void BindingSource(List <BoundDetail> list) { this.dataGridView2.DataSource = null; if (list != null && list.Count > 0) { foreach (var item in list) { Costume costume = CommonGlobalCache.GetCostume(item.CostumeID); item.SupplierName = CommonGlobalCache.GetSupplierName(item.SupplierID); item.BrandName = CommonGlobalCache.GetBrandName(costume.BrandID); item.Year = costume.Year; item.Season = costume.Season; item.CostumeName = costume.Name; } dataGridViewPagingSumCtrl2.BindingDataSource <BoundDetail>(DataGridViewUtil.ListToBindingList(curDetailList)); //this.dataGridView2.DataSource = list; } }
private void dataGridView1_SelectionChanged(object sender, EventArgs e) { try { if (flag == false) { if (this.dataGridView1.CurrentRow.DataBoundItem != null && this.dataGridView1.Rows.Count > 0) { AllocateOrder order = (AllocateOrder)this.dataGridView1.CurrentRow.DataBoundItem; if (order != null && order != curOrder) { List <BoundDetail> list = CommonGlobalCache.ServerProxy.GetOutboundDetail(order.OutboundOrderID); if (list != null && list.Count > 0) { foreach (var item in list) { Costume costume = CommonGlobalCache.GetCostume(item.CostumeID); item.SupplierName = CommonGlobalCache.GetSupplierName(item.SupplierID); item.BrandName = CommonGlobalCache.GetBrandName(costume.BrandID); item.CostumeName = costume.Name; } } dataGridViewPagingSumCtrl1.BindingDataSource(list); curOrder = order; } } } else { flag = false; } } catch (Exception ex) { // CommonGlobalUtil.ShowError(ex); } }
//添加补货明细到补货列表中 private void BaseButton_Add_Click(object sender, EventArgs e) { try { if (this.curSelectedCostumeStoreList == null || this.curSelectedCostumeStoreList.Count == 0) { return; } List <CostumeStore> costumeStoreList = this.curSelectedCostumeStoreList.FindAll((x) => x.Title == "补货数量"); foreach (CostumeStore store in costumeStoreList) { if (store.SumCount == 0) { continue; } if (store.Remarks == null) { store.Remarks = ""; } ReplenishDetail detail = this.CostumeStoreConvertToReplenishDetail(store, ""); detail.Comment = store.Remarks; detail.BrandName = CommonGlobalCache.GetBrandName(CommonGlobalCache.GetCostume(detail.CostumeID).BrandID); this.CurReplenishDetailListAddItem(detail); } //清空dataGirdView1的绑定源 this.SetCostumeDetails(null); this.BindingReplenishDetailSource(); CostumeCurrentShopTextBox1.Focus(); } catch (Exception ee) { GlobalUtil.ShowError(ee); } }
private void SetDataSource(List <Costume> items) { // this.currentSource = items; List <Costume> curList = new List <Costume>(); if (items != null) { foreach (Costume i in items) { Costume cItem = new Costume(); ReflectionHelper.CopyProperty(i, cItem); curList.Add(cItem); } this.currentSource.Clear(); for (int i = 0; i < curList.Count; i++) { curList[i].BrandName = CommonGlobalCache.GetBrandName(curList[i].BrandID); //items[i].Costume.SupplierName = CommonGlobalCache.GetSupplierName(items[i].Costume.SupplierID); //if (items[i].CostumeStoreList != null) //{ // foreach (var item in items[i].CostumeStoreList) // { // item.CostumeName = items[i].Costume.Name; // item.BrandName = items[i].Costume.BrandName; // item.Price = items[i].Costume.Price; // item.CostPrice = items[i].Costume.CostPrice; // } //} this.currentSource.Add(curList[i]); } } this.dataGridView1.DataSource = null; this.dataGridView1.DataSource = this.currentSource; }
private void SkinTxt_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode != Keys.Enter) { return; } try { isBarCode = false; string costumeID = this.SkinTxt.Text.Trim(); if (string.IsNullOrEmpty(costumeID)) { if (this.CostumeSelected != null) { this.CostumeSelected(null); } return; } if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } //条形码,先根据条形码获取款号 //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper())); ////,条形码为一条,找到这个款号 //if (barCodes != null && barCodes.Count == 1) //{ // costumeID = barCodes[0].CostumeID; // this.SkinTxt.Text = barCodes[0].BarCodeValue; // isBarCode = true; //} if (costumeID.Length == 15) { BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID); if (costume != null) { costumeID = costume.CostumeID; SkinTxt.Text = costume.BarCode; isBarCode = true; } } List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.ID.ToUpper().Contains(costumeID.ToUpper()) && t.IsValid == true); // List<CostumeItem> resultList = GlobalCache.ServerProxy.GetPfCustomerStores("", costumeID); if (resultList == null || resultList.Count == 0) { this.CostumeSelected?.Invoke(null); //this.SkinTxt.Text = ""; return; } if (resultList.Count == 1) { List <CostumeItem> OneresultList = GlobalCache.ServerProxy.GetPfCustomerStores(CustomerID, costumeID, true); if (OneresultList.Count == 0) { CostumeItem createItem = new CostumeItem(); createItem.Costume = resultList[0]; createItem.CostumeStoreList = SetupStores(resultList[0]); OneresultList.Add(createItem); } OneresultList[0].Costume.BrandName = CommonGlobalCache.GetBrandName(OneresultList[0].Costume.BrandID); OneresultList[0].Costume.SupplierName = CommonGlobalCache.GetSupplierName(OneresultList[0].Costume.SupplierID); if (OneresultList[0].CostumeStoreList != null) { foreach (var item in OneresultList[0].CostumeStoreList) { item.CostumeName = OneresultList[0].Costume.Name; item.BrandName = OneresultList[0].Costume.BrandName; item.Price = OneresultList[0].Costume.Price; } } if (!isBarCode) { this.SkinTxt.Text = OneresultList[0].Costume.ID; } if (this.CostumeSelected != null) { this.CostumeSelected(OneresultList[0]); } } else { PfCostumeFromShopForm costumeForm = new PfCostumeFromShopForm(resultList, costumeID, CustomerID, filterValid); // costumeForm.Hide(); // costumeForm.CostumeSelected += CostumeForm_CostumeSelected; if (costumeForm.ShowDialog() == DialogResult.OK) { if (costumeForm.Result == null) { return; } this.SkinTxt.Text = costumeForm.Result.Costume.ID; CostumeSelected?.Invoke(costumeForm.Result); } } } catch (Exception ee) { ShowError(ee); } finally { UnLockPage(); } }
public void Search() { try { isBarCode = false; string costumeID = this.SkinTxt.Text.Trim(); if (string.IsNullOrEmpty(costumeID)) { if (this.CostumeSelected != null) { this.CostumeSelected(null, true); } return; } if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } //条形码,先根据条形码获取款号 //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper())); ////,条形码为一条,找到这个款号 //if (barCodes != null && barCodes.Count == 1) //{ // costumeID = barCodes[0].CostumeID; // this.SkinTxt.Text = barCodes[0].BarCodeValue; // isBarCode = true; //} //String barCode= /* if (costumeID.Length == 15) * { * BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID); * if (costume != null) * { * costumeID = costume.CostumeID; * SkinTxt.Text = costume.BarCode; * isBarCode = true; * } * }*/ List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.ID.ToUpper().Equals(costumeID.ToUpper())); if (filterValid) { resultList = resultList.FindAll(t => t.IsValid); } if (resultList == null || resultList.Count == 0) { if (this.CostumeSelected != null) { this.CostumeSelected(null, true); } return; } if (resultList.Count == 1) { resultList[0].BrandName = CommonGlobalCache.GetBrandName(resultList[0].BrandID); resultList[0].SupplierName = CommonGlobalCache.GetSupplierName(resultList[0].SupplierID); if (!isBarCode) { this.SkinTxt.Text = resultList[0].ID; } if (this.CostumeSelected != null) { this.CostumeSelected(resultList[0], true); } } else { /* CostumeForm costumeForm = new CostumeForm(resultList, costumeID, filterValid); * // costumeForm.CostumeSelected += CostumeForm_CostumeSelected; * if (costumeForm.ShowDialog() == DialogResult.OK) * { * this.SkinTxt.Text = costumeForm.Result.ID; * CostumeSelected?.Invoke(costumeForm.Result, true); * }*/ } } catch (Exception ee) { ShowError(ee); } finally { UnLockPage(); } }
private void SkinTxt_TextChanged(object sender, EventArgs e) { //if (EnableTextChanged) //{ if (String.IsNullOrEmpty(this.Text)) { if (this.CostumeSelected != null) { curItem = null; this.CostumeSelected(curItem, false); } } else { string costumeID = this.Text.Trim(); ////条形码,先根据条形码获取款号 //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper())); ////,条形码为一条,找到这个款号 //if (barCodes != null && barCodes.Count == 1) //{ // costumeID = barCodes[0].CostumeID; // isBarCode = true; //} //BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID); //if (costume != null) //{ // costumeID = costume.CostumeID; // isBarCode = true; //} List <CostumeItem> resultList = null; try { // this.ReadOnly = true; resultList = CommonGlobalCache.ServerProxy.GetCostumeStoreList( new CostumeStoreListPara() { CostumeID = costumeID, ShopID = this.ShopID, IsOnlyShowValid = filterValid }); } catch (Exception ex) { CommonGlobalUtil.ShowError(ex); } finally { // this.ReadOnly = false; } //有供应商则过滤供应商 if (SupplierID != null && resultList != null) { resultList = resultList.FindAll(i => i.Costume.SupplierID == SupplierID); } if (resultList == null || resultList.Count == 0) { if (this.CostumeSelected != null) { curItem = null; this.CostumeSelected(curItem, false); } return; } else { if (reload) { resultList = resultList.FindAll(t => t.Costume.ID.ToUpper() == costumeID.ToUpper()); } } if (resultList.Count == 1) { resultList[0].Costume.BrandName = CommonGlobalCache.GetBrandName(resultList[0].Costume.BrandID); resultList[0].Costume.SupplierName = CommonGlobalCache.GetSupplierName(resultList[0].Costume.SupplierID); if (resultList[0].CostumeStoreList != null) { foreach (var item in resultList[0].CostumeStoreList) { item.CostumeName = resultList[0].Costume.Name; item.BrandName = resultList[0].Costume.BrandName; item.Price = resultList[0].Costume.Price; item.CostPrice = resultList[0].Costume.CostPrice; } } if (this.CostumeSelected != null) { curItem = resultList[0]; if (reload) { this.CostumeSelected(curItem, true); } else { this.CostumeSelected(curItem, false); } } } } // } }