public void LoadBangBaoCao() { PhieuDKHP_DAL phieuDKHP_DAL = new PhieuDKHP_DAL(dbConnection); BangBaoCao = phieuDKHP_DAL.BaoCaoSinhVienChuaHoanThanhHP(HocKy.MaHocKy, NamHoc); OnPropertyChanged("BangBaoCao"); }
public void LoadDanhMucPhieuDKHP() { PhieuDKHP_DAL phieuDKHP_DAL = new PhieuDKHP_DAL(dbConnection); DanhMucPhieuDKHP = phieuDKHP_DAL.ReadItemsByMSSV(sinhVien.MaSo); OnPropertyChanged("DanhMucPhieuDKHP"); }
private void SetMaSoIfInvalid() { PhieuDKHP_DAL phieuDKHP_DAL = new PhieuDKHP_DAL(dbConnection); while (phieuDKHP_DAL.IsMaSoExisted(phieuDKHP.SoPhieuDKHP)) { phieuDKHP.SoPhieuDKHP++; } OnPropertyChanged("PhieuDKHP"); }
private string CheckThongTinPhieuThuHP() { string invalidProperties = ""; SetMaSoIfInvalid(); PhieuDKHP_DAL phieuDKHP_DAL = new PhieuDKHP_DAL(dbConnection); if (!phieuDKHP_DAL.IsMaSoExisted(phieuThuHP.PhieuDKHP)) { invalidProperties += "\nPhiếu ĐKHP không hợp hệ"; } if (phieuThuHP.SoTienThu == 0 || phieuDKHP.SoTienConLai < 0) { invalidProperties += "\nSố Tiền Thu không hợp hệ"; } return(invalidProperties); }
private void XacNhanLuuPhieuThuHP() { phieuThuHP.PhieuDKHP = phieuDKHP.SoPhieuDKHP; string errorString = CheckThongTinPhieuThuHP(); if (errorString == "") { PhieuThuHP_DAL phieuThuHP_DAL = new PhieuThuHP_DAL(dbConnection); PhieuDKHP_DAL phieuDKHP_DAL = new PhieuDKHP_DAL(dbConnection); phieuThuHP_DAL.CreateItem(phieuThuHP); phieuDKHP_DAL.UpdateSoTienConLai(phieuDKHP); MessageBox.Show("Lưu Phiếu Thu Học Phí thành công"); NhapLaiThongTinPhieuThuHP(); SetMaSoIfInvalid(); } else { MessageBox.Show(errorString, "ERROR"); } }
private void XacNhanLuuPhieuDKHP() { phieuDKHP.MaSoSV = sinhVien.MaSo; string errorString = CheckThongTinPhieuDKHP(); if (errorString != "") { MessageBox.Show(errorString, "ERROR"); return; } List <CT_PhieuDKHP> cT_PhieuDKHPs = new List <CT_PhieuDKHP>(); foreach (DataRow row in CT_PhieuDKHPs.Rows) { CT_PhieuDKHP cT_PhieuDKHP = new CT_PhieuDKHP(); int number; if (!int.TryParse(row["MonHoc"].ToString(), out number)) { continue; } cT_PhieuDKHP.MonHoc = number; cT_PhieuDKHPs.Add(cT_PhieuDKHP); } errorString = CheckCT_PhieuDKHPs(cT_PhieuDKHPs); if (errorString == "") { PhieuDKHP_DAL phieuDKHP_DAL = new PhieuDKHP_DAL(dbConnection); CT_PhieuDKHP_DAL cT_PhieuDKHP_DAL = new CT_PhieuDKHP_DAL(dbConnection); phieuDKHP_DAL.CreateItem(phieuDKHP); foreach (CT_PhieuDKHP cT_PhieuDKHP in cT_PhieuDKHPs) { cT_PhieuDKHP_DAL.CreateItem(cT_PhieuDKHP); } MessageBox.Show("Lưu Phiếu ĐKHP thành công"); } else { MessageBox.Show(errorString, "ERROR"); } }