private void cmdEdit_Click(object sender, EventArgs e) { if (lstRoute.SelectedIndices.Count > 0) { int k = lstRoute.SelectedIndices[0]; string strKey = mapKey[k]; TempNode tt = mapTmpNode[strKey]; frmRouting routing = new frmRouting(); routing.ID = strKey; routing.DigitMask = tt.NodeValue; routing.Description = tt.NodeText; routing.ShowDialog(); if (routing.DigitMask.Trim().Length > 0) { tt.NodeText = routing.Description.Trim(); tt.NodeValue = routing.DigitMask.Trim(); tt.Status = 2; mapTmpNode[strKey] = tt; string strTmpVal = String.Format("{0}\t{1}", new object[] { tt.NodeText, tt.NodeValue }); lstRoute.Items[k] = strTmpVal; } } }
private void cmdAdd_Click(object sender, EventArgs e) { frmRouting routing = new frmRouting(); routing.ShowDialog(); if (routing.DigitMask.Trim().Length > 0) { string strKey = System.Guid.NewGuid().ToString(); TempNode tt = new TempNode(); tt.NodeName = strKey; tt.NodeText = routing.Description.Trim(); tt.NodeValue = routing.DigitMask.Trim(); tt.Status = 1; mapTmpNode[strKey] = tt; string strTmpVal = String.Format("{0}\t{1}", new object[] { tt.NodeText, tt.NodeValue }); int j = lstRoute.Items.Add(strTmpVal); mapKey[j] = tt.NodeName; } }