public void Phong_Update(Phong Ph) { using (var cmd = new SqlCommand("SP_Phong_Update", GetConnection())) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@MaPhong", Ph.MaPhong)); cmd.Parameters.Add(new SqlParameter("@SDTPhong", Ph.SDTPhong)); cmd.Parameters.Add(new SqlParameter("@MaLP", Ph.MaLP)); cmd.ExecuteNonQuery(); } }
private void btnChinhSua_Click(object sender, EventArgs e) { if (KiemTra()) { try { Phong phong = new Phong(); phong.MaPhong = txtTenPhong.Text; phong.SDTPhong = txtSDTPhong.Text; phong.MaLP = LoaiPhongBUS.FindMaLP(luLoaiPhong.Text); PhongBUS.Update(phong); LoadData(); MessageBox.Show("Thêm thành công.", "Thông báo"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void btnLuu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { Phong phong = new Phong(); phong.MaPhong = gridView1.GetFocusedRowCellValue(colMaPhong).ToString(); phong.SDTPhong = gridView1.GetFocusedRowCellValue(colSDT).ToString(); phong.MaLP = gridView1.GetFocusedRowCellValue(ColMaLP).ToString(); PhongBUS.Update(phong); LoadData(); MessageBox.Show("Lưu thành công.", "Thông báo"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void UpdateHienTrangTrong(string MaPDK) { Phong ph = new Phong(); foreach (string MaPhong in DangKyPhongCTBUS.NhanPhong(MaPDK)) { if(PhieuDangKyPhongBUS.KiemTraPhongTrong(MaPhong) == 1) { ph.MaPhong = MaPhong; ph.HienTrang = "Trống"; PhongBUS.UpdateHienTrang(ph); } } }
private void UpdateHienTrang(string MaPDK,string HienTrang) { Phong ph = new Phong(); foreach(string MaPhong in DangKyPhongCTBUS.NhanPhong(MaPDK)) { ph.MaPhong = MaPhong; ph.HienTrang = HienTrang; PhongBUS.UpdateHienTrang(ph); } }
public static void UpdateHienTrang(Phong phong) { ph.Phong_UpdateHienTrang(phong); }
public static void Update(Phong phong) { ph.Phong_Update(phong); }
public static void Insert(Phong phong) { ph.Phong_Insert(phong); }