Exemplo n.º 1
0
        protected void ButtonAddPollQuestion_Click(object sender, EventArgs e)
        {
            PollQuestionDb pq = new PollQuestionDb()
            {
                PollQuestion = this.add_TextBoxPollQuestion.Text
            };

            this.GridViewPolls.DataSource = OperationManager.Singleton.izvrsiOperaciju(new OpPollInsertOnlyQuestion()
            {
                PollQuestion = pq
            }).DbItems.Cast <PollQuestionDb>().ToArray();
            this.GridViewPolls.DataBind();
        }
Exemplo n.º 2
0
        protected void ButtonUpdatePollQuestion_Click(object sender, EventArgs e)
        {
            PollQuestionDb pq = new PollQuestionDb()
            {
                IdPollQuestion = Convert.ToInt32(this.LabelPollQuestionId.Text),
                PollQuestion   = this.tbPollQuestion.Text
            };

            this.GridViewPolls.DataSource = OperationManager.Singleton.izvrsiOperaciju(new OpPollUpdateOnlyQuestion()
            {
                PollQuestion = pq
            }).DbItems.Cast <PollQuestionDb>().ToArray();
            this.GridViewPolls.DataBind();
        }
Exemplo n.º 3
0
        protected void btnDeletePoll_Click(object sender, EventArgs e)
        {
            Button         btn = (Button)sender;
            PollQuestionDb pq  = new PollQuestionDb()
            {
                IdPollQuestion = Convert.ToInt32(btn.CommandArgument)
            };

            this.GridViewPolls.DataSource = OperationManager.Singleton.izvrsiOperaciju(new OpPollDeleteQuestion()
            {
                PollQuestion = pq
            }).DbItems.Cast <PollQuestionDb>().ToArray();
            this.GridViewPolls.DataBind();

            this.PanelShowData.Visible = false;
        }
Exemplo n.º 4
0
        protected void Add_Click(object sender, EventArgs e)
        {
            PollAnswersDb ans = new PollAnswersDb()
            {
                PollAnswer = this.tbAddPollAnswer.Text
            };
            PollQuestionDb pq = new PollQuestionDb()
            {
                IdPollQuestion = Convert.ToInt32(this.LabelPollQuestionId.Text)
            };

            this.DropDownListPollAnswers.DataSource = OperationManager.Singleton.izvrsiOperaciju(new OpPollInsertOnlyAnswer()
            {
                Answer = ans, PollQuestion = pq
            }).DbItems.Cast <PollAnswersDb>().ToArray();
            this.DropDownListPollAnswers.DataTextField  = "PollAnswer";
            this.DropDownListPollAnswers.DataValueField = "IdPollAnswer";
            this.DropDownListPollAnswers.DataBind();
        }
Exemplo n.º 5
0
        protected void tbDeletePollAnswer_Click(object sender, EventArgs e)
        {
            PollAnswersDb ans = new PollAnswersDb()
            {
                IdPollAnswer = Convert.ToInt32(this.DropDownListPollAnswers.SelectedValue)
            };
            PollQuestionDb pq = new PollQuestionDb()
            {
                IdPollQuestion = Convert.ToInt32(this.LabelPollQuestionId.Text)
            };

            this.DropDownListPollAnswers.DataSource = OperationManager.Singleton.izvrsiOperaciju(new OpPollDeleteOnlyAnswer()
            {
                Answer = ans, PollQuestion = pq
            }).DbItems.Cast <PollAnswersDb>().ToArray();
            this.DropDownListPollAnswers.DataTextField  = "PollAnswer";
            this.DropDownListPollAnswers.DataValueField = "IdPollAnswer";
            this.DropDownListPollAnswers.DataBind();
            if (this.DropDownListPollAnswers.Items.Count > 0)
            {
                this.tbPollAnswerUpdate.Text = this.DropDownListPollAnswers.Items[0].Text;
            }
        }