private void lbSelectedCardTypes_DoubleClick(object sender, EventArgs e) { var key = ((CreatorDataSet.CardTypeRow)lbSelectedCardTypes.SelectedItem).CardTypeName; var condition = (CustomerCondition)htConditions[key]; var frm = new frmConditon(condition.ShallowCopy()); if (frm.ShowDialog() == DialogResult.OK) { htConditions[key] = frm.CustomerCondition.ShallowCopy(); } }
private void AddSelecedCardType() { if (lbCardTypes.SelectedItems.Count == 0) { MessageBox.Show("请选择至少一个卡类别!"); return; } var frm = new frmConditon(); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) return; var selectedCardTypes = (from CreatorDataSet.CardTypeRow item in lbCardTypes.SelectedItems select (item)).Cast<object>().ToList(); foreach (CreatorDataSet.CardTypeRow item in selectedCardTypes) { lbCardTypes.Items.Remove(item); lbSelectedCardTypes.Items.Add(item); htConditions.Add(item.CardTypeName, frm.CustomerCondition.ShallowCopy()); } }
private void AddSelecedCardType() { if (lbCardTypes.SelectedItems.Count == 0) { MessageBox.Show("请选择至少一个卡类别!"); return; } var frm = new frmConditon(); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) { return; } var selectedCardTypes = (from CreatorDataSet.CardTypeRow item in lbCardTypes.SelectedItems select(item)).Cast <object>().ToList(); foreach (CreatorDataSet.CardTypeRow item in selectedCardTypes) { lbCardTypes.Items.Remove(item); lbSelectedCardTypes.Items.Add(item); htConditions.Add(item.CardTypeName, frm.CustomerCondition.ShallowCopy()); } }