- Mong ban quản trị thông cảm, tiêu đề không biết đặt sao cho hợp lý
mình viết theo mô hình 3 lớp

Lối mình như thế này

-frmDongPhi(IdPT, MaSV, MaKhoanThu,MaHocKy,NgayThu,SoTC,SoTien)//IdPT, MaSV, MaKhoanThu,MaHocKy kháo ngoại
//DongPhiBus
Code:
public bool themDongPhi(DongPhi dongphi)
{
if (kiemtraTruocKhiLuu(dongphi))
{
string sql = "INSERT INTO DongPhi(IdPT,MaSV,MaKhoanThu,MaHocKy,NgayThu,SoTC,SoTien) VALUES('" + dongphi.IdPT + "','" + dongphi.MaSV + "','" + dongphi.MaKhoanThu + "','" + dongphi.MaHocKy + "','" + dongphi.NgayThu + "','" + dongphi.SoTC + "','" + dongphi.SoTien + "')";
if (connData.executeQuery(sql))
{
MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
return true;
}
}
//frmdong phi
Code:
//lay thông tin DongPhi
private DongPhi layDSDongPhi()
{
DongPhi dongphi = new DongPhi();
dongphi.IdPT = cboPhieuThu.SelectedValue.ToString();
dongphi.MaSV = cboMaSinhVien.SelectedValue.ToString();
dongphi.MaKhoanThu = cboKhoanThu.SelectedValue.ToString();
dongphi.MaHocKy = cboHocKy.SelectedValue.ToString();
dongphi.NgayThu = Convert.ToDateTime(lblNgayThu.Text);
dongphi.SoTC = Convert.ToInt32(txtSoTC.Text);
dongphi.SoTien = Convert.ToDouble(txtSoTien.Text);
return dongphi;
}
//Lưu
private void bntLuu_Click(object sender, EventArgs e)
{
try
{
DongPhi dongphi = layDSDongPhi();
if(dongphiBus.themDongPhi(dongphi))
{
frmDongPhi_Load(sender, e);
reset();
}
}
catch
{
MessageBox.Show("Bạn vui lòng kiểm tra lại thông tin nhập!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Có gì các bạn down về sửa hộ mình với http://www.mediafire.com/?9wwvf8ngkp58tw4 (nế có đăng nhập user pass là admin)