narsil/Tanshu.Accounts.PointOfSale/Logging/LogViewerForm.cs
2010-03-02 23:26:21 +05:30

44 lines
1.3 KiB
C#

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();
}
}
}