Ejemplo n.º 1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        tbl_Review obj_User_review = new tbl_Review();

        if (CheckBox2.Text.Trim() == "")
        {
            CheckBox2.Focus();
            return;
        }
        if (ddlUserName.SelectedValue == "0")
        {
            ddlUserName.Focus();
            return;
        }
        if (txtComment.Text.Trim() == "")
        {
            txtComment.Focus();
            return;
        }
        obj_User_review.tbl_Review_Rating = Rating1.CurrentRating;
        // obj_User_review. =Convert.ToInt32(ddlUserName.SelectedValue);
        obj_User_review.tbl_Review_faviourate = CheckBox2.Text.Trim();
        obj_User_review.tbl_Review_Comment    = txtComment.Text.Trim();
        if (new DataLayer().Insert_Review(obj_User_review))
        {
            MessageBox.Show("Review Submitted!!");
        }
        else
        {
            MessageBox.Show("Error!!");
        }
    }
Ejemplo n.º 2
0
        public void TextTestPositive()
        {
            CheckBox2 target   = new CheckBox2();
            string    expected = "Test Text";
            string    actual;

            target.Text = expected;
            actual      = target.Text;
            Assert.AreEqual(expected, actual);
        }
    public MainWindow()
    {
        InitializeComponent();

        List <CheckBox> checkboxes = new List <CheckBox>();

        checkboxes.Add(CheckBox1);
        checkboxes.Add(CheckBox2);

        _checkboxes = checkboxes.ToArray();

        _checkboxActions.Add(CheckBox1.GetHashCode(), OnCheckBox1Checked);
        _checkboxActions.Add(CheckBox2.GetHashCode(), OnCheckBox2Checked);
    }
Ejemplo n.º 4
0
        public void CheckedStateEventPositiveTest()
        {
            bool      eventFired = false;
            CheckBox2 target     = new CheckBox2();

            target.CheckState = CheckState.Unchecked;

            target.CheckStateChanged += new EventHandler(
                delegate(object sender, EventArgs e)
            {
                eventFired = true;
            });

            target.CheckState = CheckState.Checked;
            System.Windows.Forms.Application.DoEvents();
            Thread.Sleep(10);

            Assert.IsTrue(eventFired, "Event did not fire");
        }
Ejemplo n.º 5
0
        public void LostFocusEventPositiveTest()
        {
            bool      eventFired = false;
            CheckBox2 target     = new CheckBox2();
            Form      container  = new Form();

            container.Controls.Add(target);
            target.Focus();

            target.LostFocus += new EventHandler(
                delegate(object sender, EventArgs e)
            {
                eventFired = true;
            });

            container.Focus();
            System.Windows.Forms.Application.DoEvents();
            Thread.Sleep(10);

            Assert.IsTrue(eventFired, "Event did not fire");

            container.Dispose();
        }
Ejemplo n.º 6
0
        public void CheckBox2ConstructorTest()
        {
            CheckBox2 target = new CheckBox2();

            Assert.IsInstanceOfType(target, typeof(Control));
        }