Ejemplo n.º 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            if (answerInfo == null)
                answerInfo = new Database.VKAnswerInfo();

            answerInfo.text = textBox.Text.Trim();
            try
            {
                if (humanValueBox.Text.Trim() == "")
                    answerInfo.humanValue = 0;
                else
                    answerInfo.humanValue = Convert.ToInt16(humanValueBox.Text);
            }
            catch (Exception)
            {
                MessageBox.Show("Что-то не то написано в поле " + label4.Text, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                if (androidValueBox.Text.Trim() == "")
                    answerInfo.androidValue = 0;
                else
                    answerInfo.androidValue = Convert.ToInt16(androidValueBox.Text);
            }
            catch (Exception)
            {
                MessageBox.Show("Что-то не то написано в поле " + label3.Text, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            DialogResult = DialogResult.OK;
            Close();
        }
Ejemplo n.º 2
0
        public Database.VKAnswerInfo getCurrentAnswerInfo()
        {
            if (SelectedRows.Count != 1)
            {
                return null;
            }

            if (SelectedRows[0].Cells[0].Value is DBNull)
            {
                return null;
            }

            Database.VKAnswerInfo info = new Database.VKAnswerInfo();
            info.text = Convert.ToString(SelectedRows[0].Cells["TEXT"].Value);
            info.humanValue = Convert.ToInt16(SelectedRows[0].Cells["HUMAN"].Value);
            info.androidValue = Convert.ToInt16(SelectedRows[0].Cells["ANDROID"].Value);

            return info;
        }
Ejemplo n.º 3
0
        public override void Init(ClientUI.UserObjectEventArgs args)
        {
            base.Init(args);

            bar.Visible = true;

            sessionId = Convert.ToUInt64(args.data["SESSION_ID"]);
            questionId = Convert.ToUInt64(args.data["QUESTION_ID"]);
            questionNum = Convert.ToUInt64(args.data["QUESTION_NUM"]);
            value = Convert.ToInt16(args.data["VALUE"]);
            middle = Convert.ToDouble(args.data["MIDDLE"]);
            qText = Convert.ToString(args.data["QUESTION_TEXT"]);

            nameLabel.Text = info.name;
            questionNumLabel.Text = "Вопрос №" + Convert.ToString(questionNum);
            questionText.Text = "Текст вопроса: " + qText;

            waitingTimer.Start();

            statusLabel.Text = "Ждём ответа";
            answerText.Text = "";
            answerInfo = null;
        }
Ejemplo n.º 4
0
        void waitingTimer_Waiting(object sender, EventArgs e)
        {
            waitingTimer.Stop();

            answerInfo = getDatabase().getAnswerForSessionQuestion(sessionId, questionId);
            if (answerInfo != null)
            {
                answerText.Text = "Ответ: " + answerInfo.text;
                myTimer.Tick -= waitingTimer_Waiting;
                myTimer.Interval = 2000;
                myTimer.Tick += new EventHandler(myTimer_Success);
                myTimer.Start();
            }
            else
            {
                waitingTimer.Enabled = true;
            }
        }