示例#1
0
        private bool datavalid()
        {
            bool x = true;

            //if(!Cf.isMoney(ppn))
            //{
            //    x = false;
            //    ppnc.Text = "Angka";
            //    //ppn.Text = "0";
            //}
            //else
            //    ppnc.Text = "";

            if (Cf.isEmpty(skema))
            {
                x           = false;
                skemac.Text = "Tidak Boleh Kosong";
            }

            if (!Cf.isMoney(bunga))
            {
                x           = false;
                bungac.Text = "Angka";
                //ppn.Text = "0";
            }
            else
            {
                bungac.Text = "";
            }

            if (!Cf.isMoney(disc))
            {
                x          = false;
                discc.Text = "Angka";
                //disc.Text = "0";
            }
            else
            {
                discc.Text = "";
            }

            if ((sifatppn.SelectedIndex != 0) && (sifatppn.SelectedIndex != 1))
            {
                x = false;
                sifatppnc.Text = "Pilih Salah Satu";
            }
            else
            {
                sifatppnc.Text = "";
            }

            decimal Netto = Convert.ToDecimal(gross.Text) + Convert.ToDecimal(bunga.Text) - Convert.ToDecimal(disc.Text) - Convert.ToDecimal(discSkema.Text);

            if (Netto < Convert.ToDecimal(pricemin.Text))
            {
                x           = false;
                errorc.Text = "Nilai kontrak di bawah batas minimum";
            }
            else
            {
                errorc.Text = "";
            }

            if (Convert.ToDecimal(nilai.Text) < Convert.ToDecimal(pricemin.Text))
            {
                if (!x)
                {
                    Js.Alert(
                        this
                        , "Input Tidak Valid.\\n\\n"
                        + "Aturan Proses :\\n"
                        + "1. Nilai Kontrak harus berupa angka dan positif.\\n"
                        + "2. Nilai Kontrak harus lebih besar dari harga minimum.\\n"
                        + "3. Nilai Include dan Exclude PPN harus dipilih.\\n"
                        , "document.getElementById('" + nilai.ID + "').focus();"
                        + "document.getElementById('" + nilai.ID + "').select();"
                        );
                }
            }

            return(x);
        }
示例#2
0
        protected void save_Click(object sender, System.EventArgs e)
        {
            // if (Save()) Response.Redirect("JenisEdit.aspx?done=1&NoJenis=" + NoJenis);

            if (valid())
            {
                int ada = Db.SingleInteger("SELECT COUNT(*) FROM REF_JENIS WHERE Jenis='" + jenis.Text + "' AND SN != " + NoJenis);
                if (ada > 0)
                {
                    string s = "";

                    Js.Alert(
                        this
                        , "Input Tidak Valid.\\n\\n"
                        + "Aturan Proses :\\n"
                        + "1. Tipe Unit Properti tidak boleh kosong.\\n"
                        + "2. Nama Tipe Unit tidak boleh kosong.\\n"
                        + "3. Tipe Unit Duplikat.\\n"
                        , "document.getElementById('" + s + "').focus();"
                        + "document.getElementById('" + s + "').select();"
                        );
                }
                else
                {
                    string    strSql = "SELECT * FROM REF_JENIS WHERE SN = '" + NoJenis + "'";
                    DataTable rs     = Db.Rs(strSql);
                    DataTable rsBef  = Db.Rs("SELECT "
                                             + " Jenis"
                                             + ",Nama"
                                             + ",SN"
                                             + " FROM REF_JENIS "
                                             + " WHERE SN = '" + NoJenis + "'");

                    //relasi
                    Db.Execute("UPDATE MS_UNIT SET Jenis='" + jenis.Text + "' WHERE Jenis='" + rs.Rows[0]["Jenis"] + "'");
                    Db.Execute("UPDATE MS_KONTRAK SET Jenis='" + jenis.Text + "' WHERE Jenis='" + rs.Rows[0]["Jenis"] + "'");
                    Db.Execute("UPDATE MS_RESERVASI SET Jenis='" + jenis.Text + "' WHERE Jenis='" + rs.Rows[0]["Jenis"] + "'");
                    Db.Execute("UPDATE MS_RESERVASI_OBS SET Jenis='" + jenis.Text + "' WHERE Jenis='" + rs.Rows[0]["Jenis"] + "'");

                    Db.Execute("UPDATE REF_JENIS SET Jenis='" + jenis.Text + "',Nama='" + namajenis.Text + "' WHERE SN = '" + NoJenis + "'");

                    DataTable rsAft = Db.Rs("SELECT "
                                            + " Jenis"
                                            + ",Nama"
                                            + ",SN"
                                            + " FROM REF_JENIS "
                                            + " WHERE SN = '" + NoJenis + "'");

                    //Logfile
                    string Ket = "Jenis: " + jenis.Text + "<br>"
                                 + Cf.LogCompare(rsBef, rsAft);

                    Db.Execute("EXEC spLogJenis"
                               + " 'EDIT'"
                               + ",'" + Act.UserID + "'"
                               + ",'" + Act.IP + "'"
                               + ",'" + Ket + "'"
                               + ",'" + NoJenis + "'"
                               );

                    Response.Redirect("JenisEdit.aspx?done=1&NoJenis=" + NoJenis);
                }
            }
        }
