public static bool CapNhatTSDonGia(ParameDTO ts, string t) { if (ts.DonGia <= 0) { return(false); } return(ParameDAO.CapNhatTSDonGia(ts, t)); }
public static bool CapNhatTSHeSo(ParameDTO infor) { SqlParameter heso = new SqlParameter("@HeSo", infor.HeSo); try { context.Database.ExecuteSqlCommand("spCapNhatTSHeSo @HeSo", heso); return(true); } catch { return(false); } }
public static bool CapNhatTSPhuThu(ParameDTO infor) { SqlParameter phuthu = new SqlParameter("@PhuThu", infor.PhuThu); try { context.Database.ExecuteSqlCommand("spCapNhatTSPhuThu @PhuThu", phuthu); return(true); } catch { return(false); } }
public static bool CapNhatTSSoKhachToiDa(ParameDTO infor) { SqlParameter toida = new SqlParameter("@SoKhachToiDa", infor.SLKhachToiDa); try { context.Database.ExecuteSqlCommand("spCapNhatTSSoKhachToiDa @SoKhachToiDa", toida); return(true); } catch { return(false); } }
public static bool CapNhatTSDonGia(ParameDTO ts, string t) { SqlParameter dongia = new SqlParameter("@DonGia", ts.DonGia); SqlParameter tenloaiphong = new SqlParameter("@TenLoaiPhong", t); try { context.Database.ExecuteSqlCommand("spCapNhatTSDonGia @TenLoaiPhong ,@DonGia ", dongia, tenloaiphong); return(true); } catch { return(false); } }
public static bool CapNhatTSPhuThu(ParameDTO infor) { return(ParameDAO.CapNhatTSPhuThu(infor)); }
public static bool CapNhatTSHeSo(ParameDTO infor) { return(ParameDAO.CapNhatTSHeSo(infor)); }
public static bool CapNhatTSSoKhachToiDa(ParameDTO infor) { return(ParameDAO.CapNhatTSSoKhachToiDa(infor)); }
private void btnCapNhatQuyDinh_Click(object sender, EventArgs e) { List <ParameDTO> lst = new List <ParameDTO>(); ParameDTO ts = new ParameDTO(); lst = ParameBUS.LayThongTinTS(); if (cmbThamSo.Text == "Số lượng khách tối đa") { ts.SLKhachToiDa = Convert.ToInt32(txtGiaTri.Text); if (ParameBUS.CapNhatTSSoKhachToiDa(ts) == true) { MessageBox.Show("Cập nhập thành công số khách tối đa", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (cmbThamSo.Text == "Hệ số") { ts.HeSo = Convert.ToDouble(txtGiaTri.Text); if (ParameBUS.CapNhatTSHeSo(ts) == true) { MessageBox.Show("Cập nhập hệ số thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (cmbThamSo.Text == "Phụ thu") { ts.PhuThu = Convert.ToDouble(txtGiaTri.Text); if (ParameBUS.CapNhatTSPhuThu(ts) == true) { MessageBox.Show("Cập nhập phụ thu thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (cmbThamSo.Text == "Loại phòng A") { string lp = "A"; ts.DonGia = Convert.ToDecimal(txtGiaTri.Text); if (ParameBUS.CapNhatTSDonGia(ts, lp) == true) { MessageBox.Show("Cập nhập giá phòng thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Lỗi hệ thống hoặc nhập sai", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (cmbThamSo.Text == "Loại phòng B") { string lp1 = "B"; ts.DonGia = Convert.ToDecimal(txtGiaTri.Text); if (ParameBUS.CapNhatTSDonGia(ts, lp1) == true) { MessageBox.Show("Cập nhập giá phòng thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Lỗi hệ thống hoặc nhập sai", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (cmbThamSo.Text == "Loại phòng C") { string lp2 = "C"; ts.DonGia = Convert.ToDecimal(txtGiaTri.Text); if (ParameBUS.CapNhatTSDonGia(ts, lp2) == true) { MessageBox.Show("Cập nhập giá phòng thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Lỗi hệ thống hoặc nhập sai", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }