コード例 #1
0
        private void LoatL()
        {
            DateTime ngaydau, ngaycuoi;

            songaylam = "0";
            if (m == 0)
            {
                ngaydau  = Convert.ToDateTime(thang + "/" + "01/" + nam);
                ngaycuoi = Convert.ToDateTime(thang + "/" + "30/" + nam);
            }
            else
            {
                ngaydau  = Convert.ToDateTime(txtThang.Text + "/" + "01/" + txtNam.Text);
                ngaycuoi = Convert.ToDateTime(txtThang.Text + "/" + "30/" + txtNam.Text);
            }
            btnCapNhat.Enabled = false;
            LbTen.Text         = null;
            LbCV.Text          = null;
            lbTB.Text          = null;
            mydt.loadcombobox(comboHSL, "select HeSoLuong from tblLuong", "HeSoLuong");
            dt.Clear();
            dt = sqlcong.TongLuongNV("0");
            gridViewLuong.DataSource = dt;
            for (int i = 0; i < gridViewLuong.RowCount; i++)
            {
                manv = gridViewLuong.Rows[i].Cells["ma"].Value == null ?
                       string.Empty : gridViewLuong.Rows[i].Cells["ma"].Value.ToString();
                gridViewLuong.Rows[i].Cells["SNL"].Value = LaySoNgayLam(manv, ngaydau, ngaycuoi);
                gridViewLuong.Rows[i].Cells["TT"].Value  = TienThuong(manv, ngaycuoi);
                gridViewLuong.Rows[i].Cells["TP"].Value  = TienPhat(manv, ngaycuoi);
                gridViewLuong.Rows[i].Cells["PC"].Value  = tienPhuCap(manv, ngaycuoi);
                tongluong = TinhLuong1(manv, songaylam, ngaydau, ngaycuoi);
                gridViewLuong.Rows[i].Cells["TL"].Value = String.Format("{0:0,0}", tongluong);
            }
        }
コード例 #2
0
 private void HosoNV_Load(object sender, EventArgs e)
 {
     gridViewHSNV.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
     gridViewHSNV.DataSource          = hSNV().Tables[0];
     ngaySinh.CustomFormat            = "MM/dd/yyyy";
     mydt.loadcombobox(combPB, "Select MaPhongBan from tblPhongBan", "MaPhongBan");
     mydt.loadcombobox(combCV, "select MaChucVu from tblChucVu", "MaChucVu");
     mydt.loadcombobox(comHSL, "select HeSoLuong from tblLuong", "HeSoLuong");
 }