Ejemplo n.º 1
0
        private void SetTemplate()
        {
            PrintPJTTemplate uc = (PrintPJTTemplate)Page.LoadControl("PrintPJTTemplate.ascx");

            uc.NoPJT   = NoPJT;
            uc.Project = Project;
            list.Controls.Add(uc);
        }
Ejemplo n.º 2
0
        private void Print(string NoPJT)
        {
            //increment
            Db.Execute("UPDATE MS_PJT SET PrintPJT = PrintPJT + 1 "
                       + " WHERE NoPJT = '" + NoPJT + "'");

            //Logfile
            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglPJT, 106) AS [Tanggal]"
                                 + ",Tipe"
                                 + ",Ref AS [Ref]"
                                 + ",Unit"
                                 + ",Customer"
                                 + ",Total"
                                 + " FROM MS_PJT WHERE NoPJT = '" + NoPJT + "'");

            Db.Execute("EXEC spLogPJT"
                       + " 'P-PJT'"
                       + ",'" + Act.UserID + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       + ",'" + NoPJT.ToString() + "'"
                       );

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

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

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

            ConvertPdf();
            Response.Redirect(Param.PathLinkFilePDFCollection + Cf.Tgl(Dari) + "&" + Cf.Tgl(Sampai) + "&" + project.SelectedValue + "_PJTBatch.pdf");

            string file  = Param.PathFilePDFCollection + Cf.Tgl(Dari) + "&" + Cf.Tgl(Sampai) + "&" + project.SelectedValue + "_PJTBatch.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 + "_PJTBatch.pdf");

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

            uc.NoPJT   = NoPJT.ToString();
            uc.Project = project.ToString();
            list.Controls.Add(uc);
        }
Ejemplo n.º 3
0
        private void Print(string NoPJT, string project)
        {
            //increment
            Db.Execute("UPDATE MS_PJT SET PrintPJT = PrintPJT + 1 "
                       + " WHERE NoPJT = '" + NoPJT + "'");

            //Logfile
            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglPJT, 106) AS [Tanggal]"
                                 + ",Tipe"
                                 + ",Ref AS [Ref]"
                                 + ",Unit"
                                 + ",Customer"
                                 + ",Total"
                                 + " FROM MS_PJT WHERE NoPJT = '" + NoPJT + "'");

            Db.Execute("EXEC spLogPJT"
                       + " 'P-PJT'"
                       + ",'" + Act.UserID + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       + ",'" + NoPJT.ToString() + "'"
                       );

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

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

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

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