public void deletePhieuVatTu(PhieuVatTu p) { try { openConnection(); SqlCommand cmd = new SqlCommand("XoaPVT", Conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID_PhieuVatTu", p.ID_PhieuVatTu); cmd.ExecuteNonQuery(); } catch (Exception ex) { new Exception("Error: " + ex.Message); } finally { closeConnection(); } }
public void insertPhieuVatTu(PhieuVatTu p) { try { openConnection(); SqlCommand cmd = new SqlCommand("ThemPVT", Conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID_PhieuVatTu", p.ID_PhieuVatTu); cmd.Parameters.AddWithValue("@MaNguoiPhuTrach", p.MaNPT); cmd.Parameters.AddWithValue("@ThoiGian", p.ThoiGian); cmd.ExecuteNonQuery(); } catch (Exception ex) { new Exception("Error: " + ex.Message); } finally { closeConnection(); } }