Example #1
0
 private void BtnUpdate_Click(object sender, EventArgs e)
 {
     a = new Bll.ClsAudience(Convert.ToInt32(dgvAudience.SelectedRows[0].Cells["AudienceCode"].Value));
     pnlAddOrUpdate.Visible = true;
     lblCode.Text           = Convert.ToString(a.AudienceTypeCode);
     txtAudienceName.Text   = a.AudienceType;
     state = "update";
 }
Example #2
0
 private void BtnAdd_Click(object sender, EventArgs e)
 {
     pnlAddOrUpdate.Visible = true;
     a                    = new Bll.ClsAudience();
     at                   = new Bll.ClsAudienceTable();
     lblCode.Text         = at.GetNewKey().ToString();
     txtAudienceName.Text = "";
     state                = "add";
 }
Example #3
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            a = new Bll.ClsAudience(Convert.ToInt32(dgvAudience.SelectedRows[0].Cells[0].Value));
            pnlAddOrUpdate.Visible = false;
            DialogResult answer = MessageBox.Show("מחיקה", "?האם אתה בטוח שהינך מעוניין למחוק קהל יעד זה לצמיתות", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2, MessageBoxOptions.RtlReading);

            if (answer == DialogResult.Yes)
            {
                try
                {
                    a.Delete();
                    MessageBox.Show("!המחיקה בוצעה בהצלחה");
                }
                catch (Exception)
                {
                    MessageBox.Show("לא ניתן למחוק קהל יעד זה");
                }
            }
        }
Example #4
0
 private void DgvAudience_DoubleClick(object sender, EventArgs e)
 {
     a = new Bll.ClsAudience(Convert.ToInt32(dgvAudience.SelectedRows[0].Cells[0].Value));
     txtAudienceName.Text = a.AudienceTypeCode.ToString();
 }