Esempio n. 1
0
        public void nextCall()
        {
            DatabaseAccess tDA = new DatabaseAccess("[Survey].[NextCall]");
            tDA.AddParam("@EmpID", mEmployee.ID);

            SqlDataReader r;
            try
            {
                r = tDA.GetReader();
            }
            catch (SqlException ex)
            {
                r = null;
            }

            if (r != null && r.Read())
            {
                mCurrentCallID = (int)r["CallID"];

                txtText.Text = "Bonjour Monsieur " + r["NameClient"] + ", "
                    + "Je suis Monsieur " + mEmployeeName + ", je travaille pour la firme de sondage Baboubine. " +
                    "Aimeriez-vous participer à un concours afin de courir la chance de gagner une Porsche? " +
                    "Pour participer il ne suffit que de 3 minutes de votre temps pour effectuer un court sondage sur votre achat de " + r["ItemBought"] + " chez " + r["Company"] + ". " +
                    "Êtes-vous satisfait du produit acheté?";
                lblTitle.Text = r["NameClient"] + " - " + r["Phone"];
                this.Text = (string)r["NameClient"];
                rtbComment.Text = "Commentaires...";
                rtbComment.BackColor = Color.Gainsboro;
                btnPause.Image = Image.FromFile(Path.GetDirectoryName(Application.ExecutablePath) + @"\Images\pause.png");
                btnHappy.Focus();
            }
            else
            {
                lblTitle.Text = "";
                rtbComment.Text = "";
                txtText.Text = "";
                MessageBox.Show("Tous les appels a effectuer ont été faits!", "Fini", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                this.Close();
            }
            tDA.Dispose();
        }
Esempio n. 2
0
        public void saveCall()
        {
            DatabaseAccess tDA = new DatabaseAccess("[Survey].[SaveCall]");
            tDA.AddParam("@CallID", mCurrentCallID);
            tDA.AddParam("@AnswerID", mLastAnswerClicked);
            tDA.AddParam("@CallLength", mCallTimer);
            tDA.AddParam("@Comments", rtbComment.Text.Trim() == "Commentaires..." ? "" : rtbComment.Text.Trim());

            tDA.Execute();

            tDA.Dispose();

            mCallTimer = 0;
            mLastAnswerClicked = 0;
            ClearFlat();
        }