1. Trang chủ
  2. » Giáo Dục - Đào Tạo

ĐỀ TÀI QUẢN LÝ TRUNG TÂM THẨM MỸ

60 5 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 60
Dung lượng 2,05 MB

Cấu trúc

  • PHÂN CÔNG VÀ KẾ HOẠCH THỰC HIỆN

  • I.PHÁT BIỂU BÀI TOÁN :

  • II.THIẾT KẾ CƠ SỞ DỮ LIỆU :

    • Lược đồ cơ sở dữ kiệu :

    • Các kiểu liên kết :

    • Tạo các bảng :

  • III.CÁC CHỨC NĂNG CỦA PHẦN MỀM :

    • 1.Form Đăng Nhập :

    • 2.Form Quản Lý Các Dịch Vụ :

    • 3.Form Quản Lý :

    • 4. Form Thông Tin Tài Khoản:

  • IV . CÀI ĐẶT CÁC CHỨC NĂNG VÀ MINH HỌA KẾT QUẢ THỰC HIỆN :

    • 1.Form Đăng Nhập :

    • 2.Form Quản Lý Phòng:

    • 3.Form Quản Lý :

    • 4. Form Thông Tin Tài Khoản :

Nội dung

PHÁT BIỂU BÀI TOÁN

Phần mềm quản lý trung tâm thẩm mỹ giúp tổ chức và quản lý thông tin quan trọng liên quan đến quá trình đăng ký và sử dụng dịch vụ của khách hàng, từ đó đơn giản hóa thủ tục phục vụ và nâng cao trải nghiệm khách hàng.

Cần quản lý các đối tượng sau:

THIẾT KẾ CƠ SỞ DỮ LIỆU

Lược đồ cơ sở dữ liệu bao gồm các bảng chính như tblNhanVien với các trường maNv, tenNv, sđt, diaChi, và ngaySinh; tblKhachHang chứa maKh, tenKh, sđt, diaChi, và ngaySinh; tblPhong với maPhong, tenPhong, và trangThai; tblTaiKhoan có tenTk, tenDangnhap, matKhau, và loaiTk; tblLoaiDV bao gồm maLoai và tenLoai; tblDichVu với maDv, tenDichvu, donGia, và maLoai (khóa ngoại); tblHoaDon chứa maHd, ngayVao, ngayRa, trangThai, cùng với các khóa ngoại maNv, maKh, và maPhong; cuối cùng là tblChiTietHoaDon với maCthd, maDv (khóa ngoại), và maHd (khóa ngoại).

Loại dịch vụ - Có - Dịch vụ: 1-N

Nhân viên - Lập - Hóa đơn: 1-N

 Lược đồ cơ sở dữ liệu:

- Tạo bảng Phòng : create table Phong

( maphong int identity primary key, tenphong nvarchar(100) default N'Chưa đặt tên', trangthai nvarchar(100) default N'Trống' Trong || Co nguoi )

- Tạo bảng Tài Khoản : create table TaiKhoan

( tendangnhap nvarchar(100) primary key, tenhienthi nvarchar(100) not null default N'Kter', matkhau nvarchar(1000) not null default 0, loaitaikhoan nvarchar(20) not null default N'Quản trị viên' )

- Tạo bảng Loại Dịch Vụ : create table LoaiDichVu