示例#3
0
        private bool valid()
        {
            bool x = true;

            int c = Db.SingleInteger("SELECT COUNT(*) FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "' AND Status = 'A' and CaraBayar = 'KPR'");

            if (c == 0)
            {
                x = false;
            }

            int a = Db.SingleInteger("SELECT COUNT(*) FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "' AND StatusWawancara = 'SELESAI'");

            if (a == 0)
            {
                x = false;
            }

            decimal Pengajuan = Db.SingleDecimal("SELECT NilaiPengajuan FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "'");
            decimal Approv    = 0;
            decimal TambahUm  = 0;

            if (!Cf.isEmpty(nilai))
            {
                if (!Cf.isMoney(nilai))
                {
                    x           = false;
                    nilaic.Text = "Format Angka";
                }
                else
                {
                    Approv = Convert.ToDecimal(nilai.Text);
                }
            }
            if (!Cf.isEmpty(tambahum))
            {
                if (!Cf.isMoney(tambahum))
                {
                    x             = false;
                    tgljtumc.Text = "Format Angka";
                }
                else
                {
                    TambahUm = Convert.ToDecimal(tambahum.Text);
                }
            }


            if (!x)
            {
                Js.Alert(
                    this
                    , "Kontrak Tidak Valid.\\n\\n"
                    + "Kemungkinan Sebab :\\n"
                    + "1. Kontrak tersebut tidak terdaftar.\\n"
                    + "2. Kontrak tersebut sudah dibatalkan.\\n"
                    + "3. Kontrak tersebut bukan KPR.\\n"
                    + "4. Kontrak tersebut belum melalui proses wawancara.\\n"
                    , "document.getElementById('nokontrak').focus();"
                    + "document.getElementById('nokontrak').select();"
                    );
            }

            return(x);
        }
示例#4
0
        private bool valid()
        {
            string s = "";
            bool   x = true;

            if (!Cf.isTgl(tglkontrak))
            {
                x = false;
                if (s == "")
                {
                    s = tglkontrak.ID;
                }
                tglkontrakc.Text = "Tanggal";
            }
            else
            {
                tglkontrakc.Text = "";
            }

            if (!Cf.isTgl(targetst))
            {
                x = false;
                if (s == "")
                {
                    s = targetst.ID;
                }
                targetstc.Text = "Tanggal";
            }
            else
            {
                targetstc.Text = "";
            }

            if (tra.Visible)
            {
                if (!Cf.isMoney(nilaikpa))
                {
                    x = false;
                    if (s == "")
                    {
                        s = nilaikpa.ID;
                    }
                    nilaikpac.Text = "Angka";
                }
                else
                {
                    nilaikpac.Text = "";
                }
            }

            if (trc.Visible)
            {
                if (!Cf.isMoney(nilaiklaim))
                {
                    x = false;
                    if (s == "")
                    {
                        s = nilaiklaim.ID;
                    }
                    nilaiklaimc.Text = "Angka";
                }
                else
                {
                    nilaiklaimc.Text = "";
                }
            }

            if (trd.Visible)
            {
                if (!Cf.isMoney(totallunas))
                {
                    x = false;
                    if (s == "")
                    {
                        s = totallunas.ID;
                    }
                    totallunasc.Text = "Angka";
                }
                else
                {
                    totallunasc.Text = "";
                }
            }

            if (tre.Visible)
            {
                if (!Cf.isMoney(nilaipulang))
                {
                    x = false;
                    if (s == "")
                    {
                        s = nilaipulang.ID;
                    }
                    nilaipulangc.Text = "Angka";
                }
                else
                {
                    nilaipulangc.Text = "";
                }
            }

            //if (Cf.isEmpty(noqueue))
            //{
            //    x = false;
            //    if (s == "") s = noqueue.ID;
            //    noqueuec.Text = "Kosong";
            //}
            //else
            //    noqueuec.Text = "";

            if (TipeAgent == "INHOUSE" && agentreff.SelectedValue == "")
            {
                x = false;
                if (s == "")
                {
                    s = agentreff.ID;
                }
                agentreffc.Text = "Harus pilih salah satu";
            }
            else
            {
                agentreffc.Text = "";
            }

            if (!x)
            {
                Js.Alert(
                    this
                    , "Input Tidak Valid.\\n\\n"
                    + "Aturan Proses :\\n"
                    + "1. Format Tanggal : Bulan / Tanggal / Tahun.\\n"
                    + "2. Nilai Realisasi KPR, Nilai Klaim, Total Pelunasan pada saat Batal, Nilai Kembali harus berupa angka.\\n"
                    + "3. NUP tidak boleh Kosong."
                    , "document.getElementById('" + s + "').focus();"
                    + "document.getElementById('" + s + "').select();"
                    );
            }

            return(x);
        }