Esempio n. 1
0
        private void BlockForm_Load(object sender, EventArgs e)
        {
            List <ViewAbleDistricts> viewDistricts = DistrictHandler.GetViewAbleDistricts();

            foreach (ViewAbleDistricts vdist in viewDistricts)
            {
                districtComboBox.Items.Add(vdist.DistrictName);
            }
        }
Esempio n. 2
0
        private void VoterForm_Load(object sender, EventArgs e)
        {
            List <ViewAbleDistricts> viewDist = DistrictHandler.GetViewAbleDistricts();

            foreach (ViewAbleDistricts vDist in viewDist)
            {
                selectDistrcitComboBox.Items.Add(vDist.DistrictName);
                districtComboBox.Items.Add(vDist.DistrictName);
            }
        }
Esempio n. 3
0
        private void SeatForm_Load(object sender, EventArgs e)
        {
            List <ViewAbleDistricts> viewDistrict = DistrictHandler.GetViewAbleDistricts();

            foreach (ViewAbleDistricts vdist in viewDistrict)
            {
                addSeatComboBox.Items.Add(vdist.DistrictName);
                selectDistrictComboBox.Items.Add(vdist.DistrictName);
            }
        }
Esempio n. 4
0
        private void CandidateForm_Load(object sender, EventArgs e)
        {
            List <ViewAbleTeams>     vTeams = TeamHandler.GetViewAbleTeams();
            List <ViewAbleDistricts> vDists = DistrictHandler.GetViewAbleDistricts();

            foreach (ViewAbleTeams vteam in vTeams)
            {
                teamComboBox.Items.Add(vteam.TeamName);
            }
            foreach (ViewAbleDistricts vdist in vDists)
            {
                selectDistrictComboBox.Items.Add(vdist.DistrictName);
                districtComboBox.Items.Add(vdist.DistrictName);
            }
        }
Esempio n. 5
0
 private void deleteDistrictButton_Click(object sender, EventArgs e)
 {
     if (districtGrid.DataSource != null)
     {
         int          rowIndex = districtGrid.CurrentRow.Index;
         string       dname    = districtGrid.Rows[rowIndex].Cells[0].Value.ToString();
         DialogResult dr       = MessageBox.Show(string.Format("Are you sure to delete '{0}' from the database?", dname), "Confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             DistrictHandler.DeleteDistrict(dname);
             MessageBox.Show("Deleted");
             districtGrid.DataSource = DistrictHandler.GetViewAbleDistricts();
         }
     }
 }
Esempio n. 6
0
 private void addDistrictButton_Click(object sender, EventArgs e)
 {
     if (addDistrictTextBox.Text != "")
     {
         DialogResult dr = MessageBox.Show(string.Format("Are you sure to add '{0}' to the database?", addDistrictTextBox.Text), "Confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             if (DistrictHandler.AddDistrict(addDistrictTextBox.Text))
             {
                 MessageBox.Show("Successfully added district.");
             }
             else
             {
                 MessageBox.Show("District name already present.");
             }
             addDistrictTextBox.Text = "";
             districtGrid.DataSource = DistrictHandler.GetViewAbleDistricts();
         }
     }
     else
     {
         MessageBox.Show("Enter a district name.");
     }
 }
Esempio n. 7
0
 private void showDistrictsButton_Click(object sender, EventArgs e)
 {
     districtGrid.DataSource = DistrictHandler.GetViewAbleDistricts();
 }