Example #1
0
        private void SetTemplate()
        {
            PrintSTTemplate uc = (PrintSTTemplate)Page.LoadControl("PrintSTTemplate.ascx");

            uc.NoTunggakan = NoTunggakan;
            uc.Project     = Project;
            list.Controls.Add(uc);
        }
Example #2
0
        private void Print(int NoTunggakan)
        {
            //increment
            Db.Execute("UPDATE MS_TUNGGAKAN SET PrintST = PrintST + 1 "
                       + " WHERE NoTunggakan = " + NoTunggakan);

            //Logfile
            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglTunggakan, 106) AS [Tanggal]"
                                 + ",Tipe"
                                 + ",Ref AS [Ref.]"
                                 + ",Unit"
                                 + ",Customer"
                                 + ",Total"
                                 + ",LevelTunggakan AS [Level]"
                                 + " FROM MS_TUNGGAKAN WHERE NoTunggakan = " + NoTunggakan);

            Db.Execute("EXEC spLogTunggakan"
                       + " 'P-ST'"
                       + ",'" + Act.UserID + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       + ",'" + NoTunggakan.ToString().PadLeft(7, '0') + "'"
                       );

            decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_TUNGGAKAN_LOG ORDER BY LogID DESC");
            string  Project = Db.SingleString("SELECT Project FROM " + Mi.DbPrefix + "MARKETINGJUAL..MS_KONTRAK WHERE NoKontrak = (SELECT Ref FROM MS_TUNGGAKAN WHERE NoTunggakan = '" + NoTunggakan + "') ");

            Db.Execute("UPDATE MS_TUNGGAKAN_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);

            DateTime Dari   = Convert.ToDateTime(dari.Text);
            DateTime Sampai = Convert.ToDateTime(sampai.Text);

            //ConvertPdf();
            //Response.Redirect(Param.PathLinkFilePDFCollection + Cf.Tgl(Dari) + "&" + Cf.Tgl(Sampai) + "_STBatch.pdf");

            string file  = Param.PathFilePDFCollection + Cf.Tgl(Dari) + "&" + Cf.Tgl(Sampai) + "&" + project.SelectedValue + "_STBatch.pdf";
            bool   exist = System.IO.File.Exists(file);

            if (exist)
            {
                System.IO.File.Delete(file);
            }
            ConvertPdf();
            Response.Redirect(Param.PathLinkFilePDFCollection + Cf.Tgl(Dari) + "&" + Cf.Tgl(Sampai) + "&" + project.SelectedValue + "_STBatch.pdf");

            //Template
            PrintSTTemplate uc = (PrintSTTemplate)Page.LoadControl("PrintSTTemplate.ascx");

            uc.NoTunggakan = NoTunggakan.ToString();
            uc.Project     = project.SelectedValue;
            list.Controls.Add(uc);
        }
Example #3
0
        private void Print(int NoTunggakan)
        {
            //increment
            Db.Execute("UPDATE MS_TUNGGAKAN SET PrintST = PrintST + 1 "
                       + " WHERE NoTunggakan = " + NoTunggakan);

            //Logfile
            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglTunggakan, 106) AS [Tanggal]"
                                 + ",Tipe"
                                 + ",Ref AS [Ref.]"
                                 + ",Unit"
                                 + ",Customer"
                                 + ",Total"
                                 + ",LevelTunggakan AS [Level]"
                                 + " FROM MS_TUNGGAKAN WHERE NoTunggakan = " + NoTunggakan);

            Db.Execute("EXEC spLogTunggakan"
                       + " 'P-ST'"
                       + ",'" + Act.UserID + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       + ",'" + NoTunggakan.ToString().PadLeft(7, '0') + "'"
                       );

            decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_TUNGGAKAN_LOG ORDER BY LogID DESC");
            string  Project = Db.SingleString("SELECT Project FROM " + Mi.DbPrefix + "MARKETINGJUAL..MS_KONTRAK WHERE NoKontrak = (SELECT Ref FROM MS_TUNGGAKAN WHERE NoTunggakan = '" + NoTunggakan + "') ");

            Db.Execute("UPDATE MS_TUNGGAKAN_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);

            //Template
            PrintSTTemplate uc = (PrintSTTemplate)Page.LoadControl("PrintSTTemplate.ascx");

            uc.NoTunggakan = NoTunggakan.ToString();
            uc.Project     = Project.ToString();
            list.Controls.Add(uc);
        }