public void LoadForm(string maDV, string maLop)
 {
     labelTenDV.Text = DichVuSucKhoeBLL.GetTenDV(maDV);
     this.maLop      = maLop;
     this.maDV       = maDV;
     LoadDataGridView();
 }
Exemple #2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            if (dgvSucKhoe.SelectedRows.Count > 0)
            {
                DichVuSucKhoe dichVu = new DichVuSucKhoe();
                dichVu.MaDV     = dgvSucKhoe.SelectedRows[0].Cells["MaDichVu"].Value.ToString();
                dichVu.TenDV    = dgvSucKhoe.SelectedRows[0].Cells["TenDichVu"].Value.ToString();
                dichVu.NgayKham = DateTime.Parse(dgvSucKhoe.SelectedRows[0].Cells["NgayKham"].Value.ToString());
                dichVu.ChiTiet  = dgvSucKhoe.SelectedRows[0].Cells["ChiTiet"].Value.ToString();
                dichVu.ChiPhi   = decimal.Parse(dgvSucKhoe.SelectedRows[0].Cells["ChiPhi"].Value.ToString());

                DialogResult result = MessageBox.Show("Bạn có muốn xóa dịch vụ " + dichVu.TenDV + " với mã là: " + dichVu.MaDV + " không?",
                                                      "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    if (DichVuSucKhoeBLL.XoaDichVu(dichVu))
                    {
                        MessageBox.Show("Đã xóa dịch vụ thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        LoadDataGridView();
                        txtMaDV.Clear();
                        txtTenDV.Clear();
                        txtChiPhi.Clear();
                        txtChiTiet.Clear();
                        dtNgayKham.Value = DateTime.Today;
                    }
                }
            }
            else
            {
                MessageBox.Show("Bạn phải chọn một hoạt động để xóa.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
 private void LoadDanhSachDichVu()
 {
     cboDichVu.DataSource    = DichVuSucKhoeBLL.GetListDichVu();
     cboDichVu.DisplayMember = "TenDichVu";
     cboDichVu.ValueMember   = "MaDichVu";
     cboDichVu.Text          = "";
 }
Exemple #4
0
 public void LoadForm(string maDV)
 {
     this.maDV       = maDV;
     labelTenDV.Text = DichVuSucKhoeBLL.GetTenDV(maDV);
     if (maDV != "")
     {
         LoadDataGridView();
     }
 }
Exemple #5
0
 private void dgvListLop_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex > -1)
     {
         txtMaLop.Text      = dgvListLop.Rows[e.RowIndex].Cells["MaLop"].Value.ToString();
         txtTenLop.Text     = dgvListLop.Rows[e.RowIndex].Cells["TenLop"].Value.ToString();
         txtSiSoLop.Text    = dgvListLop.Rows[e.RowIndex].Cells["SiSo"].Value.ToString();
         txtTreThamGia.Text = DichVuSucKhoeBLL.GetListTreThamGiaDichVu(maDV, txtMaLop.Text).Length.ToString();
     }
 }
Exemple #6
0
 private void LoadDataGridView()
 {
     dgvSucKhoe.DataSource = DichVuSucKhoeBLL.GetListDichVu();
     string[] listProp = { "MaDichVu", "TenDichVu", "NgayKham" };
     ControlFormat.DataGridViewFormat(dgvSucKhoe, listProp);
     dgvSucKhoe.Columns["MaDichVu"].HeaderText  = "Mã dịch vụ";
     dgvSucKhoe.Columns["TenDichVu"].HeaderText = "Tên dịch vụ";
     dgvSucKhoe.Columns["NgayKham"].HeaderText  = "Ngày khám";
     dgvSucKhoe.Columns["TenDichVu"].Width      = 250;
 }
 private void LoadDataGridView()
 {
     dgvListTre.DataSource = DichVuSucKhoeBLL.GetListSucKhoe(cboDichVu.SelectedValue.ToString(), cboLop.SelectedValue.ToString());
     string[] listProp = { "MaTre", "HoTenTre", "CanNang", "ChieuCao" };
     ControlFormat.DataGridViewFormat(dgvListTre, listProp);
     dgvListTre.Columns["MaTre"].HeaderText    = "Mã trẻ";
     dgvListTre.Columns["HoTenTre"].HeaderText = "Họ tên trẻ";
     dgvListTre.Columns["CanNang"].HeaderText  = "Cân nặng";
     dgvListTre.Columns["ChieuCao"].HeaderText = "Chiều cao";
 }
Exemple #8
0
        private void btnThemMoi_Click(object sender, EventArgs e)
        {
            txtMaDV.Text     = "";
            txtTenDV.Text    = "";
            dtNgayKham.Value = DateTime.Today;
            txtChiPhi.Text   = "";
            txtChiTiet.Text  = "";

            // auto generate MaDichVu here
            txtMaDV.Text = DichVuSucKhoeBLL.AutoMaDichVu();
        }
Exemple #9
0
 private void btnApDungTatCa_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < dgvListLop.Rows.Count; i++)
     {
         listLop[dgvListLop.Rows[i].Cells["MaLop"].Value.ToString()] = true;
     }
     if (DichVuSucKhoeBLL.CapNhatLopThamGia(listLop, maDV))
     {
         MessageBox.Show("Cập nhật lớp tham gia thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         LoadDataGridView();
     }
 }
Exemple #10
0
 private void GetDataGridViewKetQua()
 {
     if (cboThang.Text != "" && cboNam.Text != "")
     {
         dgvKetQua.DataSource = DichVuSucKhoeBLL.GetListKetQuaSucKhoeTheoThang(maTre, int.Parse(cboThang.Text), int.Parse(cboNam.Text));
         string[] listProp = { "NgayKham", "CanNang", "ChieuCao" };
         ControlFormat.DataGridViewFormat(dgvKetQua, listProp);
         dgvKetQua.Columns["NgayKham"].HeaderText = "Ngày khám";
         dgvKetQua.Columns["NgayKham"].Width      = 120;
         dgvKetQua.Columns["CanNang"].HeaderText  = "Cân nặng";
         dgvKetQua.Columns["ChieuCao"].HeaderText = "Chiều cao";
     }
 }
