Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                ADOStudy.Info dataInsert = new ADOStudy.Info();
                dataInsert.Name = txtBoxInsertName.Text;
                dataInsert.Gender = comBoxInsertGender.Text;
                ADOStudy.ADO opInsert = new ADOStudy.ADO();
                bool res = opInsert.Insert(dataInsert);
                if (res == true)
                {
                    lblResult.Text = "Insert done successfully";
                }
                else
                {
                    lblResult.Text = "Insert Aborted";
                }
            }
            if (checkBox2.Checked == true)
            {
                DataSet dsRetrieve = new DataSet();
                ADOStudy.ADO opretrive = new ADOStudy.ADO();
                dsRetrieve = opretrive.Retrieve();
                dgRetrieve.AutoGenerateColumns = true;
                dgRetrieve.DataSource = dsRetrieve;

                dgRetrieve.Visible = true;
            }
            if (checkBox3.Checked == true)
            {
                ADOStudy.UpdateInfo dataUpdate = new ADOStudy.UpdateInfo();
                dataUpdate.Name = txtBoxUpdateName.Text;
                dataUpdate.ID = Convert.ToInt32(txtBoxUpdateId.Text);
                dataUpdate.Gender = comBoxUpdateGender.Text;
                ADOStudy.ADO opUpdate = new ADOStudy.ADO();
                bool res = opUpdate.Update(dataUpdate);
                if (res == true)
                {
                    lblResult.Text = "Update done successfully";
                }
                else
                {
                    lblResult.Text = "Update Aborted";
                }
            }
            if (checkBox4.Checked == true)
            {
                ADOStudy.ADO opDelete = new ADOStudy.ADO();
                bool res = opDelete.Delete();
                if (res == true)
                {
                    lblResult.Text = "Deleted successfully";
                }
                else
                {
                    lblResult.Text = "Delete Aborted";
                }
            }
        }
Esempio n. 2
0
 public void TestMethod2()
 {
     ADOStudy.ADO unitADO = new ADOStudy.ADO();
     DataSet dsRetrieve = new DataSet();
     dsRetrieve = unitADO.Retrieve();
     
     Assert.IsNotNull(unitADO.Retrieve());
 }
Esempio n. 3
0
        public void TestMethod1()
        {
            ADOStudy.ADO unitADO = new ADOStudy.ADO();
            
            ADOStudy.Info unitInfo = new ADOStudy.Info();
            unitInfo.Name = "Aashish";
            unitInfo.Gender = "Male";

            Assert.IsTrue(unitADO.Insert(unitInfo));
        }