Fixed: Error in ProductsBI

Added: Copy to clipboard in SaleAnalysis/Detail
This commit is contained in:
Amritanshu 2013-12-08 02:44:31 +05:30
parent 82f3b6b3e7
commit 8be15d2d33
3 changed files with 27 additions and 2 deletions

View File

@ -101,7 +101,7 @@ namespace Tanshu.Accounts.BI
{ {
Dictionary<string, string> filter = new Dictionary<string, string>(); Dictionary<string, string> filter = new Dictionary<string, string>();
filter.Add("Name", ""); filter.Add("Name", "");
filter.Add("Type", ""); filter.Add("ProductGroup", "");
return GetFilteredProducts(filter); return GetFilteredProducts(filter);
} }
public List<ProductGroupBO> GetProductGroups() public List<ProductGroupBO> GetProductGroups()

View File

@ -91,5 +91,17 @@ namespace Tanshu.Accounts.PointOfSale
Print.Thermal.PrintSale(_analysisDetail, startDate, finishDate); Print.Thermal.PrintSale(_analysisDetail, startDate, finishDate);
} }
} }
private void btnCopy_Click(object sender, EventArgs e)
{
if (_analysisDetail == null)
return;
var data = string.Format("{0}\t{1}\t{2}\t{3}\n", "Group", "Product", "Quantity", "Amount");
foreach (var item in _analysisDetail)
{
data += string.Format("{0}\t{1}\t{2}\t{3}\n", item.Section, item.Product, item.Quantity, item.Amount);
}
Clipboard.SetText(data, TextDataFormat.Text);
}
} }
} }

View File

@ -35,6 +35,7 @@
this.dtpStart = new System.Windows.Forms.DateTimePicker(); this.dtpStart = new System.Windows.Forms.DateTimePicker();
this.label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
this.btnPrint = new System.Windows.Forms.Button(); this.btnPrint = new System.Windows.Forms.Button();
this.btnCopy = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvSale)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -108,15 +109,26 @@
this.btnPrint.Name = "btnPrint"; this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(75, 23); this.btnPrint.Size = new System.Drawing.Size(75, 23);
this.btnPrint.TabIndex = 28; this.btnPrint.TabIndex = 28;
this.btnPrint.Text = "Print"; this.btnPrint.Text = "&Print";
this.btnPrint.UseVisualStyleBackColor = true; this.btnPrint.UseVisualStyleBackColor = true;
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click); this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
// //
// btnCopy
//
this.btnCopy.Location = new System.Drawing.Point(380, 12);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(75, 23);
this.btnCopy.TabIndex = 29;
this.btnCopy.Text = "&Copy";
this.btnCopy.UseVisualStyleBackColor = true;
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// frmSaleAnalysisForm // frmSaleAnalysisForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(548, 519); this.ClientSize = new System.Drawing.Size(548, 519);
this.Controls.Add(this.btnCopy);
this.Controls.Add(this.btnPrint); this.Controls.Add(this.btnPrint);
this.Controls.Add(this.txtFreeSale); this.Controls.Add(this.txtFreeSale);
this.Controls.Add(this.label4); this.Controls.Add(this.label4);
@ -144,5 +156,6 @@
private System.Windows.Forms.DateTimePicker dtpStart; private System.Windows.Forms.DateTimePicker dtpStart;
private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label10;
private System.Windows.Forms.Button btnPrint; private System.Windows.Forms.Button btnPrint;
private System.Windows.Forms.Button btnCopy;
} }
} }