コード例 #1
0
        private void BtnGuidanceDelete_Click_1(object sender, EventArgs e)
        {
            int i = 0;

            if (listViewGuidance.SelectedItems.Count == 0)
            {
                return;
            }
            DialogResult dialogResult = MessageBox.Show("Are you sure that you want to delete the selected guidance?", " ", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.No)
            {
                return;
            }

            foreach (object guidance in listViewGuidance.SelectedItems)
            {
                SomerenModel.Guidance g = (SomerenModel.Guidance)listViewGuidance.SelectedItems[i].Tag;
                i++;
                SomerenDAL.Guidance_DAO guidanceDelete = new SomerenDAL.Guidance_DAO();
                guidanceDelete.Db_Delete_Guidance(g);
            }

            showPanel("Guidance");
            pnlGuidanceDelete.Show();
        }
コード例 #2
0
        private void BtnGuidanceAdd_Click(object sender, EventArgs e)
        {
            int i = 0;

            if (listViewTeachersToGuidance.SelectedItems.Count == 0)
            {
                return;
            }
            foreach (object guidance in listViewTeachersToGuidance.SelectedItems)
            {
                SomerenModel.Guidance g = (SomerenModel.Guidance)listViewTeachersToGuidance.SelectedItems[i].Tag;
                i++;
                SomerenDAL.Guidance_DAO guidanceAdd = new SomerenDAL.Guidance_DAO();
                guidanceAdd.Db_Add_Guidance(g);
            }

            showPanel("Guidance");
            pnlGuidanceDelete.Hide();
            pnlGuidanceAdd.Show();
        }