Exemple #11
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (txtHoTen.Text != "")
     {
         //cap nhat suc khoe cho tre
         if (DichVuSucKhoeBLL.CapNhatSucKhoe(cboDichVu.SelectedValue.ToString(), dgvListTre.CurrentRow.Cells["MaTre"].Value.ToString(),
                                             float.Parse(txtCanNang.Text), float.Parse(txtChieuCao.Text), txtTinhTrang.Text))
         {
             MessageBox.Show("Cập nhật sức khỏe thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("Bạn phải chọn một trẻ để lưu sức khỏe", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Exemple #12
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < dgvListLop.Rows.Count; i++)
     {
         string maLop = dgvListLop.Rows[i].Cells["MaLop"].Value.ToString();
         if (dgvListLop.Rows[i].Cells["CheckBox"].Value.ToString() == "True" || dgvListLop.Rows[i].Cells["CheckBox"].Value.ToString() == "true")
         {
             listLop[maLop] = true;
         }
         else
         {
             listLop[maLop] = false;
         }
     }
     if (DichVuSucKhoeBLL.CapNhatLopThamGia(listLop, maDV))
     {
         MessageBox.Show("Cập nhật lớp tham gia thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #13
0
 private void btnTreThamGia_Click(object sender, EventArgs e)
 {
     string[] lopThamGia = DichVuSucKhoeBLL.GetListLopThamGia(maDV);
     if (dgvListLop.SelectedRows.Count > 0)
     {
         if (!CheckLopThamGia(dgvListLop.SelectedRows[0].Cells["MaLop"].Value.ToString(), lopThamGia))
         {
             MessageBox.Show("Lớp này không tham gia dịch vụ y tế này, bạn cần chọn và lưu lớp này tham gia dịch vụ trước mới có thể chỉnh sửa danh sách trẻ tham gia dịch vụ.",
                             "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             frmMain parentForm = (this.Parent.Parent as frmMain);
             parentForm.UpdateSubView("DanhSachTreThamGiaDichVu");
             View_DanhSachTreThamGiaDichVu view = (View_DanhSachTreThamGiaDichVu)parentForm.GetSubView("DanhSachTreThamGiaDichVu");
             view.LoadForm(maDV, dgvListLop.SelectedRows[0].Cells["MaLop"].Value.ToString());
         }
     }
 }
Exemple #14
0
 private void dgvListLop_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     string[] lopThamGia = DichVuSucKhoeBLL.GetListLopThamGia(maDV);
     listLop.Clear();
     if (lopThamGia != null)
     {
         for (int i = 0; i < dgvListLop.RowCount; i++)
         {
             DataGridViewCheckBoxCell chkBoxCell = (DataGridViewCheckBoxCell)dgvListLop.Rows[i].Cells["CheckBox"];
             if (CheckLopThamGia(dgvListLop.Rows[i].Cells["MaLop"].Value.ToString(), lopThamGia))
             {
                 chkBoxCell.Value = "true";
                 listLop.Add(dgvListLop.Rows[i].Cells["MaLop"].Value.ToString(), true);
             }
             else
             {
                 chkBoxCell.Value = "false";
                 listLop.Add(dgvListLop.Rows[i].Cells["MaLop"].Value.ToString(), false);
             }
         }
     }
 }
Exemple #15
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     //luu dich vu
     if (txtTenDV.Text != "" && txtChiPhi.Text != "")
     {
         DichVuSucKhoe dichVu = new DichVuSucKhoe();
         dichVu.MaDV     = txtMaDV.Text;
         dichVu.TenDV    = txtTenDV.Text;
         dichVu.NgayKham = dtNgayKham.Value;
         dichVu.ChiTiet  = txtChiTiet.Text;
         dichVu.ChiPhi   = decimal.Parse(txtChiPhi.Text);
         if (DichVuSucKhoeBLL.LuuDichVu(dichVu))
         {
             MessageBox.Show("Đã lưu dịch vụ thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             LoadDataGridView();
         }
     }
     else
     {
         MessageBox.Show("Tên dịch vụ và chi phí không được để trống", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #16
0
        private void FillValue()
        {
            ReportParameter[] key      = new ReportParameter[8];
            ReportParameter   Nam      = new ReportParameter("Nam", nam.ToString());
            ReportParameter   NgayIn   = new ReportParameter("NgayIn", DateTime.Today.ToShortTimeString());
            ReportParameter   TenTre   = new ReportParameter("TenTre", TreBLL.GetHoTen(maTre));
            ReportParameter   TenDV    = new ReportParameter("TenDV", DichVuSucKhoeBLL.GetTenDV(maDV));
            ReportParameter   NgayKham = new ReportParameter("NgayKham", DichVuSucKhoeBLL.GetDV(maDV).NgayKham.ToShortDateString());
            ReportParameter   CanNang  = new ReportParameter("CanNang", canNang);
            ReportParameter   ChieuCao = new ReportParameter("ChieuCao", chieuCao);
            ReportParameter   TheTrang = new ReportParameter("TinhTrang", theTrang);

            key[0] = NgayIn;
            key[1] = Nam;
            key[2] = TenTre;
            key[3] = TenDV;
            key[4] = NgayKham;
            key[5] = CanNang;
            key[6] = ChieuCao;
            key[7] = TheTrang;

            reportViewer1.LocalReport.SetParameters(key);
        }