Exemplo n.º 1
0
        // TODO finish

        private void DeleteQuestion()
        {
            if (MessageBox.Show(CurrentQuestion.VarName + " will be deleted from " + CurrentSurvey.SurveyCode + ". \r\n Do you want to proceed?", "Confirm Delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                int nextID = bs.Position;

                // backup comments
                DBAction.BackupComments(CurrentQuestion.ID);
                // delete question from database
                DBAction.DeleteQuestion(CurrentQuestion.VarName.FullVarName, CurrentQuestion.SurveyCode);
                // remove question from the list
                CurrentSurvey.Questions.Remove(CurrentQuestion);
                // remove current item from bindingsource
                bs.RemoveCurrent();

                // refresh comments

                // delete varname if no more uses
                Renumber = true;
            }
            else
            {
                return;
            }

            if (MessageBox.Show("Do you want to document this deletion? (Click 'No' if you already have)", "Document", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
            }
            else
            {
            }
        }