Example #1
0
        //itt lép be a programba
        private void ujAdatHozzaadasaAktivitasok(int refId, Esemeny esemeny)
        {
            int index = (ListOfAktivitas.Count == 0) ? 0 : ListOfAktivitas[ListOfAktivitas.Count - 1].ID + 1;

            Aktivitas akt = new Aktivitas(
                id: index,
                felhasznaloId: (int)lbAktualUser.Tag,
                refId: refId,
                esemeny: esemeny,
                datum: DateTime.Now);

            ListOfAktivitas.Add(akt);
            szinkronizalasAktivitasok();
        }
Example #2
0
        private void Header()
        {
            System.Text.StringBuilder x = new System.Text.StringBuilder();

            Rpt.Judul(x, comp, judul);
            DateTime Dari   = Db.SingleTime("SELECT FilterDari FROM LapPDF WHERE AttachmentID='" + AttachmentID + "'");
            DateTime Sampai = Db.SingleTime("SELECT FilterSampai FROM LapPDF WHERE AttachmentID='" + AttachmentID + "'");


            string[] words      = Aktivitas.Split('-');
            bool     x1         = true;
            string   nAktivitas = "";

            foreach (string akt in words)
            {
                nAktivitas = akt.ToString();
            }

            Rpt.SubJudul(x
                         , "Tanggal Log : " + Cf.Day(Dari) + " s/d " + Cf.Day(Sampai)
                         );

            Rpt.SubJudul(x
                         , "Aktivitas : " + Aktivitas.Replace("-", ",")//Rpt.inSql(Aktivitas).Replace("'", "")
                         );

            Rpt.SubJudul(x
                         , "User : "******"Security Level : " + SecLevel//seclevel.SelectedItem.Text
                         );

            Rpt.SubJudul(x
                         , "IP Address : " + IP //ip.SelectedItem.Text
                         );

            string legend = "";

            //Rpt.Header(rpt, x);
            Rpt.HeaderReport(headReport, legend, x);
        }
Example #3
0
        private void Fill()
        {
            DateTime Dari   = Db.SingleTime("SELECT FilterDari FROM LapPDF WHERE AttachmentID='" + AttachmentID + "'");
            DateTime Sampai = Db.SingleTime("SELECT FilterSampai FROM LapPDF WHERE AttachmentID='" + AttachmentID + "'");


            string UserID = "";

            if (User != "SEMUA")
            {
                UserID = " AND UserID = '" + User + "'";
            }

            string nSecLevel = "";

            if (SecLevel != "SEMUA")
            {
                nSecLevel = " AND SecLevel = '" + SecLevel + "'";
            }

            string nIP = "";

            if (IP != "0" && IP != "SEMUA")
            {
                nIP = " AND IP = '" + IP + "'";
            }

            //change parameter
            string akt = String.Empty;

            akt = Aktivitas.Replace("-", ",").TrimEnd(',');
            akt = akt.Replace(",", "','");

            akt = "'" + akt + "'";


            string strSql = "SELECT "
                            + " LogID"
                            + ",Tgl"
                            + ",CASE Aktivitas "
                            + "		WHEN 'L' THEN 'Log-In Normal'"
                            + "		WHEN 'S' THEN 'Sign-Out Normal'"
                            + "		WHEN 'DL' THEN 'Double Login'"
                            + "		WHEN 'SP' THEN 'Salah Password'"
                            + "		WHEN 'B' THEN 'Blokir'"
                            + "		WHEN 'A' THEN 'Aktivasi'"
                            + "		WHEN 'GP' THEN 'Ganti Password'"
                            + " END AS AktivitasDetil"
                            + ",UserID"
                            + ",Nama"
                            + ",SecLevel"
                            + ",IP"
                            + " FROM SECURITY_LOG"
                            + " WHERE 1=1 "
                            + " AND CONVERT(varchar,Tgl,112) >= '" + Cf.Tgl112(Dari) + "'"
                            + " AND CONVERT(varchar,Tgl,112) <= '" + Cf.Tgl112(Sampai) + "'"
                            + " AND Aktivitas IN (" + akt + ")"//Rpt.inSql(Aktivitas.Replace("-",",")) + ")"
                            + UserID
                            + nSecLevel
                            + nIP
                            + " ORDER BY LogID";

            DataTable rs = Db.Rs(strSql);

            for (int i = 0; i < rs.Rows.Count; i++)
            {
                if (!Response.IsClientConnected)
                {
                    break;
                }

                TableRow  r = new TableRow();
                TableCell c;

                r.VerticalAlign = VerticalAlign.Top;

                c                 = new TableCell();
                c.Text            = rs.Rows[i]["LogID"].ToString();
                c.HorizontalAlign = HorizontalAlign.Left;
                c.Wrap            = false;
                r.Cells.Add(c);

                c                 = new TableCell();
                c.Text            = Cf.Day(rs.Rows[i]["Tgl"]);
                c.HorizontalAlign = HorizontalAlign.Left;
                c.Wrap            = false;
                r.Cells.Add(c);

                c                 = new TableCell();
                c.Text            = Cf.Time(rs.Rows[i]["Tgl"]);
                c.HorizontalAlign = HorizontalAlign.Left;
                c.Wrap            = false;
                r.Cells.Add(c);

                c                 = new TableCell();
                c.Text            = rs.Rows[i]["AktivitasDetil"].ToString();
                c.HorizontalAlign = HorizontalAlign.Left;
                c.Wrap            = false;
                r.Cells.Add(c);

                c                 = new TableCell();
                c.Text            = rs.Rows[i]["UserID"].ToString();
                c.HorizontalAlign = HorizontalAlign.Left;
                c.Wrap            = false;
                r.Cells.Add(c);

                c                 = new TableCell();
                c.Text            = rs.Rows[i]["Nama"].ToString();
                c.HorizontalAlign = HorizontalAlign.Left;
                c.Wrap            = false;
                r.Cells.Add(c);

                c                 = new TableCell();
                c.Text            = rs.Rows[i]["SecLevel"].ToString();
                c.HorizontalAlign = HorizontalAlign.Left;
                c.Wrap            = false;
                r.Cells.Add(c);

                c                 = new TableCell();
                c.Text            = rs.Rows[i]["IP"].ToString();
                c.HorizontalAlign = HorizontalAlign.Left;
                c.Wrap            = false;
                r.Cells.Add(c);

                rpt.Rows.Add(r);
            }
        }