private void NhapLaiThongTinPhieuDKHP() { PhieuDKHP = new PhieuDKHP(); SinhVien = new SinhVien(); DoiTuongUuTien = new DoiTuongUuTien(); LoadDanhMucMHM(); }
public void UpdateSoTienConLai(PhieuDKHP phieuDKHP) { try { if (connection.State != ConnectionState.Open) { connection.Open(); } OleDbCommand command = new OleDbCommand( "UPDATE PHIEU_DKHP SET SoTienConLai=@sotiencl WHERE SoPhieuDKHP=@maso", connection); command.Parameters.Add("@sotiencl", OleDbType.Numeric).Value = phieuDKHP.SoTienConLai; command.Parameters.Add("@maso", OleDbType.Currency).Value = phieuDKHP.SoPhieuDKHP; command.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } finally { connection.Close(); } }
public void CreateItem(PhieuDKHP phieuDKHP) { try { if (connection.State != ConnectionState.Open) { connection.Open(); } OleDbCommand command = new OleDbCommand( "INSERT INTO PHIEU_DKHP " + "(SoPhieuDKHP, NgayLap, HocKy, NamHoc, MaSoSV, SoTienDangKy, ThoiHanDongHP, SoTienPhaiDong, SoTienConLai) " + "VALUES (@sophieu, @ngaylap, @hocky, @namhoc, @mssv, @sotiendk, @thoihan, @sotienpd, @sotiencl)", connection); command.Parameters.Add("@sophieu", OleDbType.Numeric).Value = phieuDKHP.SoPhieuDKHP; command.Parameters.Add("@ngaylap", OleDbType.Date).Value = phieuDKHP.NgayLap; command.Parameters.Add("@hocky", OleDbType.Numeric).Value = phieuDKHP.HocKy; command.Parameters.Add("@namhoc", OleDbType.Numeric).Value = phieuDKHP.NamHoc; command.Parameters.Add("@mssv", OleDbType.Numeric).Value = phieuDKHP.MaSoSV; command.Parameters.Add("@sotiendk", OleDbType.Currency).Value = phieuDKHP.SoTienDangKy; command.Parameters.Add("@thoihan", OleDbType.Date).Value = phieuDKHP.ThoiHangDongHP; command.Parameters.Add("@sotienpd", OleDbType.Currency).Value = phieuDKHP.SoTienPhaiDong; command.Parameters.Add("@sotiencl", OleDbType.Currency).Value = phieuDKHP.SoTienConLai; command.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } finally { connection.Close(); } }
private void NhapLaiThongTinPhieuThuHP() { PhieuDKHP = new PhieuDKHP(); phieuDKHP.SoPhieuDKHP = -1; SinhVien = new SinhVien(); PhieuThuHP = new PhieuThuHP(); }
public PhieuThuHpViewModel() : base() { phieuDKHP = new PhieuDKHP(); phieuDKHP.SoPhieuDKHP = -1; sinhVien = new SinhVien(); phieuThuHP = new PhieuThuHP(); XacNhan = new RelayCommand( param => true, param => XacNhanLuuPhieuThuHP()); NhapLai = new RelayCommand( param => true, param => NhapLaiThongTinPhieuThuHP()); LoadDanhMucSinhVien(); LoadDanhMucHocKy(); }
public List <PhieuDKHP> ReadItemsByMSSV(int maSoSV) { List <PhieuDKHP> phieuDKHPs = new List <PhieuDKHP>(); DataTable dataTable = new DataTable(); try { if (connection.State != ConnectionState.Open) { connection.Open(); } OleDbCommand command = new OleDbCommand( "SELECT * FROM PHIEU_DKHP WHERE MaSoSV=@mssv " + "ORDER BY HocKy ASC, NamHoc ASC", connection); command.Parameters.Add("@mssv", OleDbType.Numeric).Value = maSoSV; OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter(command); oleDbDataAdapter.Fill(dataTable); } catch (Exception ex) { throw ex; } finally { connection.Close(); } foreach (DataRow row in dataTable.Rows) { PhieuDKHP phieuDKHP = new PhieuDKHP(); phieuDKHP.SoPhieuDKHP = int.Parse(row["SoPhieuDKHP"].ToString()); phieuDKHP.NgayLap = DateTime.Parse(row["NgayLap"].ToString()); phieuDKHP.ThoiHangDongHP = DateTime.Parse(row["ThoiHanDongHP"].ToString()); phieuDKHP.HocKy = int.Parse(row["HocKy"].ToString()); phieuDKHP.NamHoc = int.Parse(row["NamHoc"].ToString()); phieuDKHP.MaSoSV = maSoSV; phieuDKHP.SoTienDangKy = double.Parse(row["SoTienDangKy"].ToString()); phieuDKHP.SoTienPhaiDong = double.Parse(row["SoTienPhaiDong"].ToString()); phieuDKHP.SoTienConLai = double.Parse(row["SoTienConLai"].ToString()); phieuDKHPs.Add(phieuDKHP); } return(phieuDKHPs); }
public PhieuDkhpViewModel() : base() { phieuDKHP = new PhieuDKHP(); sinhVien = new SinhVien(); sinhVien.MaSo = -1; doiTuongUuTien = new DoiTuongUuTien(); XacNhan = new RelayCommand( param => true, param => XacNhanLuuPhieuDKHP()); NhapLai = new RelayCommand( param => true, param => NhapLaiThongTinPhieuDKHP()); ThemDong = new RelayCommand( param => CT_PhieuDKHPs != null, param => ThemDongMonHocMo()); SelectedMonHocChanged = new RelayCommand( param => true, param => OnSelectedMonHocChanged(param)); LoadDanhMucSinhVien(); LoadDanhMucHocKy(); LoadDanhMucDTUT(); LoadDanhMucNganhHoc(); LoadDanhMucLoaiMon(); }