📄 checkchoose.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Lib;
using AssetCheck.Libs;
using System.Data;
namespace AssetCheck
{
/// <summary>
/// CheckChoose 的摘要说明。
/// </summary>
public class CheckChoose : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnOut;
private System.Windows.Forms.Button btnReturn;
private System.Windows.Forms.Button btnCheck;
private System.Windows.Forms.Button btnQuery;
public CheckChoose()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.btnOut = new System.Windows.Forms.Button();
this.btnReturn = new System.Windows.Forms.Button();
this.btnQuery = new System.Windows.Forms.Button();
this.btnCheck = new System.Windows.Forms.Button();
//
// btnOut
//
this.btnOut.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold);
this.btnOut.Location = new System.Drawing.Point(16, 98);
this.btnOut.Size = new System.Drawing.Size(208, 39);
this.btnOut.Text = "3.数据导出";
this.btnOut.Click += new System.EventHandler(this.btnOut_Click);
//
// btnReturn
//
this.btnReturn.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold);
this.btnReturn.Location = new System.Drawing.Point(16, 138);
this.btnReturn.Size = new System.Drawing.Size(208, 39);
this.btnReturn.Text = "<.返 回";
this.btnReturn.Click += new System.EventHandler(this.btnReturn_Click);
//
// btnQuery
//
this.btnQuery.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold);
this.btnQuery.Location = new System.Drawing.Point(16, 58);
this.btnQuery.Size = new System.Drawing.Size(208, 39);
this.btnQuery.Text = "2.数据浏览";
this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
//
// btnCheck
//
this.btnCheck.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold);
this.btnCheck.Location = new System.Drawing.Point(16, 18);
this.btnCheck.Size = new System.Drawing.Size(208, 39);
this.btnCheck.Text = "1.盘 点";
this.btnCheck.Click += new System.EventHandler(this.btnCheck_Click);
//
// CheckChoose
//
this.ClientSize = new System.Drawing.Size(242, 197);
this.ControlBox = false;
this.Controls.Add(this.btnOut);
this.Controls.Add(this.btnReturn);
this.Controls.Add(this.btnQuery);
this.Controls.Add(this.btnCheck);
this.Text = "盘点选择";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CheckChoose_KeyDown);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CheckChoose_KeyPress);
}
#endregion
private void label4_ParentChanged(object sender, System.EventArgs e)
{
}
private void CheckChoose_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar==(char)49)
{
btnCheck_Click(sender,e);
}
if (e.KeyChar==(char)50)
{
btnQuery_Click(sender,e);
}
if (e.KeyChar==(char)51)
{
btnOut_Click(sender,e);
}
if (e.KeyChar==(char)52)
{
btnDelete_Click(sender,e);
}
if ((e.KeyChar==(char)27) )
{
Close();
}
}
private void btnCheck_Click(object sender, System.EventArgs e)
{
CheckResult checkResult=new CheckResult();
try
{
checkResult.ShowDialog();
}
finally
{
checkResult.Dispose();
}
}
private void btnQuery_Click(object sender, System.EventArgs e)
{
Wait wait=new Wait();
try
{
wait.Show();
wait.labMessage.Text="正在提取数据,请稍后...";
wait.labMessage.Text="";
wait.Update();
CheckBrowse checkBrowse=new CheckBrowse();
try
{
try
{
CheckBrowse.dtCheckbrowse.Clear();
}
catch
{}
CheckBrowse.dtCheckbrowse=E.ExecDT("select BarCodes from Asset where UserID<>'0'");
if (CheckBrowse.dtCheckbrowse!=null)
if (CheckBrowse.dtCheckbrowse.Rows.Count>0)
{
CheckBrowse.dtCheckbrowse.PrimaryKey=new DataColumn[] {CheckBrowse.dtCheckbrowse.Columns["BarCodes"]};
E.SetDataTableSort(CheckBrowse.dtCheckbrowse,"BarCodes");
CheckBrowse.cmCheckbrowse=(CurrencyManager) this.BindingContext[CheckBrowse.dtCheckbrowse];
checkBrowse.ShowDialog();
}
else
{
E.Beep("",50,2670,2);
E.MessageShow(true,"没有数据!");//MessageBox.Show("没有数据!","错误",MessageBoxButtons.OK,MessageBoxIcon.Hand,MessageBoxDefaultButton.Button1);
}
}
finally
{
checkBrowse.Dispose();
}
}
finally
{
wait.Dispose();
}
}
private void btnOut_Click(object sender, System.EventArgs e)
{
if (E.ExecSC("select Count(*) from Asset where UserID<>'0'")>0)
{
SaveFile.SavePDFile();
}
else
{
E.Beep("",50,2670,2);
E.MessageShow(true,"没有数据!");//MessageBox.Show("没有数据!","信息",MessageBoxButtons.OK,MessageBoxIcon.Asterisk,MessageBoxDefaultButton.Button1);
}
}
private void btnDelete_Click(object sender, System.EventArgs e)
{
}
private void btnReturn_Click(object sender, System.EventArgs e)
{
Close();
}
private void CheckChoose_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyData==Keys.Left)
{
Close();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -