private void LoadOrder(PurchaseOrder order) { this.order = order; if (order != null) { skinTextBox_Remarks.Text = order.Remarks; //冲单重做 skinComboBoxShopID.SelectedValue = order.DestShopID; if (shop == null) { GlobalMessageBox.Show("店铺无效!"); } curDetailList.Clear(); BindingOutboundDetailSource(); dateTimePicker_Start.Value = order.CreateTime; numericTextBoxMoney.Value = order.PayMoney; skinComboBoxSupplierID.SelectedValue = order.SupplierID; curDetailList = GlobalCache.ServerProxy.GetPurchaseDetails(order.ID); foreach (var detail in curDetailList) { detail.SupplierName = GlobalCache.GetSupplierName(detail.SupplierID); detail.Discount = detail.Price == 0 ? 0 : Math.Round(detail.CostPrice * 100 / detail.Price, MidpointRounding.AwayFromZero); } } }
/// <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> /// 将集合中GuideName赋值 /// </summary> /// <param name="memberList"></param> private void SetOtherValue(List <Costume> list) { foreach (Costume item in list) { String name = GlobalCache.GetSupplierName(item.SupplierID); item.SupplierName = name; item.BrandName = GlobalCache.GetBrandName(item.BrandID); } }
private void BindingSource(SupplierAccountRecordPage listPage) { if (listPage != null && listPage.SupplierAccountRecords != null && listPage.SupplierAccountRecords.Count > 0) { foreach (var item in listPage.SupplierAccountRecords) { item.SupplierName = GlobalCache.GetSupplierName(item.SupplierID); item.AdminUserName = GlobalCache.GetUserName(item.AdminUserID); item.AccountTypeName = GlobalUtil.GetAccountTypeName(item.AccountType); } } this.dataGridViewPagingSumCtrl.BindingDataSource(listPage.SupplierAccountRecords, null, listPage?.TotalEntityCount, listPage?.Sum); }
private void SkinTxt_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode != Keys.Enter) { return; } try { string costumeID = this.SkinTxt.Text.Trim(); if (string.IsNullOrEmpty(costumeID)) { if (this.CostumeSelected != null) { this.CostumeSelected(null); } return; } if (GlobalUtil.EngineUnconnectioned(this)) { return; } //条形码,先根据条形码获取款号 //List<BarCode> barCodes = GlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Contains(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 = GlobalCache.CostumeList.FindAll(t => (t.ID.ToUpper().Contains(costumeID.ToUpper()) || t.Name.ToUpper().Contains(costumeID.ToUpper())) && t.PfShowOnline == EmOnline); if (filterValid) { resultList = resultList.FindAll(t => t.IsValid); } if (resultList == null || resultList.Count == 0) { if (this.CostumeSelected != null) { this.CostumeSelected(null); } this.SkinTxt.Text = ""; return; } if (resultList.Count == 1) { resultList[0].BrandName = GlobalCache.GetBrandName(resultList[0].BrandID); resultList[0].SupplierName = GlobalCache.GetSupplierName(resultList[0].SupplierID); if (!isBarCode) { this.SkinTxt.Text = resultList[0].ID; } if (this.CostumeSelected != null) { this.CostumeSelected(resultList[0]); } } else { EmPfCostumeForm costumeForm = new EmPfCostumeForm(resultList, costumeID, filterValid, EmOnline); costumeForm.CostumeSelected += CostumeForm_CostumeSelected; costumeForm.ShowDialog(); } } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }