📄 analyse.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using Sale.DataLevel;
using Sale.BussinessRule;
namespace Sale.UILevel
{
/// <summary>
/// Anylyse 的摘要说明。
/// </summary>
public class ProfitAnalyse : System.Windows.Forms.Form
{
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.DateTimePicker dateTimePicker2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button btnApply;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckedListBox checkedListBox1;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private Sale.UILevel.DataSetAnalyse dataSetAnalyse1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
// private string products;
private DataTable analyseTable=new DataTable("analyseTable");
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn2;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn3;
private System.Windows.Forms.Button btnSelectAll;
//private System.Data.SqlClient.SqlConnection sqlConnection1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public ProfitAnalyse()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ProfitAnalyse));
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn2 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn3 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataSetAnalyse1 = new Sale.UILevel.DataSetAnalyse();
this.btnApply = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnSelectAll = new System.Windows.Forms.Button();
this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataSetAnalyse1)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(88, 24);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(112, 21);
this.dateTimePicker1.TabIndex = 0;
//
// dateTimePicker2
//
this.dateTimePicker2.Location = new System.Drawing.Point(256, 24);
this.dateTimePicker2.Name = "dateTimePicker2";
this.dateTimePicker2.Size = new System.Drawing.Size(112, 21);
this.dateTimePicker2.TabIndex = 1;
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 23);
this.label1.TabIndex = 2;
this.label1.Text = "选择日期";
//
// label2
//
this.label2.Location = new System.Drawing.Point(216, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(24, 23);
this.label2.TabIndex = 3;
this.label2.Text = "至";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 64);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 23);
this.label3.TabIndex = 4;
this.label3.Text = "选择商品";
//
// dataGrid1
//
this.dataGrid1.AlternatingBackColor = System.Drawing.Color.GhostWhite;
this.dataGrid1.BackColor = System.Drawing.Color.GhostWhite;
this.dataGrid1.BackgroundColor = System.Drawing.Color.Lavender;
this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dataGrid1.CaptionBackColor = System.Drawing.Color.RoyalBlue;
this.dataGrid1.CaptionForeColor = System.Drawing.Color.White;
this.dataGrid1.DataMember = "";
this.dataGrid1.FlatMode = true;
this.dataGrid1.Font = new System.Drawing.Font("Tahoma", 8F);
this.dataGrid1.ForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.GridLineColor = System.Drawing.Color.RoyalBlue;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.HeaderForeColor = System.Drawing.Color.Lavender;
this.dataGrid1.LinkColor = System.Drawing.Color.Teal;
this.dataGrid1.Location = new System.Drawing.Point(16, 176);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.Lavender;
this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.ReadOnly = true;
this.dataGrid1.SelectionBackColor = System.Drawing.Color.Teal;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.PaleGreen;
this.dataGrid1.Size = new System.Drawing.Size(456, 176);
this.dataGrid1.TabIndex = 61;
this.dataGrid1.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] {
this.dataGridTextBoxColumn1,
this.dataGridTextBoxColumn2,
this.dataGridTextBoxColumn3});
this.dataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "商品编号";
this.dataGridTextBoxColumn1.MappingName = "ProID";
this.dataGridTextBoxColumn1.Width = 75;
//
// dataGridTextBoxColumn2
//
this.dataGridTextBoxColumn2.Format = "";
this.dataGridTextBoxColumn2.FormatInfo = null;
this.dataGridTextBoxColumn2.HeaderText = "销售总量";
this.dataGridTextBoxColumn2.MappingName = "TotalNumber";
this.dataGridTextBoxColumn2.Width = 75;
//
// dataGridTextBoxColumn3
//
this.dataGridTextBoxColumn3.Format = "";
this.dataGridTextBoxColumn3.FormatInfo = null;
this.dataGridTextBoxColumn3.HeaderText = "销售总额(元)";
this.dataGridTextBoxColumn3.MappingName = "TotalProfit";
this.dataGridTextBoxColumn3.Width = 75;
//
// dataSetAnalyse1
//
this.dataSetAnalyse1.DataSetName = "DataSetAnalyse";
this.dataSetAnalyse1.Locale = new System.Globalization.CultureInfo("zh-CN");
//
// btnApply
//
this.btnApply.Image = ((System.Drawing.Image)(resources.GetObject("btnApply.Image")));
this.btnApply.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnApply.Location = new System.Drawing.Point(304, 72);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(64, 24);
this.btnApply.TabIndex = 60;
this.btnApply.Text = "确定";
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// btnExit
//
this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
this.btnExit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnExit.Location = new System.Drawing.Point(400, 368);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(64, 24);
this.btnExit.TabIndex = 58;
this.btnExit.Text = "退出";
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// btnCancel
//
this.btnCancel.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.Image")));
this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnCancel.Location = new System.Drawing.Point(224, 56);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(64, 24);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -