Exemple #1
0
        private void FillHeader()
        {
            btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=REF_SKOM_LOG&Pk=" + Nomor.PadLeft(5, '0') + "'";
            btndel.Attributes["onclick"] = "location.href='SkemaKomisiDel.aspx?Nomor=" + Nomor + "'";
            Act.ProjectList(project);

            DataTable rsHeader = Db.Rs("SELECT * FROM REF_SKOM WHERE NoSkema = " + Nomor);

            if (rsHeader.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                project.SelectedValue = rsHeader.Rows[0]["Project"].ToString();
                LibMkt.ListTipeSales(tipe, project.SelectedValue);
                nama.Text                 = rsHeader.Rows[0]["Nama"].ToString();
                dari.Text                 = Cf.Day(rsHeader.Rows[0]["Dari"]);
                sampai.Text               = Cf.Day(rsHeader.Rows[0]["Sampai"]);
                rumus.SelectedValue       = rsHeader.Rows[0]["Rumus"].ToString();
                dasarhitung.SelectedValue = rsHeader.Rows[0]["DasarHitung"].ToString();
                tipe.SelectedValue        = rsHeader.Rows[0]["SalesTipe"].ToString();

                if (rsHeader.Rows[0]["Inaktif"].ToString() == "False")
                {
                    aktif.Checked   = true;
                    inaktif.Checked = false;
                }
                else
                {
                    aktif.Checked   = false;
                    inaktif.Checked = true;
                }

                if (rumus.SelectedValue == "UNIT")
                {
                    tbRumus1.Visible = true;
                    tbRumus2.Visible = false;
                }
                else
                {
                    tbRumus1.Visible = false;
                    tbRumus2.Visible = true;
                }

                int Count = Db.SingleInteger("SELECT COUNT(NoSkema) FROM REF_SKOM_DETAIL WHERE NoSkema = " + Nomor);
                Baris = Count;

                int Count2 = Db.SingleInteger("SELECT COUNT(NoSkema) FROM REF_SKOM_DETAIL2 WHERE NoSkema = " + Nomor);
                Baris2 = Count2;

                if (Count == 0)
                {
                    Baris = 5;
                }

                if (Count2 == 0)
                {
                    Baris2 = 5;
                }
            }

            if (rumus.SelectedValue == "UNIT")
            {
                tbRumus1.Visible = true;
                tbRumus2.Visible = false;
            }
            else
            {
                tbRumus1.Visible = false;
                tbRumus2.Visible = true;
            }

            //termin
            string    strSql = "SELECT * FROM REF_SKOM_TERM WHERE Project = '" + project.SelectedValue + "' and SalesTipe = '" + tipe.SelectedValue + "'";
            DataTable rs     = Db.Rs(strSql);

            for (int i = 0; i < rs.Rows.Count; i++)
            {
                string v = rs.Rows[i]["NoTermin"].ToString();
                string t = v + ". " + rs.Rows[i]["Nama"].ToString() + " (" + rs.Rows[i]["CaraBayar"].ToString() + ")";
                termin.Items.Add(new ListItem(t, v));
            }

            termin.SelectedValue = rsHeader.Rows[0]["NoTermin"].ToString();
            if (Convert.ToInt32(rsHeader.Rows[0]["NoTermin"]) != 0)
            {
                TerminVisible.Visible = true;
                TbTerm();
            }
        }
Exemple #2
0
        private void FillHeader()
        {
            btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=MS_KOMISIR_LOG&Pk=" + Nomor.PadLeft(5, '0') + "'";

            DataTable rsHeader = Db.Rs("SELECT * FROM MS_KOMISIR WHERE NoKomisiR = '" + Nomor + "'");

            if (rsHeader.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                ket.Text     = rsHeader.Rows[0]["Ket"].ToString();
                tgl.Text     = Cf.Day(rsHeader.Rows[0]["Tgl"]);
                project.Text = rsHeader.Rows[0]["Project"].ToString();
            }
        }
