Exemple #1
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Akad";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + Convert.ToDateTime(dari.Text) + "'"
                       + ",'" + Convert.ToDateTime(sampai.Text) + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_MARKETINGJUAL..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "LapAkad" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "LapAkad" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //declare parameter
            string Lokasi = lokasi.SelectedValue;

            string nStatusS = "";
            string nStatusB = "";
            string nStatusA = "";

            if (statusS.Checked == true)
            {
                nStatusS = statusS.Text;
            }
            else
            {
                nStatusS = "";
            }
            if (statusB.Checked == true)
            {
                nStatusB = statusB.Text;
            }
            else
            {
                nStatusB = "";
            }
            if (statusA.Checked == true)
            {
                nStatusA = statusA.Text;
            }
            else
            {
                nStatusA = "";
            }

            string nS = "";
            string nB = "";
            string nD = "";

            if (S.Checked == true)
            {
                nS = S.Text;
            }
            else
            {
                nS = "";
            }
            if (B.Checked == true)
            {
                nB = B.Text;
            }
            else
            {
                nB = "";
            }
            if (D.Checked == true)
            {
                nD = D.Text;
            }
            else
            {
                nD = "";
            }

            string tgl = "";

            if (tbTgl.Checked)
            {
                tgl = "TglAkad";
            }

            string rek = rekening.SelectedValue;

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            //string hasil = ddlHasil.SelectedValue;

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "kpa/LaporanPDF/PDFAKAD.aspx?id=" + rs.Rows[0]["AttachmentID"] + "&status_s=" + nStatusS + "&status_b=" + nStatusB
                          + "&status_a=" + nStatusA + "&S=" + nS + "&B=" + nB + "&D=" + nD + "&rek=" + rek + "&tgl=" + tgl + "&lokasi=" + Lokasi + "&project=" + Project + "&pers=" + pers.SelectedValue + "";

            //update link
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Executive Summary";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + null + "'"
                       + ",'" + null + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_MARKETINGJUAL..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "ExecutiveSummary" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "ExecutiveSummary" + rs.Rows[0]["AttachmentID"] + ".pdf";

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "marketingjual/LaporanPDF/PDFExecutiveSummary.aspx?project=" + Project + "&pers=" + pers.SelectedValue;

            //update link
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
        protected void pdf_Click(object sender, EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Daftar Username";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + null + "'"
                       + ",'" + null + "'"
                       //+ ",'" + Cf.Date(dari.Text) + "'"
                       //+ ",'" + Cf.Date(sampai.Text) + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "LapDaftarUser" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "LapDaftarUser" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //declare parameter
            string nStatusS = "";
            string nStatusA = "";
            string nStatusB = "";

            if (rblstatus.SelectedValue == "S")
            {
                nStatusS = "SEMUA";
            }
            else
            {
                nStatusS = "";
            }
            if (rblstatus.SelectedValue == "A")
            {
                nStatusA = "AKTIF";
            }
            else
            {
                nStatusA = "";
            }
            if (rblstatus.SelectedValue == "B")
            {
                nStatusB = "BLOKIR";
            }
            else
            {
                nStatusB = "";
            }

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "security/LaporanPDF/PDFLapDaftarUser.aspx?id=" + rs.Rows[0]["AttachmentID"] + "&status_s=" + nStatusS + "&status_b=" + nStatusB + "&status_a=" + nStatusA + "";

            //update link
            Db.Execute("UPDATE LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #4
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan History Price List";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + null + "'"
                       + ",'" + null + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_MARKETINGJUAL..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "LapHistoryPriceList" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "LapHistoryPriceList" + rs.Rows[0]["AttachmentID"] + ".pdf";


            string Input = "";

            if (periode.SelectedIndex != 0)
            {
                string[] z = periode.SelectedValue.Split(',');
                Input = z[0] + "-" + z[1];
            }
            else
            {
                Input = periode.SelectedValue;
            }

            string nStatusS = "";
            string nStatusA = "";
            string nStatusB = "";

            if (statusS.Checked == true)
            {
                nStatusS = statusS.Text;
            }
            else
            {
                nStatusS = "";
            }
            if (statusA.Checked == true)
            {
                nStatusA = statusA.Text;
            }
            else
            {
                nStatusA = "";
            }
            if (statusB.Checked == true)
            {
                nStatusB = statusB.Text;
            }
            else
            {
                nStatusB = "";
            }

            string Project = "";

            if (project.SelectedValue == "SEMUA")
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            string nm  = string.Empty;
            string nm2 = string.Empty;

            try
            {
                foreach (ListItem item in jenis.Items)
                {
                    if (item.Selected == true)
                    {
                        nm += item.Value.Replace(" ", "%") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }
            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "adminjual/LaporanPDF/PDFHistoryPriceList.aspx?id=" + rs.Rows[0]["AttachmentID"] + "&jenis=" + nm + "&input=" + Input + "&status_s=" + nStatusS + "&status_b=" + nStatusB + "&status_a=" + nStatusA + "&project=" + Project + "";

            //update link
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 16.5in --page-height 40in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #5
0
        protected void pdf_Click(object sender, EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Skema Cara Bayar";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC ISC064_MARKETINGJUAL..spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + Cf.Date(tglkontrak.Text) + "'"
                       + ",'" + null + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_MARKETINGJUAL..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "SkemaCaraBayar" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);

            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "SkemaCaraBayar" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //parameter
            string CaraBayar = carabayar.SelectedValue;

            CaraBayar = CaraBayar.Replace(" ", "%");
            string NoStok = nostock.Text;
            int    Metode = metode.SelectedIndex;
            string potong = "";

            if (dp1potong.Checked)
            {
                potong = "DP1";
            }
            else if (dpspotong.Checked)
            {
                potong = "DPS";
            }
            else if (ang1potong.Checked)
            {
                potong = "ANG1";
            }
            else
            {
                potong = "ANGS";
            }

            string persen = "";

            if (bfpersen.Checked)
            {
                persen = "%";
            }
            string persen2 = "";

            if (dppersen.Checked)
            {
                persen2 = "%";
            }
            string persen3 = "";

            if (angpersen.Checked)
            {
                persen3 = "%";
            }
            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "marketingjual/LaporanPDF/PDFSkema.aspx?id=" + rs.Rows[0]["AttachmentID"]
                          + "&nilai=" + Cf.Num(nilai.Text)
                          + "&carabayar=" + carabayar.SelectedValue
                          + "&metode=" + Metode
                          + "&diskon=" + nilaiDiskon.Text
                          + "&presenvalue=" + nilaiBunga.Text
                          + "&dpp=" + dpp.Text
                          + "&ppn=" + ppn.Text
                          + "&bfkali=" + bfkali.Text
                          + "&bflama1=" + bflama1.Text
                          + "&bflama2=" + bflama2.Text
                          + "&bfhari1=" + bfhari1.Text
                          + "&bfhari2=" + bfhari2.Text
                          + "&bfjumlah=" + bfjumlah.Text
                          + "&bfpersen=" + persen
                          + "&dpkali=" + dpkali.Text
                          + "&dplama1=" + dplama1.Text
                          + "&dplama2=" + dplama2.Text
                          + "&dphari1=" + dphari1.Text
                          + "&dphari2=" + dphari2.Text
                          + "&dpjumlah=" + dpjumlah.Text
                          + "&dppersen=" + persen2
                          + "&angkali=" + angkali.Text
                          + "&anglama1=" + anglama1.Text
                          + "&anglama2=" + anglama2.Text
                          + "&anghari1=" + anghari1.Text
                          + "&anghari2=" + anghari2.Text
                          + "&angjumlah=" + angjumlah.Text
                          + "&angpersen=" + persen3
                          + "&potong=" + potong
                          + "&nostok=" + nostock.Text;

            ;

            //update link
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #6
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Security Log";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       //  + " '" + Convert.ToString(007) + "'"
                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + Cf.Date(dari.Text) + "'"
                       + ",'" + Cf.Date(sampai.Text) + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_SECURITY..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "LapSecurityLog" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_SECURITY..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "LapSecurityLog" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //declare parameter
            string SecLevel = seclevel.SelectedValue;
            string akt      = string.Empty;

            try
            {
                foreach (ListItem item in aktivitas.Items)
                {
                    if (item.Selected == true)
                    {
                        akt += item.Value + '-';
                    }
                }
                // retval.TrimEnd(',');
            }
            catch (Exception)
            {
            }


            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "security/LaporanPDF/PDFSecurityLog.aspx?id=" + rs.Rows[0]["AttachmentID"] + "&user="******"&ip=" + ip.SelectedValue + "&aktivitas=" + akt + "&seclevel=" + SecLevel + "";

            //update link
            Db.Execute("UPDATE ISC064_SECURITY..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);


            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(60000);


            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #7
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Stok Cek Giro Tahunan";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + null + "'"
                       + ",'" + null + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_FINANCEAR..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "StokCekGiroTahunan" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "StokCekGiroTahunan" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //parameter
            string Status      = metode.SelectedValue;
            string Perhitungan = "";

            if (kuantitas.Checked)
            {
                Perhitungan = "KUANTITAS";
            }
            else if (rupiah.Checked)
            {
                Perhitungan = "RUPIAH";
            }

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "financear/LaporanPDF/PDFStokBGAll.aspx?id=" + rs.Rows[0]["AttachmentID"]
                          + "&userid=" + UserID
                          + "&perhitungan=" + Perhitungan
                          + "&dari=" + daric.SelectedValue
                          + "&sampai=" + sampaic.SelectedValue
                          + "&metode=" + metode.SelectedValue
                          + "&project=" + Project
                          + "&pers=" + pers.SelectedValue
            ;

            //update link
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #8
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Master Tagihan";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + Convert.ToDateTime(dari.Text) + "'"
                       + ",'" + Convert.ToDateTime(sampai.Text) + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_FINANCEAR..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "LaporanMasterTagihan" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "LaporanMasterTagihan" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //parameter
            string Tipe = tipe.SelectedValue;

            string nStatusS = "";
            string nStatusA = "";
            string nStatusB = "";

            if (statusS.Checked == true)
            {
                nStatusS = statusS.Text;
            }
            else
            {
                nStatusS = "";
            }
            if (statusA.Checked == true)
            {
                nStatusA = statusA.Text;
            }
            else
            {
                nStatusA = "";
            }
            if (statusB.Checked == true)
            {
                nStatusB = statusB.Text;
            }
            else
            {
                nStatusB = "";
            }

            string JenisTgl = "";

            if (tglkontrak.Checked == true)
            {
                JenisTgl = "TglKontrak";
            }
            else if (tgljt.Checked == true)
            {
                JenisTgl = "TglJt";
            }

            string StatusKPA = "";

            if (includekpa.Checked)
            {
                StatusKPA = "includekpa";
            }
            else if (excludekpa.Checked)
            {
                StatusKPA = "excludekpa";
            }

            string nmtipe = string.Empty;

            try
            {
                foreach (ListItem item in tipe.Items)
                {
                    if (item.Selected == true)
                    {
                        nmtipe += item.Value.Replace(" ", "%") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "collection/LaporanPDF/PDFMasterTagihan.aspx?id=" + rs.Rows[0]["AttachmentID"]
                          + "&tipe=" + nmtipe
                          + "&status_a=" + nStatusA
                          + "&status_b=" + nStatusB
                          + "&status_s=" + nStatusS
                          + "&jenistgl=" + JenisTgl
                          + "&statuskpa=" + StatusKPA
                          + "&userid=" + UserID
                          + "&project=" + Project
                          + "&pers=" + pers.SelectedValue
            ;

            //update link
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #9
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Master Kontrak";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + Cf.Date(dari.Text) + "'"
                       + ",'" + Cf.Date(sampai.Text) + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_MARKETINGJUAL..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "MasterKontrak" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "MasterKontrak" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //declare parameter
            string Lokasi   = lokasi.SelectedValue.Replace(" ", "%");
            string nStatusS = "";
            string nStatusA = "";
            string nStatusB = "";

            if (statusS.Checked == true)
            {
                nStatusS = statusS.Text;
            }
            else
            {
                nStatusS = "";
            }
            if (statusA.Checked == true)
            {
                nStatusA = statusA.Text;
            }
            else
            {
                nStatusA = "";
            }
            if (statusB.Checked == true)
            {
                nStatusB = statusB.Text;
            }
            else
            {
                nStatusB = "";
            }

            //string Agent = agent.SelectedValue;

            string SPelunasan = String.Empty;

            if (semua.Checked)
            {
                SPelunasan = "SEMUA";
            }
            else if (statusL0.Checked)
            {
                SPelunasan = "statusL0";
            }
            else if (statusL.Checked)
            {
                SPelunasan = "statusL";
            }
            else if (statusL1.Checked)
            {
                SPelunasan = "statusL1";
            }
            else if (statusL2.Checked)
            {
                SPelunasan = "statusL2";
            }

            string nm  = string.Empty;
            string nm2 = string.Empty;

            try
            {
                foreach (ListItem item in jenis.Items)
                {
                    if (item.Selected == true)
                    {
                        nm += item.Value.Replace(" ", "%") + "-";
                    }
                }
            }

            catch (Exception)
            {
            }

            //Cara Bayar
            try
            {
                foreach (ListItem item in cblcarabayar.Items)
                {
                    if (item.Selected == true)
                    {
                        nm2 += item.Value.Replace(" ", "+") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }
            string BF1 = "";
            string BF2 = "";
            string BF3 = "";

            if (bf1.Checked)
            {
                BF1 = "bf1";
            }
            else if (bf2.Checked)
            {
                BF2 = "bf2";
            }
            else
            {
                BF3 = "bf3";
            }

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }


            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "marketingjual/LaporanPDF/PDFMasterKontrak.aspx?id=" + rs.Rows[0]["AttachmentID"]
                          + "&status_s=" + nStatusS
                          + "&status_b=" + nStatusB
                          + "&status_a=" + nStatusA
                          //+ "&agent=" + agent.SelectedValue
                          + "&lokasi=" + lokasi.SelectedValue
                          + "&bf1=" + BF1
                          + "&bf2=" + BF2
                          + "&bf3=" + BF3
                          + "&tipe=" + nm //jenis
                          + "&statuspelunasan=" + BF3
                          + "&statuspelunasan=" + SPelunasan
                          + "&carabayar=" + nm2
                          + "&userid=" + UserID
                          + "&project=" + Project
                          + "&pers=" + pers.SelectedValue
            ;

            //update link
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 45cm --page-height 80cm --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #10
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Daftar Tagihan";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC ISC064_FINANCEAR..spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + Convert.ToDateTime(tgl.Text) + "'"
                       + ",'" + null + "'"
                       );

            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM ISC064_FINANCEAR..LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_FINANCEAR..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "DaftarTagihan" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "DaftarTagihan" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //parameter
            string nbiayaInc = "";
            string nbiayaExc = "";

            if (include.Checked == true)
            {
                nbiayaInc = include.Text;
            }
            else
            {
                nbiayaInc = "";
            }

            if (exclude.Checked == true)
            {
                nbiayaExc = exclude.Text;
            }
            else
            {
                nbiayaExc = "";
            }

            DateTime tanggal = Convert.ToDateTime(tgl.Text);

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "collection/LaporanPDF/PDFDaftarTagihan.aspx?id=" + rs.Rows[0]["AttachmentID"]
                          + "&lokasi=" + lokasi.SelectedValue
                          + "&biayaExc=" + nbiayaExc
                          + "&biayaInc=" + nbiayaInc
                          + "&userid=" + UserID
                          + "&project=" + Project
                          + "&pers=" + pers.SelectedValue
                          + "&asof=" + tgl.Text.Replace(' ', '-');

            ;

            //update link
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 11in --page-height 16.5in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #11
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();

            param.Visible  = false;
            report.Visible = true;
            int pdf   = Convert.ToInt16(Request.QueryString["pdf"]);
            int excel = Convert.ToInt16(Request.QueryString["Excel"]);

            if (excel == 1)
            {
                Report();
                //Rpt.ToExcel(this, report);

                rp.Controls.Add(report);
                rp.Controls.Add(list);
                rp.Controls.Add(rpt);
                Rpt.ToExcel(this, rp);
            }
            else if (pdf == 1)
            {
                Report();
                Process p = new System.Diagnostics.Process();

                string   Nama        = "Laporan Kartu Piutang";
                string   Link        = "";
                DateTime TglGenerate = DateTime.Now;
                string   FileName    = "";
                string   FileType    = "application/pdf";
                string   UserID      = Act.UserID;
                string   IP          = Act.IP;

                Db.Execute("EXEC spLapPDFDaftar"

                           + " '" + Nama + "'"
                           + ",'" + Link + "'"
                           + ",'" + TglGenerate + "'"
                           + ",'" + IP + "'"
                           + ",'" + UserID + "'"
                           + ",'" + FileName + "'"
                           + ",'" + FileType + "'"
                           + ",'" + null + "'"
                           + ",'" + null + "'"
                           );

                //get nomor customer terbaru
                int NoAttachment = Db.SingleInteger(
                    "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

                string    strSql = "SELECT * FROM ISC064_FINANCEAR..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
                DataTable rs     = Db.Rs(strSql);

                string nfilename = "KartuPiutang" + NoAttachment + ".pdf";

                //update filename
                Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


                //folder untuk menyimpan file pdf
                string save = Mi.PathFilePDFReport + "KartuPiutang" + rs.Rows[0]["AttachmentID"] + ".pdf";

                string NoKontrak = Convert.ToString(Request.QueryString["NoKontrak"]);

                //link untuk download pdf
                string link = Mi.PathAlamatWeb + "collection/LaporanPDF/PDFLaporanKartuPiutang.aspx?NoKontrak=" + NoKontrak + "&userid=" + Request.QueryString["userid"]
                ;

                //update link
                Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

                //format page
                p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

                //panggil aplikasi untuk mengconvert pdf
                p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
                p.Start();

                //60000 -> waktu jeda lama convert pdf
                p.WaitForExit(30000);

                string Src = Mi.PathFilePDFReport + nfilename;
                Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
            }
            else
            {
                Report();
            }

            if (!Page.IsPostBack)
            {
                Js.Focus(this, scr);
                if (!Act.Sec("DownloadExcel"))
                {
                    xls.Enabled = false;
                }
            }
        }
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Check List Berkas";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + Convert.ToDateTime(dari.Text) + "'"
                       + ",'" + Convert.ToDateTime(sampai.Text) + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_MARKETINGJUAL..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "LapCheckListBerkas" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "LapCheckListBerkas" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //declare parameter
            string Lokasi = lokasi.SelectedValue;

            string tanggalberkas = "";

            if (tbBerkas.Checked)
            {
                tanggalberkas = "TglSelesaiBerkas";
            }
            if (tbKontrak.Checked)
            {
                tanggalberkas = "TglKontrak";
            }

            //DateTime Dari = Convert.ToDateTime(dari.Text);
            //DateTime Sampai = Convert.ToDateTime(sampai.Text);
            //if (Dari > Sampai)
            //{
            //    DateTime x = Sampai;
            //    Sampai = Dari;
            //    Dari = x;
            //}
            //string Tanggal = " AND CONVERT(varchar," + tanggalberkas + ",112) >= '" + Cf.Tgl112(Dari) + "'"
            //       + " AND CONVERT(varchar," + tanggalberkas + ",112) <= '" + Cf.Tgl112(Sampai) + "'";

            string statusberkas = ddlStatus.SelectedValue;

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }


            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "kpa/LaporanPDF/PDFCheckListBerkas.aspx?id=" + rs.Rows[0]["AttachmentID"] + "&tanggalberkas=" + tanggalberkas + "&statusberkas=" + statusberkas + "&lokasi=" + Lokasi + "&project=" + Project + "&pers=" + pers.SelectedValue + "";

            //update link
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #13
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Collection";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC ISC064_FINANCEAR..spLapPDFDaftar"
                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + null + "'"
                       + ",'" + null + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM ISC064_FINANCEAR..LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_FINANCEAR..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "LaporanCollection" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "LaporanCollection" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //parameter

            string nStatusS = "";
            string nStatusA = "";
            string nStatusB = "";

            if (statusS.Checked == true)
            {
                nStatusS = statusS.Text;
            }
            else
            {
                nStatusS = "";
            }
            if (statusA.Checked == true)
            {
                nStatusA = statusA.Text;
            }
            else
            {
                nStatusA = "";
            }
            if (statusB.Checked == true)
            {
                nStatusB = statusB.Text;
            }
            else
            {
                nStatusB = "";
            }

            string blndari   = daribln.SelectedValue;
            string blnsampai = sampaibln.SelectedValue;
            string Tahun     = thn.SelectedValue;

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "collection/LaporanPDF/PDFCol2.aspx?id=" + rs.Rows[0]["AttachmentID"]
                          + "&status_a=" + nStatusA
                          + "&status_b=" + nStatusB
                          + "&status_s=" + nStatusS
                          + "&blndari=" + blndari
                          + "&blnsampai=" + blnsampai
                          + "&thn=" + Tahun
                          + "&userid=" + UserID
                          + "&pers=" + pers.SelectedValue
                          + "&project=" + Project
            ;

            //update link
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 16.5in --page-height 23.4in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #14
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Master Customer";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + null + "'"
                       + ",'" + null + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_MARKETINGJUAL..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "MasterCustomer" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "MasterCustomer" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //declare parameter

            string nStatusS = "";
            string nStatusA = "";
            string nStatusI = "";

            if (statusS.Checked == true)
            {
                nStatusS = statusS.Text;
            }
            else
            {
                nStatusS = "";
            }
            if (statusA.Checked == true)
            {
                nStatusA = statusA.Text;
            }
            else
            {
                nStatusA = "";
            }
            if (statusI.Checked == true)
            {
                nStatusI = statusI.Text;
            }
            else
            {
                nStatusI = "";
            }

            string Agent = agentinput.SelectedValue;

            string Sifat = String.Empty;

            if (sifatALL.Checked)
            {
                Sifat = "sifatALL";
            }
            else if (sifatBELUM.Checked)
            {
                Sifat = "sifatBELUM";
            }
            else if (sifatSUDAH.Checked)
            {
                Sifat = "sifatSUDAH";
            }


            string nm  = string.Empty;
            string agm = string.Empty;
            string smb = string.Empty;

            try
            {
                foreach (ListItem item in nama.Items)
                {
                    if (item.Selected == true)
                    {
                        nm += item.Value.Replace(" ", "%") + "-";
                    }
                }
            }

            catch (Exception)
            {
            }

            //Agama
            try
            {
                foreach (ListItem item in agama.Items)
                {
                    if (item.Selected == true)
                    {
                        agm += item.Value.Replace(" ", "+") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }

            //Sumber Data
            try
            {
                foreach (ListItem item in sumberdata.Items)
                {
                    if (item.Selected == true)
                    {
                        smb += item.Value.Replace(" ", "+") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }

            string Input = "";

            if (input.SelectedIndex != 0)
            {
                string[] z = input.SelectedValue.Split(',');
                Input = z[0] + "-" + z[1];
            }
            else
            {
                Input = input.SelectedValue;
            }

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }


            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "marketingjual/LaporanPDF/PDFMasterCustomer.aspx?id=" + rs.Rows[0]["AttachmentID"]
                          + "&status_s=" + nStatusS
                          + "&status_i=" + nStatusI
                          + "&status_a=" + nStatusA
                          + "&agentinput=" + Agent
                          + "&sifat=" + Sifat
                          + "&nama=" + nm
                          + "&agama=" + agm
                          + "&sumberdata=" + smb
                          + "&input=" + Input
                          + "&blnlahir=" + lahir.SelectedValue
                          + "&userid=" + UserID
                          + "&project=" + Project

            ;

            //update link
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 16in --page-height 30in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
Exemple #15
0
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Master TTS";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + Convert.ToDateTime(dari.Text) + "'"
                       + ",'" + Convert.ToDateTime(sampai.Text) + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_FINANCEAR..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "MasterTTS" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "MasterTTS" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //parameter
            //Tipe
            string Tipe = tipe.SelectedValue;
            //Status
            string nStatusS = "";
            string nStatusB = "";
            string nStatusP = "";
            string nStatusV = "";

            if (statusS.Checked == true)
            {
                nStatusS = statusS.Text;
            }
            else
            {
                nStatusS = "";
            }
            if (statusB.Checked == true)
            {
                nStatusB = statusB.Text;
            }
            else
            {
                nStatusB = "";
            }
            if (statusP.Checked == true)
            {
                nStatusP = statusP.Text;
            }
            else
            {
                nStatusP = "";
            }
            if (statusV.Checked == true)
            {
                nStatusV = statusV.Text;
            }
            else
            {
                nStatusV = "";
            }

            //Tanggal
            string tgl = "";

            if (tgltts.Checked)
            {
                tgl = "tgltts";
            }
            if (tglinput.Checked)
            {
                tgl = "tglinput";
            }
            if (tglbkm.Checked)
            {
                tgl = "tglbkm";
            }
            if (tglbg.Checked)
            {
                tgl = "tglbg";
            }

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            //CaraBayar
            string crbayar = string.Empty;

            try
            {
                foreach (ListItem item in carabayar.Items)
                {
                    if (item.Selected == true)
                    {
                        crbayar += item.Value.Replace(" ", "%") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }

            //Tipe
            string nmtipe = string.Empty;

            try
            {
                foreach (ListItem item in tipe.Items)
                {
                    if (item.Selected == true)
                    {
                        nmtipe += item.Value.Replace(" ", "%") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }

            //Lokasi
            string Lokasi = ddlLokasi.SelectedValue.Replace(" ", "%");
            string Kasir  = kasir.SelectedValue;
            string Rek    = lbAcc.SelectedValue;

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "financear/LaporanPDF/PDFMasterTTS.aspx?id=" + rs.Rows[0]["AttachmentID"]
                          + "&lokasi=" + Lokasi
                          + "&kasir=" + Kasir
                          + "&rek=" + Rek
                          + "&status_p=" + nStatusP
                          + "&status_b=" + nStatusB
                          + "&status_s=" + nStatusS
                          + "&status_v=" + nStatusV
                          + "&tanggal=" + tgl
                          + "&userid=" + UserID
                          + "&detil=" + detil.Checked
                          + "&carabayar=" + crbayar
                          + "&tipe=" + nmtipe
                          + "&project=" + Project
                          + "&pers=" + pers.SelectedValue
            ;

            //update link
            Db.Execute("UPDATE ISC064_FINANCEAR..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 15in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }
        protected void pdf_Click(object sender, System.EventArgs e)
        {
            Process p = new System.Diagnostics.Process();

            string   Nama        = "Laporan Penjualan Tahunan";
            string   Link        = "";
            DateTime TglGenerate = DateTime.Now;
            string   FileName    = "";
            string   FileType    = "application/pdf";
            string   UserID      = Act.UserID;
            string   IP          = Act.IP;

            Db.Execute("EXEC spLapPDFDaftar"

                       + " '" + Nama + "'"
                       + ",'" + Link + "'"
                       + ",'" + TglGenerate + "'"
                       + ",'" + IP + "'"
                       + ",'" + UserID + "'"
                       + ",'" + FileName + "'"
                       + ",'" + FileType + "'"
                       + ",'" + null + "'"
                       + ",'" + null + "'"
                       );

            //get nomor customer terbaru
            int NoAttachment = Db.SingleInteger(
                "SELECT TOP 1 AttachmentID FROM LapPDF ORDER BY AttachmentID DESC");

            string    strSql = "SELECT * FROM ISC064_MARKETINGJUAL..LapPDF WHERE AttachmentID  = '" + NoAttachment + "'";
            DataTable rs     = Db.Rs(strSql);

            string nfilename = "LaporanPenjualanTahunan" + NoAttachment + ".pdf";

            //update filename
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET FileName= '" + nfilename + "' WHERE AttachmentID = " + NoAttachment);


            //folder untuk menyimpan file pdf
            string save = Mi.PathFilePDFReport + "LaporanPenjualanTahunan" + rs.Rows[0]["AttachmentID"] + ".pdf";

            //declare parameter
            string Lokasi = lokasi.SelectedValue.Replace(" ", "%");

            string nm  = string.Empty;
            string nm2 = string.Empty;

            try
            {
                foreach (ListItem item in jenis.Items)
                {
                    if (item.Selected == true)
                    {
                        nm += item.Value.Replace(" ", "%") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }
            try
            {
                foreach (ListItem item in cblcarabayar.Items)
                {
                    if (item.Selected == true)
                    {
                        nm2 += item.Value.Replace(" ", "+") + "-";
                    }
                }
            }
            catch (Exception)
            {
            }

            string Project = "";

            if (project.SelectedIndex == 0)
            {
                Project = Act.ProjectListSql.Replace("'", "");
            }
            else
            {
                Project = project.SelectedValue;
            }

            string Agent = "";

            if (agent.SelectedIndex > 0)
            {
                Agent = agent.SelectedValue.ToString();
            }
            else
            {
                Agent = "SEMUA";
            }

            //link untuk download pdf
            string link = Mi.PathAlamatWeb + "marketingjual/LaporanPDF/PDFLaporanPenjualan3.aspx?id=" + rs.Rows[0]["AttachmentID"] + "&tipe=" + nm + "&lokasi=" + Lokasi + "&userid=" + UserID + "&thn1=" + thn1.SelectedValue + "&thn2=" + thn2.SelectedValue + "&carabayar=" + nm2 + "&agent=" + Agent + "&project=" + Project + "&pers=" + pers.SelectedValue + "";

            //update link
            Db.Execute("UPDATE ISC064_MARKETINGJUAL..LapPDF SET Link= '" + link + "' WHERE AttachmentID = " + NoAttachment);

            //format page
            p.StartInfo.Arguments = "--orientation landscape --page-width 8.5in --page-height 11in --margin-left 0 --margin-right 0 --margin-top 0.25cm --margin-bottom 0 " + link + " " + save;

            //panggil aplikasi untuk mengconvert pdf
            p.StartInfo.FileName = Mi.PathWkhtmlPDFReport;
            p.Start();

            //60000 -> waktu jeda lama convert pdf
            p.WaitForExit(30000);

            string Src = Mi.PathFilePDFReport + nfilename;

            Mi.DownloadPDF(this, Src, (rs.Rows[0]["FileName"]).ToString(), rs.Rows[0]["FileType"].ToString());
        }