Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Darkc0der Darkc0der is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 598
Rep Power: 14
Darkc0der mempunyai hidup yang Normal
Default [req:]java servlet

aq ad bwt database perjalanan dinas pkk java servlet ad class PerintahTugasApp n PerintahTugasBen. tambh,ubh n hpusnya ud berhasil, tp...pas qt input data n data ud tersimpan trus di test refresh akn muncul "Nomor SPT ini sdh ada !", shrsny kn g prl informasi gituan...slhny dmn?



private void simpanTambah(PrintWriter out, HttpServletRequest request) {

String noSpt = request.getParameter("noSpt");

if (noSpt.equalsIgnoreCase("")) {

out.println(

"Belum diisi Nomor SPT !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

String tSpt = request.getParameter("tSpt");

String bSpt = request.getParameter("bSpt");

String thSpt = request.getParameter("thSpt");

String tglSpt = tSpt + "-" + bSpt + "-" + thSpt;

if (tSpt.equalsIgnoreCase("")) {

out.println(

"Belum dipilih Tanggal SPT !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

if (bSpt.equalsIgnoreCase("")) {

out.println(

"Belum dipilih Bulan SPT !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

if (thSpt.equalsIgnoreCase("")) {

out.println(

"Belum diisi Tahun SPT !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}



String nipPt = request.getParameter("nipPt");

String deskripsiTgs = request.getParameter("deskripsiTgs");

if (deskripsiTgs.equalsIgnoreCase("")) {

out.println(

"Belum diisi Deskripsi Tugas !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

String tmptTgs = request.getParameter("tmptTgs");

if (tmptTgs.equalsIgnoreCase("")) {

out.println(

"Belum diisi Tempat Tugas !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}



String tAwal = request.getParameter("tAwal");

String bAwal = request.getParameter("bAwal");

String thAwal = request.getParameter("thAwal");

String tglAwal = tAwal + "-" + bAwal + "-" + thAwal;



if (tAwal.equalsIgnoreCase("")) {

out.println(

"Belum dipilih Tanggal Awal !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

if (bAwal.equalsIgnoreCase("")) {

out.println(

"Belum dipilih Bulan Awal !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

if (thAwal.equalsIgnoreCase("")) {

out.println(

"Belum diisi Tahun Awal !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}



String tAkhir = request.getParameter("tAkhir");

String bAkhir = request.getParameter("bAkhir");

String thAkhir = request.getParameter("thAkhir");

String tglAkhir = tAkhir + "-" + bAkhir + "-" + thAkhir;



if (tAkhir.equalsIgnoreCase("")) {

out.println(

"Belum dipilih Tanggal Akhir !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

if (bAkhir.equalsIgnoreCase("")) {

out.println(

"Belum dipilih Bulan Akhir !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

if (thAkhir.equalsIgnoreCase("")) {

out.println(

"Belum diisi Tahun Akhir !."

+ " Silahkan tekan tombol >Back< untuk memperbaiki.");

return;

}

PerintahTugasBean pt = PerintahTugasBean.getByNoSpt(noSpt);

if (pt != null) {

out.println("Nomer SPT Ini Sudah Ada!");

return;

}

pt = new PerintahTugasBean();

pt.setNoSpt(noSpt);

Tanggal tgl = new Tanggal(tSpt, bSpt, thSpt);

pt.setTglSpt(tgl);

pt.setNipPt(nipPt);

pt.setDeskripsiTgs(deskripsiTgs);

pt.setTmptTgs(tmptTgs);

Tanggal tgl2 = new Tanggal(tAwal, bAwal, thAwal);

pt.setTglAwal(tgl2);

Tanggal tgl3 = new Tanggal(tAkhir, bAkhir, thAkhir);

pt.setTglAkhir(tgl3);

pt.persistInsert();

this.tampilkan(out);

}

private void tampilkan(PrintWriter out) {

out

.println(

""

+ ""

+ "Isi Data Tambahan Perintah Tugas

"

+ ""

+ "Nomer SPT:"



//Tanggal SPT

+"Tanggal SPT "

+ ""

+ "Tanggal");

for (int i = 1; i

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 06:46 AM.


no new posts