public void ThemPhieu(string MaHD, string NgayTao, string MaNV, string MaP) { QLKhachSanEntities nh = new QLKhachSanEntities(); HOADON p = new HOADON(); p.MAHD = MaHD; p.NGAYTAO = DateTime.Parse(NgayTao); p.MANV = MaNV; p.MAPHONG = MaP; p.THANHTIEN = 0; nh.HOADON.Add(p); nh.SaveChanges(); }
public bool themHoaDon(HOADON hd) { try { qlhd.HOADONs.InsertOnSubmit(hd); qlhd.SubmitChanges(); return(true); } catch { return(false); } }
public bool Insert(HOADON hd) { getConnect(); string sql = string.Format("INSERT INTO HoaDon(MaNV,TongTien,TrangThai) VALUES({0},{1},N'{2}')", hd.MaNV, hd.TongTien, hd.TrangThai); SqlCommand cmd = new SqlCommand(sql, conn); int row = cmd.ExecuteNonQuery(); getDisconnect(); if (row > 0) { return(true); } return(false); }
public bool thanhToanCongNoKhachHang(string mahd) { try { HOADON hd = qlcn.HOADONs.Where(t => t.MaHD == mahd).FirstOrDefault(); hd.TienNo = 0; qlcn.SubmitChanges(); return(true); } catch { return(false); } }
public bool themHoaDon(HOADON hoaDon) { try { ketNoi.HOADONs.InsertOnSubmit(hoaDon); ketNoi.SubmitChanges(); return(true); } catch (Exception) { return(false); throw; } }
public bool suaHoaDonKhachMuaLe(string mahd, float tonggt, float tienno) { try { HOADON hd = qlhd.HOADONs.Where(t => t.MaHD == mahd).FirstOrDefault(); hd.TongGiaTri = tonggt; hd.TienNo = tienno; qlhd.SubmitChanges(); return(true); } catch { return(false); } }
public bool suaHoaDonBan(string mahd, float chuyenban, float tongdichvu, float thuevat, float tonggt, float thanhtien, float tienno) { try { HOADON hd = qlhd.HOADONs.Where(t => t.MaHD == mahd).FirstOrDefault(); hd.TienChuyenBan = chuyenban; hd.TongTienDichVu = tongdichvu; hd.ThueVAT = thuevat; hd.TongGiaTri = tonggt; hd.ThanhTien = thanhtien; hd.TienNo = tienno; qlhd.SubmitChanges(); return(true); } catch { return(false); } }
public bool capNhatHoaDon(HOADON hoaDon) { try { var ketQua = from hoaDonTam in ketNoi.HOADONs where hoaDonTam.MAHOADON == hoaDon.MAHOADON select hoaDonTam; foreach (var tam in ketQua) { tam.TONGTIEN = hoaDon.TONGTIEN; tam.NGAYLAP = hoaDon.NGAYLAP; } ketNoi.SubmitChanges(); return(true); } catch (Exception) { return(false); } }
partial void DeleteHOADON(HOADON instance);
partial void UpdateHOADON(HOADON instance);
partial void InsertHOADON(HOADON instance);