private bool datavalid() { if (carabayar.SelectedIndex == -1) { Js.Alert( this , "Cara Bayar Tidak Valid.\\n" + "Silakan pilih salah satu cara bayar yang tersedia." , "" ); return(false); } else { string s = ""; bool x = true; if (!Cf.isTgl(tgl)) { x = false; if (s == "") { s = tgl.ID; } tglc.Text = "Tanggal"; } else { tglc.Text = ""; } if (ddlAcc.SelectedIndex == 0) { x = false; if (s == "") { s = ddlAcc.ID; } ddlAccErr.Text = "Harus dipilih"; } else { ddlAccErr.Text = ""; } if (carabayar.SelectedValue == "KK") { if (Cf.isEmpty(nokk)) { x = false; if (s == "") { s = nokk.ID; } nokkc.Text = "Kosong"; } else { nokkc.Text = ""; } if (Cf.isEmpty(bankkk)) { x = false; if (s == "") { s = bankkk.ID; } bankkkc.Text = "Kosong"; } else { bankkkc.Text = ""; } } if (carabayar.SelectedValue == "BG") { nobg.Text = Cf.Pk(nobg.Text); if (Cf.isEmpty(nobg)) { x = false; if (s == "") { s = nobg.ID; } nobgc.Text = "Kosong"; } else { nobgc.Text = ""; } if (!Cf.isTgl(tglbg)) { x = false; if (s == "") { s = tglbg.ID; } tglbgc.Text = "Tanggal"; } else { tglbgc.Text = ""; } if (!Cf.isTgl(tgljtbg)) { x = false; if (s == "") { s = tgljtbg.ID; } tgljtbgc.Text = "Tanggal"; } else { tgljtbgc.Text = ""; } } if (carabayar.SelectedValue == "KK") { if (!Cf.isMoney(biayaadmin)) { x = false; if (s == "") { s = biayaadmin.ID; } Cf.MarkError(biayaadmin); } else { Cf.ClrError(biayaadmin); } } bool adasatu = false; int b = 0; for (int i = 0; i < rsTagihan.Rows.Count; i++) { b++; TextBox lunas = (TextBox)list.FindControl("lunas_" + i); if (lunas.Text != "") { adasatu = true; try { decimal z = Convert.ToDecimal(lunas.Text); } catch { x = false; if (s == "") { s = lunas.ID; } } } } for (int a = 0; a < rsTagihan2.Rows.Count; a++) { TextBox lunas = (TextBox)list.FindControl("lunas_" + (a + b)); if (lunas.Text != "") { adasatu = true; try { decimal z = Convert.ToDecimal(lunas.Text); } catch { x = false; if (s == "") { s = lunas.ID; } } } } if (!adasatu) { x = false; if (s == "") { s = gt.ID; } gtc.Attributes["style"] = "color:red"; } else { gtc.Attributes["style"] = "color:black"; } if (!Cf.isMoney(admBank)) { x = false; if (s == "") { s = admBank.ID; } admBankc.Text = "Angka"; } else { admBankc.Text = ""; } if (!Cf.isMoney(lebihBayar)) { x = false; if (s == "") { s = lebihBayar.ID; } lebihBayarc.Text = "Angka"; } else { lebihBayarc.Text = ""; } if (!Cf.isMoney(lb)) { x = false; if (s == "") { s = lb.ID; } lbc.Text = "Angka"; } else { lbc.Text = ""; } if (anonim.SelectedIndex > 0) { decimal Ano = Db.SingleDecimal("SELECT ISNULL(Nilai, 0) FROM MS_ANONIM WHERE NoAnonim = " + anonim.SelectedValue); if (Convert.ToDecimal(grandtotal.Text) != Ano) { x = false; } } if (!x) { Js.Alert( this , "Input Tidak Valid.\\n\\n" + "Aturan Proses :\\n" + "1. Format Tanggal : Bulan / Tanggal / Tahun.\\n" + "2. Pembayaran harus berupa angka dan minimal untuk satu tagihan.\\n" + "3. Khusus Cek Giro : No. BG tidak boleh kosong.\\n" + "4. Rekening Bank harus dipilih.\\n" + "5. Kolom Admin Bank, Pembulatan dan Lebih Bayar harus angka.\\n" + "6. Apabila menggunakan anonim. Maka nilai total pembayaran harus sesuai dengan nilai anonim.\\n" , "document.getElementById('" + s + "').focus();" ); } //Js.Alert(this, "", gt.Text); return(x); } }