using System; using System.Data; using System.Text; using System.Web.UI; using Swift.DAL.BL.System.Notification; using Swift.web.Library; namespace Swift.web.SwiftSystem.Notification.LoginLogs { public partial class Manage : System.Web.UI.Page { private readonly ApplicationLogsDao _apllicationLogsDao = new ApplicationLogsDao(); private readonly RemittanceLibrary _swiftLibrary = new RemittanceLibrary(); protected void Page_Load(object sender, EventArgs e) { Authenticate(); if (!IsPostBack) { if (GetLogId() > 0) { PopulateOperation(); } } } private long GetLogId() { return (Request.QueryString["log_Id"] != null ? long.Parse(Request.QueryString["log_Id"]) : 0); } private void PopulateOperation() { DataTable dt = _apllicationLogsDao.PopulateLoginLogById(GetLogId().ToString()); if (dt == null || dt.Rows.Count < 1) return; DataRow dr = dt.Rows[0]; createdDate.Text = dr["createdDate"].ToString(); lblReason.Text = dr["Reason"].ToString(); dataId.Text = dr["log_id"].ToString(); lblInput.Text = dr["UserData"].ToString(); createdBy.Text = dr["createdBy"].ToString(); logType.Text = dr["logType"].ToString(); if (dr["logType"].ToString().ToLower() != "logout") { changeDetails.Visible = true; PrintChanges(dt); } else { changeDetails.Visible = false; } } private void PrintChanges(DataTable dt) { if (dt.Rows.Count == 0) { rpt_grid.InnerHtml = "
"; return; } DataRow dr = dt.Rows[0]; DataTable dt2 = GetStatic.GetStringToTable(dr["fieldvalue"].ToString()); var str =new StringBuilder(""); str.Append(""); str.Append(""); str.Append(""); str.Append(""); foreach (DataRow dr2 in dt2.Rows) { str.Append(""); str.Append(""); str.Append(""); str.Append(""); } str.Append("
CategoryValue
" + dr2[0] + "" + dr2[1] + "
"); rpt_grid.InnerHtml = str.ToString(); } private void Authenticate() { _swiftLibrary.CheckAuthentication("10121100"); } } }