private void btnDonor_Click(object sender, EventArgs e)
        {
            EditDonorForm frmTmp = new EditDonorForm(CCFBGlobal.connectionString, true);
            DialogResult  dr     = frmTmp.ShowDialog(this);

            if (dr == DialogResult.Yes)
            {
                int    newDonorId   = frmTmp.SelectedId;
                string newDonorName = frmTmp.SelectedName;
                frmTmp.Close();
                frmTmp.Dispose();
                Button btn    = (Button)sender;
                string tagVal = btn.Tag.ToString();
                foreach (TextBox tb in tpDonorPercent.Controls.OfType <TextBox>())
                {
                    if (tb.Tag.ToString() == tagVal)
                    {
                        tb.Text = newDonorId.ToString();
                        CCFBPrefs.SaveValue(tagVal, newDonorId.ToString());
                        dataChanged = true;
                        break;
                    }
                }

                filllblDonor(tagVal, newDonorName);
            }
        }
Пример #2
0
        private void btnDonor_Click(object sender, EventArgs e)
        {
            EditDonorForm frmTmp = new EditDonorForm(CCFBGlobal.connectionString, true);

            frmTmp.ShowDialog(this);
            int    newDonorId   = frmTmp.SelectedId;
            string newDonorName = frmTmp.SelectedName;

            frmTmp.Close();
            frmTmp.Dispose();
            Button btn    = (Button)sender;
            string tagVal = btn.Tag.ToString();

            foreach (TextBox tb in grpbxDonors.Controls.OfType <TextBox>())
            {
                if (tb.Tag.ToString() == tagVal)
                {
                    tb.Text = newDonorId.ToString();
                    CCFBPrefs.SaveValue(tagVal, newDonorId.ToString());
                    dataChanged = true;
                    break;
                }
            }
            foreach (Label lbl in grpbxDonors.Controls.OfType <Label>())
            {
                if (lbl.Tag.ToString() == tagVal)
                {
                    if (newDonorName == "")
                    {
                        lbl.Text = ".....";
                    }
                    else
                    {
                        lbl.Text = newDonorName;
                    }
                    break;
                }
            }
        }