//private void panel1_Resize(object sender, EventArgs e) //{ // LabelProduct(CatModelList); //} private void dataGridView2_CellClick_1(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { //得到每个值的类型,以便价格授权等 string constraintType = dataGridView2.Rows[e.RowIndex].Cells[3].Value.ToString(); if (constraintType.Equals("计算重置")) { return; } decimal price = (decimal)dataGridView2.Rows[e.RowIndex].Cells[2].Value; ProCode = dataGridView2.Rows[e.RowIndex].Cells[0].Value.ToString(); string valueDescription = dataGridView2.Rows[e.RowIndex].Cells[1].Value.ToString(); CatalogBLL.saveOrder(1, OrderID, ModelPropertyName, ProCode, price, valueDescription); //设置变红标签 var RedList = CatalogBLL.getAllByCondition(ModelPropertyName, OrderID, 1); foreach (var mol in CatModelList) { h3[mol.PropertyName] = panel1.BackColor; if (mol.PropertyName == ModelPropertyName) { ((Label)h1[mol.PropertyName]).Text = ProCode; h3[mol.PropertyName] = Color.Yellow; } if (RedList != null) { if (RedList.Select(s => s.PropertyName).Contains(mol.PropertyName)) { ((Label)h1[mol.PropertyName]).Text = RedList .Where(s => s.PropertyName == mol.PropertyName) .First() .Value; h3[mol.PropertyName] = Color.Red; } } ((Label)h1[mol.PropertyName]).BackColor = (Color)h3[mol.PropertyName]; } //如果是附件 if (constraintType.Equals("附件")) { RequiredControllerParts rcp = new RequiredControllerParts(1, OrderID, AAonRating.aaon.RowIndex); rcp.ShowDialog(); } else if (constraintType.Equals("手动赋值")) { QuotedPriceSpecialInformation qpsi = new QuotedPriceSpecialInformation(OrderID, ModelPropertyName, ProCode, valueDescription); qpsi.ShowDialog(); } //MessageBox.Show(constraintType); } }
//dataGridview事件 private void dataGridView_PropertyValue_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) return; String strValueCode = (String)dataGridView_PropertyValue.Rows[e.RowIndex].Cells["ValueCode"].Value; valueCode = strValueCode; string strValueID = "" + (int)dataGridView_PropertyValue.Rows[e.RowIndex].Cells["ValueCodeID"].Value; //设置属性值的gridview的选中后,设置其他的属性的值 var propertyModels = PropertyBLL.GetDirectRedPtyModelsLogic(1, propertyName, strValueID, 1); //单击时最上面面板值变化 set_ShowResultPanel(propertyName,valueCode); //label变红时 set_LabelRedAndValue(propertyModels); //获得附件列表 if(dataGridView_PropertyValue.Rows[e.RowIndex].Cells["PropertyValueType"].Value.ToString().Equals("附件")){ new RequiredControllerParts(1,propertyName,valueCode).Show(); } else if (dataGridView_PropertyValue.Rows[e.RowIndex].Cells["PropertyValueType"].Value.ToString().Equals("价格计算")) { new QuotedPriceSpecialInformation().Show(); } else if (dataGridView_PropertyValue.Rows[e.RowIndex].Cells["PropertyValueType"].Value.ToString().Equals("价格关联")) { int propertyId = PropertyBLL.GetPtyIdByPtyName(propertyName); int valueCodeId = Convert.ToInt32(strValueID); PropertyBLL.SetRelativePrice(1, propertyId, valueCodeId); } else if (dataGridView_PropertyValue.Rows[e.RowIndex].Cells["PropertyValueType"].Value.ToString().Equals("特殊价格授权")) { QuotedPriceSpecialInformation qpsi = new QuotedPriceSpecialInformation(); int propertyId = PropertyBLL.GetPtyIdByPtyName(propertyName); qpsi.setPrice(propertyId, Convert.ToInt32(strValueID)); qpsi.Show(); } }
private void unitSpec_SelectedIndexChanged(object sender, EventArgs e) { if (unitSpec.SelectedIndex != -1) { List<UnitModel> Bound_Data = UnitBLL.getAllByCondition("Special", orderID); if (Bound_Data.Count > 0) { BoundData(Bound_Data); } UnitBLL.saveOrder(orderID, "Special", unitSpec.SelectedValue.ToString()); if (unitSpec.Text.Equals("X=SPA Req'd")) { btn_SPA.Visible = true; QuotedPriceSpecialInformation quotedPrice = new QuotedPriceSpecialInformation(); quotedPrice.ShowDialog(); } else { btn_SPA.Visible = false; } } }