Exemplo n.º 1
0
        private void metroButton15_Click(object sender, EventArgs e)
        {
            if (metroGrid6.Rows.Count != 0)
            {
                DistrictModel.id       = metroGrid6.Rows[metroGrid6.SelectedRows[0].Index].Cells[0].Value.ToString();
                DistrictModel.name     = metroGrid6.Rows[metroGrid6.SelectedRows[0].Index].Cells[1].Value.ToString();
                DistrictModel.province = districtGrid.Rows[districtGrid.SelectedRows[0].Index].Cells[1].Value.ToString();

                add_district update = new add_district(true);
                update.ShowDialog();
            }
            else if (metroGrid6 != null)
            {
                MetroMessageBox.Show(this, "You need to select a district first", "Update Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                MetroMessageBox.Show(this, "You need to add a district first", "Update Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 2
0
        private void metroButton16_Click(object sender, EventArgs e)
        {
            add_district add = new add_district();

            add.ShowDialog();
        }