예제 #1
0
        private void Valid(string Username)
        {
            Session["SalahPass"] = null;

            //Logfile otorisasi
            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglSKL, 106) AS [Tanggal]"
                                 + ",NoSKL"
                                 + ",Ref AS [Ref.]"
                                 + ",NoSKLManual"
                                 + ",Used AS [No.YgDigunakan]"
                                 + " FROM MS_SKL WHERE NoSKL = '" + NoSKL + "'");

            Db.Execute("EXEC spLogSKL"
                       + " '" + DateTime.Now + "'"
                       + " ,'R-SKL'"
                       + ",'" + Act.UserID + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + NoSKL.ToString() + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       );
            Tampil();
            string file  = Param.PathFilePDFCollection + NoSKL.Replace("/", "_").Replace("\\", "_") + Project + "_SKL.pdf";
            bool   exist = System.IO.File.Exists(file);

            if (exist)
            {
                System.IO.File.Delete(file);
            }
            ConvertPdf();
            Response.Redirect(Param.PathLinkFilePDFCollection + NoSKL.Replace("/", "_").Replace("\\", "_") + Project + "_SKL.pdf");
        }
예제 #2
0
        private void ConvertPdf()
        {
            Process p = new System.Diagnostics.Process();

            string myHtml = "http://" + Request.Url.Host + ":" + Request.Url.Port + "/collection/PrintSuratLunas1.aspx?NoSKL=" + NoSKL + "&project=" + Project;

            string save = Param.PathFilePDFCollection + NoSKL.Replace("/", "_").Replace("\\", "_") + Project + "_SKL.pdf";
            string link = Param.PathLinkFilePDFCollection + NoSKL.Replace("/", "_").Replace("\\", "_") + Project + ".pdf";

            p.StartInfo.Arguments = "--orientation portrait --page-width 8.5in --page-height 11in --margin-left 2cm --margin-right 2cm --margin-top 1.25cm --margin-bottom 0 " + myHtml + " " + save;
            p.StartInfo.FileName  = Mi.PathWkhtmlPDFReport;
            p.Start();
            p.WaitForExit(60000);
        }
예제 #3
0
        private void Fill()
        {
            cancel.Attributes["onclick"]  = "location.href='SKLEdit.aspx?NoSKL=" + NoSKL + "'";
            cancel2.Attributes["onclick"] = "location.href='SKLEdit.aspx?NoSKL=" + NoSKL + "'";

            string    strSql = "SELECT PrintSKL FROM MS_SKL WHERE NoSKL = '" + NoSKL + "'";
            DataTable rs     = Db.Rs(strSql);

            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/NoPrint.html");
            }
            else
            {
                count.Text = rs.Rows[0]["PrintSKL"].ToString();
                if ((int)rs.Rows[0]["PrintSKL"] == 0)
                {
                    Tampil(); //langsung tampil
                    ConvertPdf();
                    Response.Redirect(Param.PathLinkFilePDFCollection + NoSKL.Replace("/", "_").Replace("\\", "_") + Project + "_SKL.pdf");
                }
                else
                {
                    //mekanisme reprint
                    list.Visible    = false;
                    reprint.Visible = true;
                    Js.Focus(this, username);

                    if (Session["SalahPass"] == null)
                    {
                        Session["SalahPass"] = "******"; //Hitung password salah berapa kali
                    }
                    else
                    {
                        if (Session["SalahPass"].ToString() != "0")
                        {
                            salah.Text = Session["SalahPass"] + "x salah";
                        }
                    }
                }
            }
        }