Initial Commit
This commit is contained in:
232
Tanshu.Accounts.PointOfSale/Logging/LogViewerForm.Designer.cs
generated
Normal file
232
Tanshu.Accounts.PointOfSale/Logging/LogViewerForm.Designer.cs
generated
Normal file
@ -0,0 +1,232 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class LogViewerForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.Label6 = new System.Windows.Forms.Label();
|
||||
this.Label2 = new System.Windows.Forms.Label();
|
||||
this.Label1 = new System.Windows.Forms.Label();
|
||||
this.cmbType = new System.Windows.Forms.ComboBox();
|
||||
this.dtpTo = new System.Windows.Forms.DateTimePicker();
|
||||
this.dtpFrom = new System.Windows.Forms.DateTimePicker();
|
||||
this.dgvPayments = new System.Windows.Forms.DataGridView();
|
||||
this.bindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.levelDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.loggerDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.exceptionDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvPayments)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// Label6
|
||||
//
|
||||
this.Label6.AutoSize = true;
|
||||
this.Label6.Location = new System.Drawing.Point(12, 41);
|
||||
this.Label6.Name = "Label6";
|
||||
this.Label6.Size = new System.Drawing.Size(33, 13);
|
||||
this.Label6.TabIndex = 104;
|
||||
this.Label6.Text = "Level";
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(219, 16);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(20, 13);
|
||||
this.Label2.TabIndex = 97;
|
||||
this.Label2.Text = "To";
|
||||
//
|
||||
// Label1
|
||||
//
|
||||
this.Label1.AutoSize = true;
|
||||
this.Label1.Location = new System.Drawing.Point(12, 16);
|
||||
this.Label1.Name = "Label1";
|
||||
this.Label1.Size = new System.Drawing.Size(30, 13);
|
||||
this.Label1.TabIndex = 95;
|
||||
this.Label1.Text = "From";
|
||||
//
|
||||
// cmbType
|
||||
//
|
||||
this.cmbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbType.Items.AddRange(new object[] {
|
||||
"Opening",
|
||||
"Receipt",
|
||||
"Payment",
|
||||
"Additional Void",
|
||||
"Retained at Night"});
|
||||
this.cmbType.Location = new System.Drawing.Point(68, 38);
|
||||
this.cmbType.Name = "cmbType";
|
||||
this.cmbType.Size = new System.Drawing.Size(322, 21);
|
||||
this.cmbType.TabIndex = 105;
|
||||
//
|
||||
// dtpTo
|
||||
//
|
||||
this.dtpTo.CustomFormat = "dd-MMM-yyyy";
|
||||
this.dtpTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||
this.dtpTo.Location = new System.Drawing.Point(245, 12);
|
||||
this.dtpTo.Name = "dtpTo";
|
||||
this.dtpTo.Size = new System.Drawing.Size(145, 20);
|
||||
this.dtpTo.TabIndex = 98;
|
||||
this.dtpTo.ValueChanged += new System.EventHandler(this.dtpTo_ValueChanged);
|
||||
//
|
||||
// dtpFrom
|
||||
//
|
||||
this.dtpFrom.CustomFormat = "dd-MMM-yyyy";
|
||||
this.dtpFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||
this.dtpFrom.Location = new System.Drawing.Point(68, 12);
|
||||
this.dtpFrom.Name = "dtpFrom";
|
||||
this.dtpFrom.Size = new System.Drawing.Size(132, 20);
|
||||
this.dtpFrom.TabIndex = 96;
|
||||
this.dtpFrom.ValueChanged += new System.EventHandler(this.dtpFrom_ValueChanged);
|
||||
//
|
||||
// dgvPayments
|
||||
//
|
||||
this.dgvPayments.AllowUserToAddRows = false;
|
||||
this.dgvPayments.AllowUserToDeleteRows = false;
|
||||
this.dgvPayments.AllowUserToResizeRows = false;
|
||||
this.dgvPayments.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dgvPayments.AutoGenerateColumns = false;
|
||||
this.dgvPayments.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
|
||||
this.dgvPayments.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvPayments.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.idDataGridViewTextBoxColumn,
|
||||
this.dateDataGridViewTextBoxColumn,
|
||||
this.messageDataGridViewTextBoxColumn,
|
||||
this.levelDataGridViewTextBoxColumn,
|
||||
this.loggerDataGridViewTextBoxColumn,
|
||||
this.exceptionDataGridViewTextBoxColumn});
|
||||
this.dgvPayments.DataSource = this.bindingSource;
|
||||
this.dgvPayments.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
|
||||
this.dgvPayments.Location = new System.Drawing.Point(12, 65);
|
||||
this.dgvPayments.Name = "dgvPayments";
|
||||
this.dgvPayments.ReadOnly = true;
|
||||
this.dgvPayments.RowHeadersVisible = false;
|
||||
this.dgvPayments.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvPayments.Size = new System.Drawing.Size(378, 459);
|
||||
this.dgvPayments.TabIndex = 110;
|
||||
//
|
||||
// bindingSource
|
||||
//
|
||||
this.bindingSource.DataSource = typeof(Tanshu.Logging.SqlLog);
|
||||
//
|
||||
// idDataGridViewTextBoxColumn
|
||||
//
|
||||
this.idDataGridViewTextBoxColumn.DataPropertyName = "Id";
|
||||
this.idDataGridViewTextBoxColumn.HeaderText = "Id";
|
||||
this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn";
|
||||
this.idDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.idDataGridViewTextBoxColumn.Width = 41;
|
||||
//
|
||||
// dateDataGridViewTextBoxColumn
|
||||
//
|
||||
this.dateDataGridViewTextBoxColumn.DataPropertyName = "Date";
|
||||
this.dateDataGridViewTextBoxColumn.HeaderText = "Date";
|
||||
this.dateDataGridViewTextBoxColumn.Name = "dateDataGridViewTextBoxColumn";
|
||||
this.dateDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.dateDataGridViewTextBoxColumn.Width = 55;
|
||||
//
|
||||
// messageDataGridViewTextBoxColumn
|
||||
//
|
||||
this.messageDataGridViewTextBoxColumn.DataPropertyName = "Message";
|
||||
this.messageDataGridViewTextBoxColumn.HeaderText = "Message";
|
||||
this.messageDataGridViewTextBoxColumn.Name = "messageDataGridViewTextBoxColumn";
|
||||
this.messageDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.messageDataGridViewTextBoxColumn.Width = 75;
|
||||
//
|
||||
// levelDataGridViewTextBoxColumn
|
||||
//
|
||||
this.levelDataGridViewTextBoxColumn.DataPropertyName = "Level";
|
||||
this.levelDataGridViewTextBoxColumn.HeaderText = "Level";
|
||||
this.levelDataGridViewTextBoxColumn.Name = "levelDataGridViewTextBoxColumn";
|
||||
this.levelDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.levelDataGridViewTextBoxColumn.Width = 58;
|
||||
//
|
||||
// loggerDataGridViewTextBoxColumn
|
||||
//
|
||||
this.loggerDataGridViewTextBoxColumn.DataPropertyName = "Logger";
|
||||
this.loggerDataGridViewTextBoxColumn.HeaderText = "Logger";
|
||||
this.loggerDataGridViewTextBoxColumn.Name = "loggerDataGridViewTextBoxColumn";
|
||||
this.loggerDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.loggerDataGridViewTextBoxColumn.Width = 65;
|
||||
//
|
||||
// exceptionDataGridViewTextBoxColumn
|
||||
//
|
||||
this.exceptionDataGridViewTextBoxColumn.DataPropertyName = "Exception";
|
||||
this.exceptionDataGridViewTextBoxColumn.HeaderText = "Exception";
|
||||
this.exceptionDataGridViewTextBoxColumn.Name = "exceptionDataGridViewTextBoxColumn";
|
||||
this.exceptionDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.exceptionDataGridViewTextBoxColumn.Width = 79;
|
||||
//
|
||||
// LogViewerForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(402, 536);
|
||||
this.Controls.Add(this.dgvPayments);
|
||||
this.Controls.Add(this.Label6);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.Controls.Add(this.Label1);
|
||||
this.Controls.Add(this.cmbType);
|
||||
this.Controls.Add(this.dtpTo);
|
||||
this.Controls.Add(this.dtpFrom);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "LogViewerForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Payments";
|
||||
this.Load += new System.EventHandler(this.PaymentForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvPayments)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.Label Label6;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.Label Label1;
|
||||
internal System.Windows.Forms.ComboBox cmbType;
|
||||
internal System.Windows.Forms.DateTimePicker dtpTo;
|
||||
internal System.Windows.Forms.DateTimePicker dtpFrom;
|
||||
private System.Windows.Forms.DataGridView dgvPayments;
|
||||
private System.Windows.Forms.BindingSource bindingSource;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn idDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dateDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn messageDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn levelDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn loggerDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn exceptionDataGridViewTextBoxColumn;
|
||||
}
|
||||
}
|
||||
43
Tanshu.Accounts.PointOfSale/Logging/LogViewerForm.cs
Normal file
43
Tanshu.Accounts.PointOfSale/Logging/LogViewerForm.cs
Normal file
@ -0,0 +1,43 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
123
Tanshu.Accounts.PointOfSale/Logging/LogViewerForm.resx
Normal file
123
Tanshu.Accounts.PointOfSale/Logging/LogViewerForm.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="bindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Reference in New Issue
Block a user