public void saveNhatKiNhapSach() { //NHATKINHAPSACH nhatkinhapsach = repository.getNhatKiNhapSach(view.selectedNhatKiNhapSach); NHATKINHAPSACH nhatkinhapsach = ViewToModel(); if (valid(nhatkinhapsach) && repository.checkRepeat(nhatkinhapsach) == null) { NHATKINHAPSACH kq = repository.saveNhatKiNhapSach(nhatkinhapsach); //view.Log("Đã lưu thành công"); getListNhatKiNhapSach(); } else if (repository.checkRepeat(nhatkinhapsach) != null) { NHATKINHAPSACH temp = repository.checkRepeat(nhatkinhapsach); if (view.Log("Mã sách và thời gian trùng lặp,bạn có muốn cộng dồn vào số lượng cũ") == DialogResult.Yes) { temp.SOLUONG = temp.SOLUONG + nhatkinhapsach.SOLUONG; repository.editNhatKiNhapSach(temp, temp.STT); } getListNhatKiNhapSach(); } }