Ejemplo n.º 1
0
 private void listall()
 {
     var lgnDao = new Data.UnitsDao();
     dataGridView1.DataSource = lgnDao.GetAllUnits();
     dataGridView1.RowHeadersVisible = false;
     dataGridView1.AutoGenerateColumns = false;
     dataGridView1.AutoSize = true;
     dataGridView1.Columns[0].HeaderText = "Id";
     dataGridView1.Columns[1].HeaderText = "Unit Name";
     dataGridView1.Columns[2].HeaderText = "Delete Status";
     dataGridView1.Columns[3].HeaderText = "Created On";
     dataGridView1.Columns[4].HeaderText = "Created By";
     txtUnitname.Focus();
 }
Ejemplo n.º 2
0
        private void listall()
        {
            var lgnDao = new Data.UnitsDao();

            dataGridView1.DataSource            = lgnDao.GetAllUnits();
            dataGridView1.RowHeadersVisible     = false;
            dataGridView1.AutoGenerateColumns   = false;
            dataGridView1.AutoSize              = true;
            dataGridView1.Columns[0].HeaderText = "Id";
            dataGridView1.Columns[1].HeaderText = "Unit Name";
            dataGridView1.Columns[2].HeaderText = "Delete Status";
            dataGridView1.Columns[3].HeaderText = "Created On";
            dataGridView1.Columns[4].HeaderText = "Created By";
            txtUnitname.Focus();
        }
Ejemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     String Unitname = txtUnitname.Text;
     var untDao = new Data.UnitsDao();
     int result = untDao.AddUnit(Unitname);
     if (result == 1)
     {
         MessageBox.Show("Unit Details Inserted Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.None);
         txtUnitname.Text = "";
     }
     else
     {
         MessageBox.Show("Error occured while Adding Unit Details", "Unable to add Units !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     listall();
 }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            String Unitname = txtUnitname.Text;
            var    untDao   = new Data.UnitsDao();
            int    result   = untDao.AddUnit(Unitname);

            if (result == 1)
            {
                MessageBox.Show("Unit Details Inserted Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.None);
                txtUnitname.Text = "";
            }
            else
            {
                MessageBox.Show("Error occured while Adding Unit Details", "Unable to add Units !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            listall();
        }