( maloaidichvu int identity primary key, tenloaidichvu nvarchar(100) default N'Chưa đặt tên'

- Tạo bảng Nhân Viên : create table NhanVien

( manhanvien int identity primary key, tennhanvien nvarchar(100), sodienthoai varchar(10), ngaysinh date, gioitinh nvarchar(10), diachi nvarchar(100)

- Tạo bảng Dịch Vụ : create table DichVu

( madichvu int identity primary key, tendichvu nvarchar(100) not null default N'Chưa đặt tên', maloaidichvu int not null, giadichvu float not null default 0 foreign key (maloaidichvu) references LoaiDichVu(maloaidichvu) )

- Tạo bảng Hóa Đơn : create table HoaDon

The article discusses a database schema for managing invoices, featuring a primary key identified as "mahoadon." Key attributes include "thoigianvao" for the entry date, which defaults to the current date, and "thoigianra" for the exit date The "trangthai" field indicates payment status, with values of 1 for paid and 0 for unpaid Additionally, the schema includes fields for "tongtien" representing the total amount, "maphong" for room identification, "makhachhang" for customer identification, and "manhanvien" for employee identification, all of which are essential for effective invoice management.

- Tạo bảng Chi Tiết Hóa Đơn : create table ChiTietHoaDon

( machitiethoadon int identity primary key, mahoadon int not null, madichvu int not null, foreign key (mahoadon) references HoaDon(mahoadon), foreign key (madichvu) references DichVu(madichvu) )

 Sơ đồ quan hệ giữa các bảng :

CÁC CHỨC NĂNG CỦA PHẦN MỀM

Form Thông Tin Tài Khoản

- Chức năng Cập Nhật cho phép thay đổi mật khẩu của tài khoản.

- Chức năng Thoát để thoát khỏi Form.

IV CÀI ĐẶT CÁC CHỨC NĂNG VÀ MINH HỌA KẾT QUẢ THỰC HIỆN :

- Tạo Store Procedure để kiểm tra tài khoản đăng nhập : create proc USP_DangNhap

@tendangnhap nvarchar(100) , @matkhau nvarchar(100) as begin select*from dbo.TaiKhoan where @tendangnhap tendangnhap and @matkhau = matkhau end

- Tạo hàm kiểm tra tài khoản trong class TaiKhoanDAO : public bool DangNhap(string tentaikhoan, string matkhau) { string query = "USP_DangNhap @tendangnhap ,

DataTable result DataProvider.Instance.ExecuteQuery(query, new object[]

{ tentaikhoan , matkhau }); return result.Rows.Count > 0;

} fQuanLyPhong f = new fQuanLyPhong(taikhoandangnhap); f.ShowDialog();

MessageBox.Show("Sai tên tài khoản hoặc mật khẩu");

} bool DangNhap(string tendangnhap, string matkhau) { return

TaiKhoanDAO.Instance.DangNhap(tendangnhap, matkhau);

* Chức năng Thoát : private void btnThoat_Click(object sender, EventArgs e) {

} private void fDangNhap_FormClosing(object sender, FormClosingEventArgs e)

{ if (MessageBox.Show("Bạn có muốn thoát chương trình ?", "Thông báo", MessageBoxButtons.OKCancel) ! System.Windows.Forms.DialogResult.OK)

* Chức năng Thêm Dịch Vụ :

- Trong class HoaDonDAO viết hàm lấy ra mã hóa đơn theo mã phòng , mã nhân viên , mã khách hàng : public int LayHoaDonChuaThanhToan(int maphong,int makh , int manv)

DataTable data DataProvider.Instance.ExecuteQuery("select*from dbo.HoaDon where maphong = " + maphong + " and trangthai = 0 and makhachhang = " + makh + " and manhanvien = " + manv); if(data.Rows.Count > 0)

HoaDon hd = new HoaDon(data.Rows[0]); return hd.Mahoadon;

- Trong class HoaDonDAO tạo hàm thêm hóa đơn vào trong Database : public void ThemHoaDon(int maphong , int manv , int makh) {

DataProvider.Instance.ExecuteQuery("USP_ThemHoaDon

@maphong , @manhanvien , @makhachhang", new object[]

- Trong class ChiTietHoaDonDAO viết hàm thêm chi tiết hóa đơn theo mã hóa đơn vừa được thêm : public void ThemChiTietHoaDon(int mahoadon,int madichvu)

DataProvider.Instance.ExecuteQuery("USP_ThemChiTietHoaDon

@mahoadon , @madichvu",new object[] { mahoadon , madichvu}); }

- Trong form Quản Lý Phòng viết hàm xử lý sự kiện khi click vào nút Thêm Dịch

Vụ : private void btnThemDichVu_Click(object sender, EventArgs e) { try

PhongDTO phong = lvDichVu.Tag as PhongDTO; if(phong == null)

{ int mahoadon HoaDonDAO.Instance.LayHoaDonChuaThanhToan(phong.Maphong, makh, manv); int madichvu = (cbDichVu.SelectedItem as DichVuDTO).Madichvu; if (mahoadon == -1)

HoaDonDAO.Instance.ThemHoaDon(phong.Maphong, manv, makh);

ChiTietHoaDonDAO.Instance.ThemChiTietHoaDon(HoaDonDAO.Instan ce.LayRaMaHoaDonMax(), madichvu);

ChiTietHoaDonDAO.Instance.ThemChiTietHoaDon(mahoadon, madichvu);

Hien_Hoa_Don(phong.Maphong);

HoaDonDAO.Instance.TinhTongTienTheoMaKH(makh); txbThanhTien.Text HoaDonDAO.Instance.LayRaTongTienTheoKH(makh).ToString(); } catch (Exception)

MessageBox.Show("Có lỗi xảy ra khi thêm dịch vụ do Nhân Viên hoặc Khách Hàng đã tồn tại");

* Chức năng Hủy Dịch Vụ :

- Trong class ChiTietHoaDonDAO tạo xóa chi tiết dịch vụ : public void XoaChiTietHoaDon(int mahoadon,int madichvu) {

MessageBox.Show("Hãy chọn phòng"); return;

The code snippet retrieves the employee ID and customer ID from selected items in dropdown lists, then uses these IDs along with the room ID to fetch the unpaid invoice from the database Additionally, it extracts the service ID from the selected service item If an unpaid invoice is found, the process continues based on the retrieved data.

ChiTietHoaDonDAO.Instance.XoaChiTietHoaDon(mahoadon, madichvu);

Hien_Hoa_Don(phong.Maphong);

- Trong form Quản Lý Phòng viết hàm xử lý sự kiện khi click nút Thanh Toán : private void btnThanhToan_Click(object sender, EventArgs e) {

PhongDTO phong = lvDichVu.Tag as PhongDTO; int makh = (cbTenKhachHang.SelectedItem as

KhachHangDTO).Makhachhang; int mahoadon HoaDonDAO.Instance.LayHoaDonChuaThanhToanTheoMaPhong_KH(phon g.Maphong,makh); double tongtien Convert.ToDouble(txbThanhTien.Text); if (mahoadon != -1)

{ if(MessageBox.Show(string.Format("Bạn có chắc chắn muốn thanh toán cho khách hàng {2} ở {0} với số tiền là : {1} ",phong.Tenphong,tongtien,

KhachHangDTO).Tenkhachhang),"Thông báo",MessageBoxButtons.OKCancel) =System.Windows.Forms.DialogResult.OK)

HoaDonDAO.Instance.ThanhToan(mahoadon); Hien_Hoa_Don(phong.Maphong);

- Tạo Store Procedure lấy thông tin hóa đơn theo ngày vào , ngày ra : alter proc USP_LayThongTinHoaDonTheoNgay

@thoigianvao date , @thoigianra date as begin order by a.tongtien desc end

- Trong class HoaDonDAO viết hàm lấy thông tin hóa đơn : public DataTable LayThongTinHoaDonTheoNgay(DateTime thoigianvao,DateTime thoigianra)

{ return DataProvider.Instance.ExecuteQuery("exec USP_LayThongTinHoaDonTheoNgay @thoigianvao ,

@thoigianra",new object[] {thoigianvao, thoigianra});

- Trong form Quản Lý viết hàm xử lý sự kiện cilck nút Thống Kê : private void btnThongKe_Click(object sender, EventArgs e) {

HienHoaDonTheoNgay(dtpkTuNgay.Value, dtpkDenNgay.Value);

* Chức năng Thêm Dịch Vụ :

- Trong class DichVuDAO viết hàm thêm dịch vụ vào database : public bool Them_DV(string tendichvu,int maloaidichvu,float giadichvu)

{ string query = string.Format("insert into dbo.DichVu(tendichvu,maloaidichvu,giadichvu) values (N'{0}', {1},{2})",tendichvu,maloaidichvu,giadichvu); int result DataProvider.Instance.ExecuteNonQuery(query); return result > 0;

- Trong form Quản Lý viết hàm xử lý sự kiện click Thêm Dịch Vụ : private void btnThemDichVu_Click(object sender, EventArgs e)

{ string tendichvu = txbTenDichVu.Text; int maloaidichvu = (cbLoaiDichVu.SelectedItem as LoaiDichVuDTO).Maloaidichvu; float giadichvu (float)Convert.ToDouble(txbDonGia.Text.ToString()); if (DichVuDAO.Instance.Them_DV(tendichvu, maloaidichvu, giadichvu))

MessageBox.Show("Thêm Dịch Vụ Thành Công"); Load_DSDichVu();

* Chức năng Sửa Dịch Vụ :

- Trong class DichVuDAO viết hàm sửa dịch vụ vào database : public bool Sua_DV(int madichvu,string tendichvu, int maloaidichvu, float giadichvu)

To update a service in the management system, the SQL command is formatted as follows: `update dbo.DichVu set tendichvu = N'{0}', maloaidichvu = {1}, giadichvu = {2} where madichvu = {3}` In the event handler for the "Edit Service" button, the service ID is retrieved using `Convert.ToInt32(txbMaDichVu.Text)`, while the service name is obtained from `txbTenDichVu.Text` The category ID is selected from the dropdown as `(cbLoaiDichVu.SelectedItem as LoaiDichVuDTO).Maloaidichvu`, and the service price is converted from text to float using `(float)Convert.ToDouble(txbDonGia.Text.ToString())`.

(DichVuDAO.Instance.Sua_DV(madichvu,tendichvu, maloaidichvu, giadichvu))

MessageBox.Show("Sửa Dịch Vụ Thành Công"); Load_DSDichVu(); if (suaDV != null) suaDV(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Sửa");

* Chức năng Xóa Dịch Vụ:

- Trong class DichVuDAO viết hàm xóa dịch vụ vào database : public bool Xoa_DV(int madichvu)

To handle the click event for deleting a service in the Management form, the method btnXoaDichVu_Click retrieves the service ID from the text box and converts it to an integer It then checks the invoice status associated with the service ID If the invoice status is valid, the service is deleted using the DichVuDAO's Xoa_DV method This approach ensures that only services linked to active invoices are removed from the database, maintaining data integrity.

MessageBox.Show("Xóa Dịch Vụ Thành

Load_DSDichVu(); if (xoaDV != null) xoaDV(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Xóa");

{ if(HoaDonDAO.Instance.LayTrangThaiHoaDonTheoMaHoaDon(ChiTietHoaDonDAO.Instance.LayMaHoaDonTheoMaDichVu(madichvu)) == 0)

Load_DSDichVu(); if (xoaDV != null) xoaDV(this, new EventArgs()); } else

MessageBox.Show("Có Lỗi Khi Xóa"); }

* Chức năng Tìm Kiếm Dịch Vụ : public DataTable TimKiemDichVu(string tendichvu)

The SQL query retrieves service information from the database, including service code, service name, service type code, and service price It uses a function to convert the service name into an unsigned format for comparison, allowing for flexible matching based on the input service name The results are filtered to include any service names that contain the specified term.

DataTable data DataProvider.Instance.ExecuteQuery(query); return data;

} private void btnTimKiemDichVu_Click(object sender, EventArgs e)

{ dsDV.DataSource TimKiemTheoTenDichVu(txbTimKiemDichVu.Text);

* Chức năng Thêm Loại Dịch Vụ : private void btnThemLoaiDichVu_Click(object sender, EventArgs e)

{ string tenloaidichvu = txbTenLoaiDichVu.Text; if

(LoaiDichVuDAO.Instance.Them_LoaiDV(tenloaidichvu))

MessageBox.Show("Thêm Loại Dịch Vụ Thành Công");

Load_DSLoaiDichVu_ComboBoxLoaiDV(cbLoaiDichVu); if (themLoaiDV != null) themLoaiDV(this, new EventArgs()); } else

MessageBox.Show("Có Lỗi Khi Thêm");

* Chức năng Sửa Loại Dịch Vụ : private void btnSuaLoaiDichVu_Click(object sender, EventArgs e)

{ int maloaidichvu Convert.ToInt32(txbMaLoaiDichVu.Text); string tenloaidichvu = txbTenLoaiDichVu.Text; if

(LoaiDichVuDAO.Instance.Sua_LoaiDV(maloaidichvu, tenloaidichvu))

MessageBox.Show("Sửa Loại Dịch Vụ Thành Công");

Load_DSLoaiDichVu_ComboBoxLoaiDV(cbLoaiDichVu); if (suaLoaiDV != null) suaLoaiDV(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Sửa");

* Chức năng Xóa Loại Dịch Vụ: private void btnXoaLoaiDichVu_Click(object sender,

{ int maloaidichvu Convert.ToInt32(txbMaLoaiDichVu.Text); int madichvu DichVuDAO.Instance.LayMaDichVuTheoMaLoaiDichVu(maloaidichvu)

(HoaDonDAO.Instance.LayTrangThaiHoaDonTheoMaHoaDon(ChiTietHo aDonDAO.Instance.LayMaHoaDonTheoMaDichVu(madichvu)) == 1) { if

(LoaiDichVuDAO.Instance.Xoa_LoaiDV(maloaidichvu))

MessageBox.Show("Xóa Loại Dịch Vụ Thành Công");

Load_DSLoaiDichVu_ComboBoxLoaiDV(cbLoaiDichVu); if (xoaLoaiDV != null) xoaLoaiDV(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Xóa");

(HoaDonDAO.Instance.LayTrangThaiHoaDonTheoMaHoaDon(ChiTietHo aDonDAO.Instance.LayMaHoaDonTheoMaDichVu(madichvu)) == 0) else

(LoaiDichVuDAO.Instance.Xoa_LoaiDV(maloaidichvu))

MessageBox.Show("Xóa Loại Dịch Vụ Thành Công");

Load_DSLoaiDichVu_ComboBoxLoaiDV(cbLoaiDichVu); if (xoaLoaiDV != null) xoaLoaiDV(this, new

MessageBox.Show("Có Lỗi Khi Xóa"); }

* Chức năng Thêm Phòng : private void btnThemPhong_Click(object sender, EventArgs e) { string tenphong = txbTenPhong.Text; if (PhongDAO.Instance.Them_Phong(tenphong)) {

MessageBox.Show("Thêm Phòng Thành Công"); Load_DSPhong(); if (themPhong != null) themPhong(this, new EventArgs());

* Chức năng Sửa Phòng : private void btnSuaPhong_Click(object sender, EventArgs e) { int maphong = Convert.ToInt32(txbMaPhong.Text); string tenphong = txbTenPhong.Text;

* Chức năng Xóa Phòng : private void btnXoaPhong_Click(object sender, EventArgs e) { int maphong = Convert.ToInt32(txbMaPhong.Text); string trangthai = txbTrangThai.Text; if (trangthai.Equals("Trống") == true)

{ if (PhongDAO.Instance.Xoa_Phong(maphong)) {

MessageBox.Show("Xóa Phòng Thành Công");

MessageBox.Show("Có Lỗi Khi Xóa");

MessageBox.Show("Phòng vẫn đang hoạt động !! Không thể Xóa");

* Chức năng Thêm Nhân Viên : private void btnThemNhanVien_Click(object sender,

To add a new employee, the system captures essential details including the employee's name, phone number, date of birth, gender, and address The function `Them_NV` from the `NhanVienDAO` class is utilized to process and store this information If the operation is successful, it confirms the addition of the new employee to the database.

MessageBox.Show("Thêm Nhân Viên Thành Công");

Load_DSNhanVien(); if (themNV != null) themNV(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Thêm");

* Chức năng Sửa Nhân Viên : private void btnSuaNhanVien_Click(object sender, EventArgs e)

{ int manhanvien Convert.ToInt32(txbMaNhanVien.Text); string tennhanvien = txbTenNhanVien.Text; string sodienthoai = txbSoDienThoaiNV.Text; string ngaysinh = txbNgaySinhNV.Text; string gioitinh = txbGioiTinhNV.Text; string diachi = txbDiaChiNV.Text; if

(NhanVienDAO.Instance.Sua_NV(manhanvien,tennhanvien, sodienthoai, ngaysinh, gioitinh, diachi))

MessageBox.Show("Sửa Nhân Viên Thành Công"); Load_DSNhanVien(); if (suaNV != null) suaNV(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Sửa");

* Chức năng Xóa Nhân Viên : private void btnXoaNhanVien_Click(object sender,

{ int manhanvien Convert.ToInt32(txbMaNhanVien.Text); if

(HoaDonDAO.Instance.LayTrangThaiHoaDonTheoMaNhanVien(manhanv ien) == 1 )

{ if (NhanVienDAO.Instance.Xoa_NV(manhanvien)) { xoaNV(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Xóa");

{ if(HoaDonDAO.Instance.LayTrangThaiHoaDonTheoMaNhanVien(manha nvien) == 0)

MessageBox.Show("Nhân Viên nằm trong hóa đơn chưa thanh toán");

(NhanVienDAO.Instance.Xoa_NV(manhanvien))

MessageBox.Show("Xóa Nhân Viên Thành Công");

Load_DSNhanVien(); if (xoaNV != null) xoaNV(this, new EventArgs()); }

* Chức năng Thêm Khách Hàng : private void btnThemKhachHang_Click(object sender, EventArgs e)

To add a new customer, the following information is required: the customer's name, phone number, date of birth, gender, and address This data is collected through input fields and then processed by the KhachHangDAO.Instance.AddCustomer method, which handles the insertion of the new customer record into the database If the operation is successful, the new customer will be added successfully.

Load_DSKhachHang(); if (themKH != null) themKH(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Thêm");

* Chức năng Sửa Khách Hàng : private void btnSuaKhachHang_Click(object sender,

{ int makhachhang = Convert.ToInt32(txbMaKH.Text); string tenkhachhang = txbTenKH.Text; string sodienthoai = txbSoDienThoaiKH.Text; string ngaysinh = txbNgaySinhKH.Text; string gioitinh = txbGioiTinhKH.Text; string diachi = txbDiaChiKH.Text; if

(KhachHangDAO.Instance.Sua_KH(makhachhang,tenkhachhang, sodienthoai, ngaysinh, gioitinh, diachi))

MessageBox.Show("Sửa Khách Hàng Thành

Load_DSKhachHang(); if (suaKH != null) suaKH(this, new EventArgs());

* Chức năng Xóa Khách Hàng : private void btnXoaKhachHang_Click(object sender,

{ int makhachhang = Convert.ToInt32(txbMaKH.Text); if(HoaDonDAO.Instance.LayTrangThaiHoaDonTheoMaKhachHang(makh achhang) == 1)

(KhachHangDAO.Instance.Xoa_KH(makhachhang))

MessageBox.Show("Xóa Khách Hàng Thành Công");

Load_DSKhachHang(); if (xoaKH != null) xoaKH(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Xóa");

{ if(HoaDonDAO.Instance.LayTrangThaiHoaDonTheoMaKhachHang(makh achhang) == 0)

MessageBox.Show("Khách Hàng có hóa đơn chưa thanh toán");

MessageBox.Show("Xóa Khách Hàng Thành Công");

Load_DSKhachHang(); if (xoaKH != null) xoaKH(this, new EventArgs());

MessageBox.Show("Có Lỗi Khi Xóa"); }

* Chức năng Thêm Tài Khoản : private void btnThemTaiKhoan_Click(object sender,

{ string tendangnhap = txbTenTaiKhoan.Text; string tenhienthi = txbTenHienThi.Text; string loaitaikhoan = txbLoaiTaiKhoan.Text; if (TaiKhoanDAO.Instance.Them_TK(tendangnhap, tenhienthi, loaitaikhoan))

MessageBox.Show("Thêm Tài Khoản thành

* Chức năng Sửa Tài Khoản : private void btnSuaTaiKhoan_Click(object sender, EventArgs e)

{ string tendangnhap = txbTenTaiKhoan.Text; string tenhienthi = txbTenHienThi.Text; string loaitaikhoan = txbLoaiTaiKhoan.Text; if (TaiKhoanDAO.Instance.Sua_TK(tendangnhap, tenhienthi, loaitaikhoan))

MessageBox.Show("Sửa Tài Khoản thành công");

MessageBox.Show("Có lỗi khi sửa");

MessageBox.Show("Không được sửa tên đăng nhập");

* Chức năng Xóa Tài Khoản : private void btnXoaTaiKhoan_Click(object sender, EventArgs e)

MessageBox.Show("Không thể xóa tài khoản đang đăng nhập"); return;

} if (TaiKhoanDAO.Instance.Xoa_TK(tendangnhap)) {

MessageBox.Show("Xóa Tài Khoản thành công"); Load_DSTaiKhoan();

MessageBox.Show("Có lỗi khi xóa");

* Chức năng In Chi Tiết Hóa Đơn bằng Crystal Report : private void btnInChiTietHoaDon_Click(object sender,

{ string tenkh = (cbTenKHtrongCTHD.SelectedItem as KhachHangDTO).Tenkhachhang;

DataTable table = new DataTable(); table ChiTietHoaDonDAO.Instance.LayChiTietHoaDonCuaKhachHangTheoTe nvaNgay2(tenkh, thoigianracuakh); rptInChiTietHoaDonChoKhach2 rp = new rptInChiTietHoaDonChoKhach2();

4 Form Thông Tin Tài Khoản :

* Chức năng Cập Nhật Tài Khoản dùng để thay đổi mật khẩu cho tài khoản :

- Trong class TaiKhoanDAO viết hàm cho phép thay đổi mật khẩu : public bool CapNhat_TK(string tendangnhap,string tenhienthi,string matkhau,string matkhaumoi)

{ int result DataProvider.Instance.ExecuteNonQuery("exec

USP_CapNhatTaiKhoan @tendangnhap , @tenhienthi , @matkhau ,

@matkhaumoi", new object[] { tendangnhap, tenhienthi,

- Trong form Thông Tin Tài Khoản viết hàm xử lý sự kiện Cập Nhật : void CapNhat_TaiKhoan()

{ string tendangnhap = txbTenDangNhap.Text; string tenhienthi = txbTenHienThi.Text; string matkhau = txbMatKhau.Text; string matkhaumoi = txbMatKhauMoi.Text; string nhaplai = txbNhapLai.Text; if (!matkhaumoi.Equals(nhaplai))

MessageBox.Show("Vui lòng nhập đúng với mật khẩu mới");

(TaiKhoanDAO.Instance.CapNhat_TK(tendangnhap, tenhienthi, matkhau, matkhaumoi))

MessageBox.Show("Cập nhật thành công"); } else

MessageBox.Show("Vui lòng nhập đúng mật khẩu");

Ngày đăng: 22/09/2021, 19:17

HÌNH ẢNH LIÊN QUAN

- Tạo bảng Chi Tiết Hóa Đơn: create table ChiTietHoaDon ( - ĐỀ TÀI QUẢN LÝ TRUNG TÂM THẨM MỸ
o bảng Chi Tiết Hóa Đơn: create table ChiTietHoaDon ( (Trang 9)
- Chức năng Thêm Dịch Vụ cho phép thêm dịch vụ vào bảng với tên khách hàng - ĐỀ TÀI QUẢN LÝ TRUNG TÂM THẨM MỸ
h ức năng Thêm Dịch Vụ cho phép thêm dịch vụ vào bảng với tên khách hàng (Trang 11)

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w