Beispiel #1
0
 public static int AddPhieuThu(int nguoiDung, int khuVuc)
 {
     using (var db = new DB())
     {
         // ---- Tạo mới một đối tượng phiếu thu
         var phieuThu = new DAL.PhieuThu()
         {
             NguoiDung = nguoiDung,
             KhuVuc = khuVuc,
             // ---- Lấy thời gian hiện tại
             ThoiGian = DateTime.Now,
             // ---- Tổng tiền ban đầu bằng 0 khi thêm chi tiết sẽ tự cập nhật
             TongTien = 0,
             // ---- Tiền nhận cập nhật khi thanh toán phiếu thu
             TienNhan = 0,
             SoNguoi = 1,
             ThanhToan = false,
         };
         // ---- Thêm phiếu thu vào cơ sở dữ liệu
         db.PhieuThus.InsertOnSubmit(phieuThu);
         // ---- Cập nhật thay đổi
         db.SubmitChanges();
         // ---- Trả về PhieuThuID mới thêm vào
         return phieuThu.PhieuThuID;
     }
 }
Beispiel #2
0
		private void detach_PhieuThus(PhieuThu entity)
		{
			this.SendPropertyChanging();
			entity.NguoiDung1 = null;
		}
Beispiel #3
0
		private void detach_PhieuThus(PhieuThu entity)
		{
			this.SendPropertyChanging();
			entity.KhuVuc1 = null;
		}
Beispiel #4
0
		private void attach_PhieuThus(PhieuThu entity)
		{
			this.SendPropertyChanging();
			entity.KhuVuc1 = this;
		}
Beispiel #5
0
 partial void DeletePhieuThu(PhieuThu instance);
Beispiel #6
0
 partial void UpdatePhieuThu(PhieuThu instance);
Beispiel #7
0
 partial void InsertPhieuThu(PhieuThu instance);