Exemple #3
0
        protected void delbtn_Click(object sender, System.EventArgs e)
        {
            DataTable rs = Db.Rs(
                "SELECT * FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA WHERE Nomor = " + Nomor);

            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else if (!Act.AksesProject(rs.Rows[0]["Project"].ToString()))
            {
                Response.Redirect("/CustomError/SecLevel.html");
            }
            else
            {
                DataTable rsHeader = Db.Rs("SELECT "
                                           + " Nomor"
                                           + ",Nama"
                                           + ",Diskon"
                                           + ",RThousand AS [Pembulatan Nilai]"
                                           + ",Status"
                                           + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA "
                                           + " WHERE Nomor = " + Nomor);

                DataTable rsDetail = Db.Rs("SELECT "
                                           + " CONVERT(VARCHAR, Baris) "
                                           + " + '.  ' + Nama + ' (' + Tipe + ')  ' "
                                           + " + TipeNominal + CONVERT(VARCHAR, Nominal, 1) + '  ' "
                                           + " + TipeJadwal + '(' + CONVERT(VARCHAR, IntJadwal) + ')' + "
                                           + " ISNULL(CONVERT(VARCHAR, TglFix, 106), 'NULL') + '  ' "
                                           + " + 'REF:' + CONVERT(VARCHAR,RefJadwal) + '  ' "
                                           + " + 'BF:' + CONVERT(VARCHAR, BF)"
                                           + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA_DETAIL WHERE Nomor = " + Nomor);

                int cekdigunakan = Db.SingleInteger("select COUNT(distinct(RefSkema)) from " + Mi.DbPrefix + "MARKETINGJUAL..MS_KONTRAK inner join " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA on " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA.Nomor = MS_KONTRAK.RefSkema"
                                                    + " where " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA.Nomor = " + Nomor);
                if (cekdigunakan == 0)
                {
                    Db.Execute("EXEC " + Mi.DbPrefix + "MARKETINGJUAL..spSkemaDel "
                               + Nomor
                               );

                    string Ket = "***Alasan Delete :<br>" + Cf.Str(ket.Text)
                                 + "<br><br>***Data Sebelum Delete :<br>"
                                 + Cf.LogCapture(rsHeader)
                                 + Cf.LogList(rsDetail, "RUMUS");

                    int c = Db.SingleInteger(
                        "SELECT COUNT(*) FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA WHERE Nomor = " + Nomor);

                    if (c == 0)
                    {
                        Db.Execute("EXEC " + Mi.DbPrefix + "MARKETINGJUAL..spLogSkema"
                                   + " 'DELETE'"
                                   + ",'" + Act.UserID + "'"
                                   + ",'" + Act.IP + "'"
                                   + ",'" + Ket + "'"
                                   + ",'" + Nomor.PadLeft(3, '0') + "'"
                                   );

                        Js.Close(this);
                    }
                }
                else
                {
                    //Tidak bisa dihapus
                    frm.Visible   = false;
                    nodel.Visible = true;
                }
            }
        }
Exemple #4
0
        private void FillHeader()
        {
            btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=MS_KOMISI_LOG&Pk=" + Nomor.PadLeft(5, '0') + "'";

            DataTable rsHeader = Db.Rs("SELECT * FROM MS_KOMISI WHERE NoKomisi = '" + Nomor + "'");

            if (rsHeader.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                skema.Text     = rsHeader.Rows[0]["NamaSkema"] + "(" + rsHeader.Rows[0]["NoSkema"].ToString().PadLeft(3, '0') + ")";
                termin.Text    = rsHeader.Rows[0]["NamaTermin"] + "(" + rsHeader.Rows[0]["NoTermin"].ToString().PadLeft(3, '0') + ")";
                nokontrak.Text = rsHeader.Rows[0]["NoKontrak"].ToString();
                nounit.Text    = rsHeader.Rows[0]["NoUnit"].ToString();
                sales.Text     = rsHeader.Rows[0]["NamaAgent"].ToString();
                cust.Text      = rsHeader.Rows[0]["NamaCust"].ToString();
                tgl.Text       = Cf.Day(rsHeader.Rows[0]["Tgl"]);
                project.Text   = rsHeader.Rows[0]["Project"].ToString();
            }
        }
Exemple #5
0
        protected void delbtn_Click(object sender, System.EventArgs e)
        {
            DataTable rs = Db.Rs(
                "SELECT * FROM REF_SKOM_REWARD WHERE NoSkema = " + Nomor);

            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                DataTable rsHeader = Db.Rs("SELECT "
                                           + " NoSkema"
                                           + ",SalesTipe"
                                           + ",Nama"
                                           + ",CONVERT(varchar,Dari,106) AS [Periode Dari]"
                                           + ",CONVERT(varchar,Sampai,106) AS [Periode Sampai]"
                                           + ",Rumus AS [Rumus Komisi]"
                                           + ",Inaktif AS [Status Inaktif]"
                                           + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKOM_REWARD "
                                           + " WHERE NoSkema = " + Nomor);

                DataTable rsDetail = Db.Rs("SELECT [SN] "
                                           + " ,(SELECT Nama FROM REF_AGENT_LEVEL WHERE LevelID = SalesLevel) AS [Level] "
                                           + " ,[Penjualan] "
                                           + " ,[Reward] "
                                           + "  FROM [ISC064_MARKETINGJUAL].[dbo].[REF_SKOM_REWARD_DETAIL] WHERE NoSkema = " + Nomor);

                DataTable rsDetail2 = Db.Rs("SELECT [SN] "
                                            + " ,(SELECT Nama FROM REF_AGENT_LEVEL WHERE LevelID = SalesLevel) AS [Level] "
                                            + " ,[TipeTarget] "
                                            + " ,[TargetBawah] "
                                            + " ,[TargetAtas] "
                                            + " ,[Reward] "
                                            + "  FROM [ISC064_MARKETINGJUAL].[dbo].[REF_SKOM_REWARD_DETAIL2] WHERE NoSkema = " + Nomor);

                Db.Execute("EXEC spSkomRewardDel "
                           + Nomor
                           );

                string Ket = "***Alasan Delete :<br>" + Cf.Str(ket.Text)
                             + "<br><br>***Data Sebelum Delete :<br>"
                             + Cf.LogCapture(rsHeader)
                             + " ------RUMUS UNIT-------" + Cf.LogCapture(rsDetail)
                             + " -------RUMUS KUMULATIF-------" + Cf.LogCapture(rsDetail2);

                int c = Db.SingleInteger(
                    "SELECT COUNT(*) FROM REF_SKOM_REWARD WHERE NoSkema = " + Nomor);

                if (c == 0)
                {
                    Db.Execute("EXEC spLogSkomReward"
                               + " 'DELETE'"
                               + ",'" + Act.UserID + "'"
                               + ",'" + Act.IP + "'"
                               + ",'" + Ket + "'"
                               + ",'" + Nomor.PadLeft(5, '0') + "'"
                               );

                    decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM REF_SKOM_REWARD_LOG ORDER BY LogID DESC");
                    string  Project = Db.SingleString("SELECT Project FROM REF_SKOM_REWARD WHERE NoSkema = " + Nomor);
                    //Db.Execute("UPDATE REF_SKOM_REWARD_LOG SET Project = '" + project.SelectedValue + "' WHERE LogID  = " + LogID);

                    Js.Close(this);
                }
                else
                {
                    //Tidak bisa dihapus
                    frm.Visible   = false;
                    nodel.Visible = true;
                }
            }
        }
Exemple #6
0
        private void FillHeader()
        {
            btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=MS_KOMISI_CFR_LOG&Pk=" + Nomor.PadLeft(5, '0') + "'";
            btndel.Attributes["onclick"] = "location.href='CFRDel.aspx?NoCFR=" + Nomor + "'";

            DataTable rsHeader = Db.Rs("SELECT * FROM MS_KOMISI_CFR WHERE NoCFR = '" + Nomor + "'");

            if (rsHeader.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                ket.Text     = rsHeader.Rows[0]["Ket"].ToString();
                tgl.Text     = Cf.Day(rsHeader.Rows[0]["Tgl"]);
                project.Text = rsHeader.Rows[0]["Project"].ToString();
                tipe.Text    = Db.SingleString("select Tipe from REF_AGENT_TIPE where ID = '" + rsHeader.Rows[0]["SalesTipe"] + "'");
            }
        }
        private void FillHeader()
        {
            btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=REF_SKOM_REWARD_LOG&Pk=" + Nomor.PadLeft(5, '0') + "'";
            btndel.Attributes["onclick"] = "location.href='SkemaRewardDel.aspx?Nomor=" + Nomor + "'";

            Act.ProjectList(project);

            DataTable rsHeader = Db.Rs("SELECT * FROM REF_SKOM_REWARD WHERE NoSkema = " + Nomor);

            if (rsHeader.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                nama.Text             = rsHeader.Rows[0]["Nama"].ToString();
                dari.Text             = Cf.Day(rsHeader.Rows[0]["Dari"]);
                sampai.Text           = Cf.Day(rsHeader.Rows[0]["Sampai"]);
                rumus.SelectedValue   = rsHeader.Rows[0]["Rumus"].ToString();
                project.SelectedValue = rsHeader.Rows[0]["Project"].ToString();
                LibMkt.ListTipeSales(tipe, project.SelectedValue);
                tipe.SelectedValue = rsHeader.Rows[0]["SalesTipe"].ToString();

                if (rsHeader.Rows[0]["Inaktif"].ToString() == "False")
                {
                    aktif.Checked   = true;
                    inaktif.Checked = false;
                }
                else
                {
                    aktif.Checked   = false;
                    inaktif.Checked = true;
                }

                if (rumus.SelectedValue == "UNIT")
                {
                    tbRumus1.Visible = true;
                    tbRumus2.Visible = false;
                }
                else
                {
                    tbRumus1.Visible = false;
                    tbRumus2.Visible = true;
                }

                int Count = Db.SingleInteger("SELECT COUNT(NoSkema) FROM REF_SKOM_REWARD_DETAIL WHERE NoSkema = " + Nomor);
                Baris = Count;

                int Count2 = Db.SingleInteger("SELECT COUNT(NoSkema) FROM REF_SKOM_REWARD_DETAIL2 WHERE NoSkema = " + Nomor);
                Baris2 = Count2;

                if (Count == 0)
                {
                    Baris = 5;
                }

                if (Count2 == 0)
                {
                    Baris2 = 5;
                }
            }

            if (rumus.SelectedValue == "UNIT")
            {
                tbRumus1.Visible = true;
                tbRumus2.Visible = false;
            }
            else
            {
                tbRumus1.Visible = false;
                tbRumus2.Visible = true;
            }
        }
        private void FillHeader()
        {
            btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=REF_SKOM_TERM_LOG&Pk=" + Nomor.PadLeft(5, '0') + "'";
            btndel.Attributes["onclick"] = "location.href='TerminKomisiDel.aspx?Nomor=" + Nomor + "'";
            Act.ProjectList(project);

            DataTable rsHeader = Db.Rs("SELECT * FROM REF_SKOM_TERM WHERE NoTermin = " + Nomor);

            if (rsHeader.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                nama.Text = rsHeader.Rows[0]["Nama"].ToString();
                carabayar.SelectedValue = rsHeader.Rows[0]["CaraBayar"].ToString();
                project.SelectedValue   = rsHeader.Rows[0]["Project"].ToString();
                LibMkt.ListTipeSales(tipe, project.SelectedValue);
                tipe.SelectedValue = rsHeader.Rows[0]["SalesTipe"].ToString();

                if (rsHeader.Rows[0]["Inaktif"].ToString() == "False")
                {
                    aktif.Checked   = true;
                    inaktif.Checked = false;
                }
                else
                {
                    aktif.Checked   = false;
                    inaktif.Checked = true;
                }

                int Count = Db.SingleInteger("SELECT COUNT(NoTermin) FROM REF_SKOM_TERM_DETAIL WHERE NoTermin = " + Nomor);
                Baris = Count;

                if (Count == 0)
                {
                    Baris = 5;
                }
            }
        }
Exemple #9
0
        private bool Save()
        {
            if (valid())
            {
                DataTable rsHeaderBef = Db.Rs("SELECT "
                                              + " Nomor"
                                              + ",Nama"
                                              + ",Project"
                                              + ",Diskon"
                                              + ",DiskonKet AS [Keterangan Diskon]"
                                              + ",Bunga"
                                              + ",BungaKet AS [Keterangan Bunga]"
                                              + ",RThousand AS [Pembulatan Nilai]"
                                              + ",Status"
                                              + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA "
                                              + " WHERE Nomor = " + Nomor);

                DataTable rsBef = Db.Rs("SELECT "
                                        + " CONVERT(VARCHAR, Baris) "
                                        + " + '.  ' + Nama + ' (' + Tipe + ')  ' "
                                        + " + TipeNominal + CONVERT(VARCHAR, Nominal, 1) + '  ' "
                                        + " + TipeJadwal + '(' + CONVERT(VARCHAR, IntJadwal) + ')' + "
                                        + " ISNULL(CONVERT(VARCHAR, TglFix, 106), 'NULL') + '  ' "
                                        + " + 'REF:' + CONVERT(VARCHAR,RefJadwal) + '  ' "
                                        + " + 'BF:' + CONVERT(VARCHAR, BF)"
                                        + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA_DETAIL WHERE Nomor = " + Nomor);

                UpdateSkema();
                UpdateSkemaDetail();
                UpdateSkemaBaru();

                //Response.Write("UPDATE " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA SET  Jenis = '" + jenis.SelectedValue + "' WHERE Nomor = '" + Nomor + "'  ");
                Db.Execute("UPDATE " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA SET Jenis = '" + jenis.SelectedValue + "' WHERE Nomor = '" + Nomor + "'  ");
                Db.Execute("UPDATE " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA SET TipeUnit = '" + lokasi.SelectedValue + "' WHERE Nomor = '" + Nomor + "'  ");

                DataTable rsHeaderAft = Db.Rs("SELECT "
                                              + " Nomor"
                                              + ",Nama"
                                              + ",Project"
                                              + ",Diskon"
                                              + ",DiskonKet AS [Keterangan Diskon]"
                                              + ",Bunga"
                                              + ",BungaKet AS [Keterangan Bunga]"
                                              + ",RThousand AS [Pembulatan Nilai]"
                                              + ",Status"
                                              + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA "
                                              + " WHERE Nomor = " + Nomor);

                DataTable rsAft = Db.Rs("SELECT "
                                        + " CONVERT(VARCHAR, Baris) "
                                        + " + '.  ' + Nama + ' (' + Tipe + ')  ' "
                                        + " + TipeNominal + CONVERT(VARCHAR, Nominal, 1) + '  ' "
                                        + " + TipeJadwal + '(' + CONVERT(VARCHAR, IntJadwal) + ')' + "
                                        + " ISNULL(CONVERT(VARCHAR, TglFix, 106), 'NULL') + '  ' "
                                        + " + 'REF:' + CONVERT(VARCHAR,RefJadwal) + '  ' "
                                        + " + 'BF:' + CONVERT(VARCHAR, BF)"
                                        + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA_DETAIL WHERE Nomor = " + Nomor);

                string Ket = "HEADER :<br>" + Cf.LogCompare(rsHeaderBef, rsHeaderAft)
                             + "<br>"
                             + Cf.LogList(rsBef, rsAft, "RUMUS");

                Db.Execute("EXEC " + Mi.DbPrefix + "MARKETINGJUAL..spLogSkema"
                           + " 'EDIT'"
                           + ",'" + Act.UserID + "'"
                           + ",'" + Act.IP + "'"
                           + ",'" + Ket + "'"
                           + ",'" + Nomor.PadLeft(3, '0') + "'"
                           );

                decimal LogID = Db.SingleDecimal("SELECT TOP 1 LogID FROM REF_SKEMA_LOG ORDER BY LogID DESC");
                Db.Execute("UPDATE REF_SKEMA_LOG SET Project = '" + project.Text + "' WHERE LogID  = " + LogID);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #10
0
        private void FillHeader()
        {
            Js.NumberFormat(barunominal);
            Act.ProjectList(project);
            UnitList(lokasi);
            diskon.Attributes["onfocus"] = "tempnum=CalcFocus(this);tempdisc=this.value;";
            diskon.Attributes["onblur"]  = "if(this.value!=tempdisc){"
                                           + "recaldisc(document.getElementById('diskon'));"
                                           + "}";

            btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=" + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA_LOG&Pk=" + Nomor.PadLeft(3, '0') + "'";
            btndel.Attributes["onclick"] = "location.href='SkemaDel.aspx?Nomor=" + Nomor + "'";

            DataTable rsHeader = Db.Rs("SELECT * FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKEMA WHERE Nomor = " + Nomor);

            if (rsHeader.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else if (!Act.AksesProject(rsHeader.Rows[0]["Project"].ToString()))
            {
                Response.Redirect("/CustomError/SecLevel.html");
            }
            else
            {
                nama.Text      = rsHeader.Rows[0]["Nama"].ToString();
                diskon.Text    = rsHeader.Rows[0]["Diskon"].ToString();
                diskonket.Text = rsHeader.Rows[0]["DiskonKet"].ToString();
                bunga2.Text    = rsHeader.Rows[0]["Bunga"].ToString();
                bungaket.Text  = rsHeader.Rows[0]["BungaKet"].ToString();

                jenis.SelectedValue = rsHeader.Rows[0]["Jenis"].ToString();
                Cf.SelectedValue(project, rsHeader.Rows[0]["Project"].ToString());
                Cf.SelectedValue(lokasi, rsHeader.Rows[0]["TipeUnit"].ToString());
                if (rsHeader.Rows[0]["Status"].ToString() == "A")
                {
                    aktif.Checked   = true;
                    inaktif.Checked = false;
                }
                else
                {
                    aktif.Checked   = false;
                    inaktif.Checked = true;
                }

                round.Checked = (bool)rsHeader.Rows[0]["RThousand"];
            }
        }
        protected void delbtn_Click(object sender, System.EventArgs e)
        {
            DataTable rs = Db.Rs(
                "SELECT * FROM REF_SKOM_TERM WHERE NoTermin = " + Nomor);

            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                DataTable rsHeader = Db.Rs("SELECT "
                                           + " NoTermin"
                                           + ",Nama"
                                           + ",CaraBayar AS [Cara Bayar]"
                                           + ",Inaktif AS [Status Inaktif]"
                                           + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKOM_TERM "
                                           + " WHERE NoTermin = " + Nomor);

                DataTable rsDetail = Db.Rs("SELECT [SN] "
                                           + " ,Nama "
                                           + " ,CONVERT(VARCHAR, PersenCair, 1) AS [Persen Cair] "
                                           + " ,CONVERT(VARCHAR, PersenBF, 1) AS [Persen BF] "
                                           + " ,CONVERT(VARCHAR, PersenDP, 1) AS [Persen DP] "
                                           + " ,CONVERT(VARCHAR, PersenANG, 1) AS [Persen ANG] "
                                           + " ,CASE WHEN [TipeCair]='0' THEN 'Semua' ELSE 'Salah Satu' END AS [Tipe Cair] "
                                           + " ,CASE WHEN [PPJB]='0' THEN 'Tidak' ELSE 'Ya' END AS [PPJB] "
                                           + " ,CASE WHEN [AJB]='0' THEN 'Tidak' ELSE 'Ya' END AS [AJB] "
                                           + " ,CASE WHEN [AKAD]='0' THEN 'Tidak' ELSE 'Ya' END AS [AKAD] "
                                           + "  FROM [ISC064_MARKETINGJUAL].[dbo].[REF_SKOM_TERM_DETAIL] WHERE NoTermin = " + Nomor);

                Db.Execute("EXEC spSkomTermDel "
                           + Nomor
                           );

                string Ket = "***Alasan Delete :<br>" + Cf.Str(ket.Text)
                             + "<br><br>***Data Sebelum Delete :<br>"
                             + Cf.LogCapture(rsHeader)
                             + " ------RUMUS TERMIN-------" + Cf.LogCapture(rsDetail);

                int c = Db.SingleInteger(
                    "SELECT COUNT(*) FROM REF_SKOM_TERM WHERE NoTermin = " + Nomor);

                if (c == 0)
                {
                    Db.Execute("EXEC spLogSkomTerm"
                               + " 'DELETE'"
                               + ",'" + Act.UserID + "'"
                               + ",'" + Act.IP + "'"
                               + ",'" + Ket + "'"
                               + ",'" + Nomor.PadLeft(5, '0') + "'"
                               );

                    decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM REF_SKOM_TERM_LOG ORDER BY LogID DESC");
                    string  Project = Db.SingleString("SELECT Project FROM REF_SKOM_TERM WHERE NoTermin = " + Nomor);
                    Db.Execute("UPDATE REF_SKOM_TERM_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);

                    Js.Close(this);
                }
                else
                {
                    //Tidak bisa dihapus
                    frm.Visible   = false;
                    nodel.Visible = true;
                }
            }
        }
Exemple #12
0
        private void FillHeader()
        {
            btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=MS_KOMISI_REWARD_LOG&Pk=" + Nomor.PadLeft(5, '0') + "'";

            DataTable rsHeader = Db.Rs("SELECT * FROM MS_KOMISI_REWARD WHERE NoReward = '" + Nomor + "'");

            if (rsHeader.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                skema.Text   = rsHeader.Rows[0]["NamaSkema"] + "(" + rsHeader.Rows[0]["NoSkema"].ToString().PadLeft(3, '0') + ")";
                sales.Text   = rsHeader.Rows[0]["NamaAgent"].ToString();
                periode.Text = Cf.Day(rsHeader.Rows[0]["PeriodeDari"]) + " s/d " + Cf.Day(rsHeader.Rows[0]["PeriodeSampai"]);
                reward.Text  = rsHeader.Rows[0]["Reward"].ToString();
                tgl.Text     = Cf.Day(rsHeader.Rows[0]["Tgl"]);
                project.Text = rsHeader.Rows[0]["Project"].ToString();
            }
        }
Exemple #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();
            Act.NoCache();

            Act.CekInt("Nomor");
            Act.CekInt("Baris");

            DataTable rs = Db.Rs(
                "SELECT * FROM REF_SKEMA_DETAIL WHERE Nomor = " + Nomor + " AND Baris = " + Baris);

            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                DataTable rsHeader = Db.Rs("SELECT "
                                           + " Nomor"
                                           + ",Nama"
                                           + ",Diskon"
                                           + ",RThousand AS [Pembulatan Nilai]"
                                           + ",Status"
                                           + " FROM REF_SKEMA "
                                           + " WHERE Nomor = " + Nomor);

                DataTable rsBef = Db.Rs("SELECT "
                                        + " CONVERT(VARCHAR, Baris) "
                                        + " + '.  ' + Nama + ' (' + Tipe + ')  ' "
                                        + " + TipeNominal + CONVERT(VARCHAR, Nominal, 1) + '  ' "
                                        + " + TipeJadwal + '(' + CONVERT(VARCHAR, IntJadwal) + ')' + "
                                        + " ISNULL(CONVERT(VARCHAR, TglFix, 106), 'NULL') + '  ' "
                                        + " + 'REF:' + CONVERT(VARCHAR,RefJadwal) + '  ' "
                                        + " + 'BF:' + CONVERT(VARCHAR, BF)"
                                        + " FROM REF_SKEMA_DETAIL WHERE Nomor = " + Nomor);

                Db.Execute("EXEC spSkemaDelBaris "
                           + Nomor + "," + Baris
                           );

                DataTable rsAft = Db.Rs("SELECT "
                                        + " CONVERT(VARCHAR, Baris) "
                                        + " + '.  ' + Nama + ' (' + Tipe + ')  ' "
                                        + " + TipeNominal + CONVERT(VARCHAR, Nominal, 1) + '  ' "
                                        + " + TipeJadwal + '(' + CONVERT(VARCHAR, IntJadwal) + ')' + "
                                        + " ISNULL(CONVERT(VARCHAR, TglFix, 106), 'NULL') + '  ' "
                                        + " + 'REF:' + CONVERT(VARCHAR,RefJadwal) + '  ' "
                                        + " + 'BF:' + CONVERT(VARCHAR, BF)"
                                        + " FROM REF_SKEMA_DETAIL WHERE Nomor = " + Nomor);

                string Ket = Cf.LogCapture(rsHeader)
                             + "<br>---DELETE RUMUS---<br>"
                             + Cf.LogList(rsBef, rsAft, "RUMUS");

                Db.Execute("EXEC spLogSkema"
                           + " 'EDIT'"
                           + ",'" + Act.UserID + "'"
                           + ",'" + Act.IP + "'"
                           + ",'" + Ket + "'"
                           + ",'" + Nomor.PadLeft(3, '0') + "'"
                           );

                Response.Redirect("SkemaEdit.aspx?Nomor=" + Nomor + "&done=1");
            }
        }
Exemple #14
0
        protected void delbtn_Click(object sender, System.EventArgs e)
        {
            DataTable rs = Db.Rs(
                "SELECT * FROM REF_SKOM WHERE Nomor = " + Nomor);

            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                DataTable rsHeader = Db.Rs("SELECT "
                                           + " Nomor"
                                           + ",Nama"
                                           + ",Status"
                                           + " FROM REF_SKOM "
                                           + " WHERE Nomor = " + Nomor);

                DataTable rsDetail = Db.Rs("SELECT [Baris] "
                                           + " ,[Tipe] "
                                           + " ,[Nama] "
                                           + " ,[Nominal] "
                                           + " ,case when [TipeNominal]='%' then 'Persen' else 'Nominal' end as [Tipe Nominal] "
                                           + "  FROM [ISC064_MARKETINGJUAL].[dbo].[REF_SKOM_DETAIL] where Nomor='" + Nomor + "'");
                DataTable rsTermin = Db.Rs("SELECT [Baris] "
                                           + " ,[Nama] "
                                           + " ,[PersenLv] "
                                           + " ,[Lunas] "
                                           + " ,[NilaiLunas] "
                                           + " ,[BF] "
                                           + " ,[NilaiBF] "
                                           + " ,[DP] "
                                           + " ,[NilaiDP] "
                                           + " ,[ANG] "
                                           + " ,[NilaiANG] "
                                           + " ,[PPJB] "
                                           + " ,[Akad] "
                                           + " ,[Mode] "
                                           + "  FROM [ISC064_MARKETINGJUAL].[dbo].[REF_SKOM_TERM] where Nomor='" + Nomor + "'");

                Db.Execute("EXEC spSkomDel "
                           + Nomor
                           );

                string Ket = "***Alasan Delete :<br>" + Cf.Str(ket.Text)
                             + "<br><br>***Data Sebelum Delete :<br>"
                             + Cf.LogCapture(rsHeader)
                             + " ------DETAILS-------" + Cf.LogCapture(rsDetail)
                             + " -------TERMIN-------" + Cf.LogCapture(rsTermin);

                int c = Db.SingleInteger(
                    "SELECT COUNT(*) FROM REF_SKOM WHERE NoSkema = " + Nomor);

                if (c == 0)
                {
                    Db.Execute("EXEC spLogSkom"
                               + " 'DELETE'"
                               + ",'" + Act.UserID + "'"
                               + ",'" + Act.IP + "'"
                               + ",'" + Ket + "'"
                               + ",'" + Nomor.PadLeft(3, '0') + "'"
                               );
                    Js.Close(this);
                }
                else
                {
                    //Tidak bisa dihapus
                    frm.Visible   = false;
                    nodel.Visible = true;
                }
            }
        }
Exemple #15
0
        protected void delbtn_Click(object sender, System.EventArgs e)
        {
            DataTable rs = Db.Rs(
                "SELECT * FROM REF_SKOM_CF WHERE NoSkema = " + Nomor);

            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                DataTable rsHeader = Db.Rs("SELECT "
                                           + " NoSkema"
                                           + ",SalesTipe"
                                           + ",Nama"
                                           + ",CONVERT(varchar,Dari,106) AS [Periode Dari]"
                                           + ",CONVERT(varchar,Sampai,106) AS [Periode Sampai]"
                                           + ",Rumus AS [Rumus Komisi]"
                                           + ",DasarHitung AS [Dasar Perhitungan]"
                                           + ",Inaktif AS [Status Inaktif]"
                                           + " FROM " + Mi.DbPrefix + "MARKETINGJUAL..REF_SKOM_CF "
                                           + " WHERE NoSkema = " + Nomor);

                DataTable rsDetail = Db.Rs("SELECT [SN] "
                                           + " ,(SELECT Nama FROM REF_AGENT_LEVEL WHERE LevelID = SalesLevel) AS [Level] "
                                           + " ,[Nilai] "
                                           + " ,CASE WHEN [TipeTarif]='%' THEN 'Persen' ELSE 'Nominal' END AS [Tipe Tarif] "
                                           + " ,CASE WHEN [PotongKomisi]='True' THEN 'Ya' ELSE 'Tidak' END AS [Potong Komisi] "
                                           + "  FROM [ISC064_MARKETINGJUAL].[dbo].[REF_SKOM_CF_DETAIL] WHERE NoSkema = " + Nomor);

                DataTable rsDetail2 = Db.Rs("SELECT [SN] "
                                            + " ,(SELECT Nama FROM REF_AGENT_LEVEL WHERE LevelID = SalesLevel) AS [Level] "
                                            + " ,[TipeTarget] "
                                            + " ,[TargetBawah] "
                                            + " ,[TargetAtas] "
                                            + " ,[Nilai] "
                                            + " ,CASE WHEN [TipeTarif]='%' THEN 'Persen' ELSE 'Nominal' END AS [Tipe Tarif] "
                                            + " ,CASE WHEN [PotongKomisi]='True' THEN 'Ya' ELSE 'Tidak' END AS [Potong Komisi] "
                                            + "  FROM [ISC064_MARKETINGJUAL].[dbo].[REF_SKOM_CF_DETAIL2] WHERE NoSkema = " + Nomor);

                Db.Execute("EXEC spSkomCFDel "
                           + Nomor
                           );

                string Ket = "***Alasan Delete :<br>" + Cf.Str(ket.Text)
                             + "<br><br>***Data Sebelum Delete :<br>"
                             + Cf.LogCapture(rsHeader)
                             + " ------RUMUS UNIT-------" + Cf.LogCapture(rsDetail)
                             + " -------RUMUS KUMULATIF-------" + Cf.LogCapture(rsDetail2);

                int c = Db.SingleInteger(
                    "SELECT COUNT(*) FROM REF_SKOM_CF WHERE NoSkema = " + Nomor);

                if (c == 0)
                {
                    Db.Execute("EXEC spLogSkomCF"
                               + " 'DELETE'"
                               + ",'" + Act.UserID + "'"
                               + ",'" + Act.IP + "'"
                               + ",'" + Ket + "'"
                               + ",'" + Nomor.PadLeft(5, '0') + "'"
                               );

                    Js.Close(this);
                }
                else
                {
                    //Tidak bisa dihapus
                    frm.Visible   = false;
                    nodel.Visible = true;
                }
            }
        }