public void Display() { try { if (CurItem != null) { this.BaseButton3.Text = "保存"; this.skinTextBox_ID.Enabled = false; this.skinTextBox_ID.Text = this.CurItem.ID; this.skinTextBox_Name.Text = this.CurItem.Name; this.numericUpDown_Price.Value = this.CurItem.Price; this.numericUpDownCostPrice.Value = this.CurItem.CostPrice; numericTextBoxSalePrice.Value = CurItem.SalePrice; this.skinComboBox_SupplierID.SelectedValue = this.CurItem.SupplierID; this.skinComboBox_Brand.SelectedValue = this.CurItem.BrandID; this.skinComboBox_Year.SelectedValue = this.CurItem.Year; if (this.CurItem.Season != null) { this.skinComboBox_Season.skinComboBox.SelectedValue = this.CurItem.Season; } this.selectSizeGroup = new SizeGroupSetting() { SizeGroup = CommonGlobalCache.GetSizeGroup(this.CurItem.SizeGroupName), SelectedSizeNames = this.CurItem.SizeNames }; this.skinComboBoxBigClass.SelectedValue = this.CurItem; if (this.CurItem.Remarks != null) { this.skinTextBox_Remarks.Text = this.CurItem.Remarks; } List <PfCustomerStore> stores = new List <PfCustomerStore>(); stores.Add(curStore); dataGridViewPagingSumCtrl.BindingDataSource(stores); //if (this.CurItem.Colors != null) //{ // this.textBoxColor.Text = this.CurItem.Colors; //} this.colorComboBox1.SelectedValue = CommonGlobalCache.GetColorIDByName(curStore.ColorName); //this.textBoxColor.Enabled = false; } else { ResetAll(); } } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void CostumeCurrentShopTextBox1_CostumeSelected(Costume costumeItem, bool isEnter) { if (isEnter) { if (costumeItem != null) { this.skinTextBox_Name.Text = costumeItem.Name; if (costumeItem.Name != "") { this.skinTextBox_Name.Enabled = false; } this.numericUpDown_Price.Value = costumeItem.Price; //if (costumeItem.Price > 0) //{ this.numericUpDown_Price.Enabled = false; //} this.skinComboBox_Season.skinComboBox.SelectedValue = costumeItem.Season; if (costumeItem.Season != "") { this.skinComboBox_Season.Enabled = false; } this.skinComboBox_Year.SelectedValue = costumeItem.Year; if (costumeItem.Year > 0) { this.skinComboBox_Year.Enabled = false; } this.skinComboBoxBigClass.SelectedValue = costumeItem; if (costumeItem.BigClassID > 0) { this.skinComboBoxBigClass.Enabled = false; } this.skinComboBox_Brand.SelectedValue = costumeItem.BrandID; if (costumeItem.BrandID > 0) { this.skinComboBox_Brand.Enabled = false; } this.skinComboBox_SupplierID.SelectedValue = costumeItem.SupplierID; if (costumeItem.SupplierID != "") { this.skinComboBox_SupplierID.Enabled = false; } this.colorComboBox1.SelectedValue = CommonGlobalCache.GetColorIDByName(costumeItem.Colors.Split(',')[0]); this.numericUpDownCostPrice.Value = costumeItem.CostPrice; //if (costumeItem.CostPrice > 0) //{ this.numericUpDownCostPrice.Enabled = false; //} numericTextBoxSalePrice.Value = costumeItem.SalePrice; //if (costumeItem.SalePrice >= 0) //{ this.numericTextBoxSalePrice.Enabled = false; //} selectSizeGroup = new SizeGroupSetting(); if (costumeItem.SizeNames != "") { baseButtonSelectSizeGroup.Enabled = false; } SizeGroup sizeGroup = GlobalCache.GetSizeGroup(costumeItem?.SizeGroupName); selectSizeGroup.Items = costumeItem.SizeNameList; selectSizeGroup.SizeGroup = sizeGroup; //this.selectSizeGroup = selectSizeGroup; SetDataGridData(); skinLabelSizeGroup.Text = CommonGlobalUtil.GetSizeDisplayNames(sizeGroup, costumeItem?.SizeNames); if (costumeItem.Remarks != null) { this.skinTextBox_Remarks.Text = costumeItem.Remarks; } } else { this.skinTextBox_Name.Enabled = true; this.numericUpDown_Price.Enabled = true; this.skinComboBox_Season.Enabled = true; this.skinComboBox_Year.Enabled = true; this.skinComboBoxBigClass.Enabled = true; this.skinComboBox_Brand.Enabled = true; this.skinComboBox_SupplierID.Enabled = true; this.numericUpDownCostPrice.Enabled = true; this.numericTextBoxSalePrice.Enabled = true; baseButtonSelectSizeGroup.Enabled = true; } } }