Пример #1
0
        public void showtable()
        {
            DbConnector dbConn = new DbConnector();

            dbConn.connect();

            LabourerHandler labHnd = new LabourerHandler();

            dataGridView1.DataSource = labHnd.getAllLabourer(dbConn.getConn());
        }
Пример #2
0
        private void button7_Click(object sender, EventArgs e)
        {
            DbConnector dbConn = new DbConnector();

            dbConn.connect();

            Labourer labr = new Labourer();

            labr.Name        = textBoxName;
            labr.Age         = textBoxAge;
            labr.Gender      = textBoxGender;
            labr.DateAndTime = dateAndTime;

            LabourerHandler labHnd    = new LabourerHandler();
            int             recordCnt = labHnd.addNewLabourer(dbConn.getConn(), labr);

            MessageBox.Show(recordCnt + " record has been inserted !!");
        }