📄 frmbillsdetails.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace SupermarketProject
{
/// <summary>
/// Summary description for frmBillsDetails.
/// </summary>
public class frmBillsDetails : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblUserId;
private System.Windows.Forms.Label lblBillNo;
private System.Windows.Forms.Label lblBillDate;
private System.Windows.Forms.TextBox txtUserId;
private System.Windows.Forms.TextBox txtBillNo;
private System.Windows.Forms.TextBox txtBillDate;
private System.Windows.Forms.DataGrid dbgBillDetails;
private System.Windows.Forms.Label lblPayMode;
private System.Windows.Forms.Label lblTotPrice;
private System.Windows.Forms.Button btnRtnMgmt;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.TextBox txtPayMode;
private System.Windows.Forms.TextBox txtTotPrice;
/// <summary>
/// Required designer variable.
private System.Windows.Forms.HelpProvider hlpBillDetails;
private System.Windows.Forms.ToolTip tipBillDetails;
private System.ComponentModel.IContainer components;
private Settings settings;
public string[] datagridvalues;
//default constructor
public frmBillsDetails(string[] datagridVal)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
settings = new Settings();
this.hlpBillDetails.HelpNamespace = settings.uiDirectory+ @"\HELP\SupermarketHelp.chm";
//
// TODO: Add any constructor code after InitializeComponent call
datagridvalues = new string[5];
for (int i = 0 ; i<5;i++)
{
this.datagridvalues[i] = datagridVal[i];
}
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(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.lblUserId = new System.Windows.Forms.Label();
this.lblBillNo = new System.Windows.Forms.Label();
this.lblBillDate = new System.Windows.Forms.Label();
this.txtUserId = new System.Windows.Forms.TextBox();
this.txtBillNo = new System.Windows.Forms.TextBox();
this.txtBillDate = new System.Windows.Forms.TextBox();
this.dbgBillDetails = new System.Windows.Forms.DataGrid();
this.lblPayMode = new System.Windows.Forms.Label();
this.lblTotPrice = new System.Windows.Forms.Label();
this.btnRtnMgmt = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button();
this.txtPayMode = new System.Windows.Forms.TextBox();
this.txtTotPrice = new System.Windows.Forms.TextBox();
this.hlpBillDetails = new System.Windows.Forms.HelpProvider();
this.tipBillDetails = new System.Windows.Forms.ToolTip(this.components);
((System.ComponentModel.ISupportInitialize)(this.dbgBillDetails)).BeginInit();
this.SuspendLayout();
//
// lblUserId
//
this.lblUserId.Location = new System.Drawing.Point(19, 17);
this.lblUserId.Name = "lblUserId";
this.lblUserId.Size = new System.Drawing.Size(77, 25);
this.lblUserId.TabIndex = 0;
this.lblUserId.Text = "用户名";
this.lblUserId.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblBillNo
//
this.lblBillNo.Location = new System.Drawing.Point(211, 17);
this.lblBillNo.Name = "lblBillNo";
this.lblBillNo.Size = new System.Drawing.Size(87, 25);
this.lblBillNo.TabIndex = 2;
this.lblBillNo.Text = "帐单编号";
this.lblBillNo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblBillDate
//
this.lblBillDate.Location = new System.Drawing.Point(432, 17);
this.lblBillDate.Name = "lblBillDate";
this.lblBillDate.Size = new System.Drawing.Size(77, 25);
this.lblBillDate.TabIndex = 4;
this.lblBillDate.Text = "帐单日期";
this.lblBillDate.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtUserId
//
this.txtUserId.Enabled = false;
this.hlpBillDetails.SetHelpKeyword(this.txtUserId, "search");
this.txtUserId.Location = new System.Drawing.Point(106, 17);
this.txtUserId.Name = "txtUserId";
this.hlpBillDetails.SetShowHelp(this.txtUserId, true);
this.txtUserId.Size = new System.Drawing.Size(96, 21);
this.txtUserId.TabIndex = 1;
this.txtUserId.Text = "";
this.txtUserId.MouseHover += new System.EventHandler(this.txtUserId_MouseHover);
//
// txtBillNo
//
this.txtBillNo.Enabled = false;
this.txtBillNo.Location = new System.Drawing.Point(298, 17);
this.txtBillNo.Name = "txtBillNo";
this.txtBillNo.Size = new System.Drawing.Size(120, 21);
this.txtBillNo.TabIndex = 3;
this.txtBillNo.Text = "";
this.txtBillNo.MouseHover += new System.EventHandler(this.txtBillNo_MouseHover);
//
// txtBillDate
//
this.txtBillDate.Enabled = false;
this.txtBillDate.Location = new System.Drawing.Point(509, 17);
this.txtBillDate.Name = "txtBillDate";
this.txtBillDate.Size = new System.Drawing.Size(120, 21);
this.txtBillDate.TabIndex = 5;
this.txtBillDate.Text = "";
this.txtBillDate.MouseHover += new System.EventHandler(this.txtBillDate_MouseHover);
//
// dbgBillDetails
//
this.dbgBillDetails.AlternatingBackColor = System.Drawing.Color.White;
this.dbgBillDetails.BackColor = System.Drawing.SystemColors.Info;
this.dbgBillDetails.DataMember = "";
this.dbgBillDetails.Enabled = false;
this.dbgBillDetails.HeaderBackColor = System.Drawing.Color.Red;
this.dbgBillDetails.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dbgBillDetails.Location = new System.Drawing.Point(36, 60);
this.dbgBillDetails.Name = "dbgBillDetails";
this.dbgBillDetails.PreferredColumnWidth = 120;
this.dbgBillDetails.SelectionBackColor = System.Drawing.Color.Blue;
this.dbgBillDetails.Size = new System.Drawing.Size(595, 285);
this.dbgBillDetails.TabIndex = 6;
//
// lblPayMode
//
this.lblPayMode.Location = new System.Drawing.Point(10, 370);
this.lblPayMode.Name = "lblPayMode";
this.lblPayMode.Size = new System.Drawing.Size(120, 25);
this.lblPayMode.TabIndex = 7;
this.lblPayMode.Text = "付款方式";
//
// lblTotPrice
//
this.lblTotPrice.Location = new System.Drawing.Point(336, 370);
this.lblTotPrice.Name = "lblTotPrice";
this.lblTotPrice.Size = new System.Drawing.Size(120, 25);
this.lblTotPrice.TabIndex = 9;
this.lblTotPrice.Text = "帐单总额";
//
// btnRtnMgmt
//
this.btnRtnMgmt.Location = new System.Drawing.Point(182, 405);
this.btnRtnMgmt.Name = "btnRtnMgmt";
this.btnRtnMgmt.Size = new System.Drawing.Size(154, 34);
this.btnRtnMgmt.TabIndex = 11;
this.btnRtnMgmt.Text = "退货管理(&R)";
this.btnRtnMgmt.Click += new System.EventHandler(this.btnRtnMgmt_Click);
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(365, 405);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(90, 34);
this.btnClose.TabIndex = 12;
this.btnClose.Text = "关闭(&C)";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// txtPayMode
//
this.txtPayMode.Enabled = false;
this.txtPayMode.Location = new System.Drawing.Point(173, 370);
this.txtPayMode.Name = "txtPayMode";
this.txtPayMode.Size = new System.Drawing.Size(120, 21);
this.txtPayMode.TabIndex = 8;
this.txtPayMode.Text = "";
//
// txtTotPrice
//
this.txtTotPrice.Enabled = false;
this.txtTotPrice.Location = new System.Drawing.Point(490, 370);
this.txtTotPrice.Name = "txtTotPrice";
this.txtTotPrice.Size = new System.Drawing.Size(120, 21);
this.txtTotPrice.TabIndex = 10;
this.txtTotPrice.Text = "";
//
// hlpBillDetails
//
this.hlpBillDetails.HelpNamespace = "";
//
// tipBillDetails
//
this.tipBillDetails.AutomaticDelay = 150;
//
// frmBillsDetails
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(681, 444);
this.Controls.Add(this.txtTotPrice);
this.Controls.Add(this.txtPayMode);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnRtnMgmt);
this.Controls.Add(this.lblTotPrice);
this.Controls.Add(this.lblPayMode);
this.Controls.Add(this.dbgBillDetails);
this.Controls.Add(this.txtBillDate);
this.Controls.Add(this.txtBillNo);
this.Controls.Add(this.txtUserId);
this.Controls.Add(this.lblBillDate);
this.Controls.Add(this.lblBillNo);
this.Controls.Add(this.lblUserId);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmBillsDetails";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "帐单详细信息";
this.Load += new System.EventHandler(this.frmBillsDetails_Load);
((System.ComponentModel.ISupportInitialize)(this.dbgBillDetails)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void frmBillsDetails_Load(object sender, System.EventArgs e)
{
this.txtUserId.Text = this.datagridvalues[2];
this.txtBillNo.Text = this.datagridvalues[0];
this.txtBillDate.Text = System.DateTime.Parse(this.datagridvalues[1]).ToShortDateString();
this.txtPayMode.Text = this.datagridvalues[4];
this.txtTotPrice.Text = this.datagridvalues[3];
SalesAdminManagement sAdminMgmt = new SalesAdminManagement();
this.dbgBillDetails.DataSource = sAdminMgmt.FetchBillDetails(Convert.ToInt32(this.txtBillNo.Text));
}
private void btnClose_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void btnRtnMgmt_Click(object sender, System.EventArgs e)
{
frmReturn frmRet=new frmReturn();
frmRet.MdiParent = this.ParentForm;
frmRet.Left = this.Left ;
frmRet.Top = this.Top;
frmRet.Show();
}
private void txtUserId_MouseHover(object sender, System.EventArgs e)
{
this.tipBillDetails.SetToolTip(this.txtUserId ,"请输入用户标识");
}
private void txtBillNo_MouseHover(object sender, System.EventArgs e)
{
this.tipBillDetails.SetToolTip(this.txtBillNo ,"请输入帐单编号");
}
private void txtBillDate_MouseHover(object sender, System.EventArgs e)
{
this.tipBillDetails.SetToolTip(this.txtBillDate ,"请输入帐单日期");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -