コード例 #1
0
 private void NhapLaiThongTinPhieuDKHP()
 {
     PhieuDKHP      = new PhieuDKHP();
     SinhVien       = new SinhVien();
     DoiTuongUuTien = new DoiTuongUuTien();
     LoadDanhMucMHM();
 }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 private void NhapLaiThongTinPhieuThuHP()
 {
     PhieuDKHP             = new PhieuDKHP();
     phieuDKHP.SoPhieuDKHP = -1;
     SinhVien   = new SinhVien();
     PhieuThuHP = new PhieuThuHP();
 }
コード例 #5
0
        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();
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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();
        }