Esempio n. 1
0
        private void btnCalculator_Click(object sender, EventArgs e) // pass
        {
            int      a    = Convert.ToInt32(txtDay.Text);
            int      chon = 0;
            ChucNang cng  = new ChucNang();
            double   kq   = 0;


            if (cmbPosition.Text == "Giám Đốc")

            {
                chon = 1;
                kq   = cng.TinhLuong(a, chon);
                dgvDanhSach.SelectedRows[0].Cells["day"].Value   = txtDay.Text;
                dgvDanhSach.SelectedRows[0].Cells["Luong"].Value = kq.ToString();
            }
            if (cmbPosition.Text == "Phó Giám Đốc")
            {
                chon = 2;
                kq   = cng.TinhLuong(a, chon);
                dgvDanhSach.SelectedRows[0].Cells["day"].Value   = txtDay.Text;
                dgvDanhSach.SelectedRows[0].Cells["Luong"].Value = kq.ToString();
            }
            if (cmbPosition.Text == "Trưởng Phòng")
            {
                chon = 3;
                kq   = cng.TinhLuong(a, chon);

                dgvDanhSach.SelectedRows[0].Cells["day"].Value   = txtDay.Text;
                dgvDanhSach.SelectedRows[0].Cells["Luong"].Value = kq.ToString();
            }
            if (cmbPosition.Text == "Nhân Viên")
            {
                chon = 4;
                kq   = cng.TinhLuong(a, chon);
                dgvDanhSach.SelectedRows[0].Cells["day"].Value   = txtDay.Text;
                dgvDanhSach.SelectedRows[0].Cells["Luong"].Value = kq.ToString();
            }
            txtID.Text = txtDay.Text = txtName.Text = txtAddress.Text = txtPhone.Text = cmbPosition.Text = "";
            txtID.Focus();
        }