narsil/Tanshu.Accounts.PointOfSale/Logging/LogViewerForm.cs

44 lines
1.3 KiB
C#
Raw Permalink Normal View History

2010-03-02 17:56:21 +00:00
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;
using Tanshu.Accounts.BI;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Helpers;
namespace Tanshu.Accounts.PointOfSale
{
public partial class LogViewerForm : Form
{
private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public LogViewerForm()
{
InitializeComponent();
}
private void PaymentForm_Load(object sender, EventArgs e)
{
dtpFrom.Value = DateTime.Now;
dtpTo.Value = DateTime.Now;
GridBind();
}
private void GridBind()
{
DateTime startDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy 00:00:00}", dtpFrom.Value));
DateTime endDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy 23:59:59}", dtpTo.Value));
bindingSource.DataSource = log.GetLog(startDate, endDate, Tanshu.Logging.LogType.Info);
}
private void dtpFrom_ValueChanged(object sender, EventArgs e)
{
GridBind();
}
private void dtpTo_ValueChanged(object sender, EventArgs e)
{
GridBind();
}
}
}