📄 deletesuper.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace _3Dmanager
{
/// <summary>
/// Deletesuper 的摘要说明。
/// </summary>
public class Deletesuper : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Deletesuper()
{
//
// 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()
{
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(24, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(80, 16);
this.label1.TabIndex = 0;
this.label1.Text = "商家名称:";
//
// textBox1
//
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox1.Location = new System.Drawing.Point(128, 24);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(304, 21);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(48, 64);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(416, 24);
this.button1.TabIndex = 2;
this.button1.Text = "查 看 信 息";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// dataGrid1
//
this.dataGrid1.AlternatingBackColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid1.BackColor = System.Drawing.Color.Gainsboro;
this.dataGrid1.BackgroundColor = System.Drawing.Color.DarkGray;
this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dataGrid1.CaptionBackColor = System.Drawing.Color.DarkKhaki;
this.dataGrid1.CaptionFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.CaptionForeColor = System.Drawing.Color.Black;
this.dataGrid1.DataMember = "";
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dataGrid1.FlatMode = true;
this.dataGrid1.Font = new System.Drawing.Font("Times New Roman", 9F);
this.dataGrid1.ForeColor = System.Drawing.Color.Black;
this.dataGrid1.GridLineColor = System.Drawing.Color.Silver;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.Black;
this.dataGrid1.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.HeaderForeColor = System.Drawing.Color.White;
this.dataGrid1.LinkColor = System.Drawing.Color.DarkSlateBlue;
this.dataGrid1.Location = new System.Drawing.Point(0, 132);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.LightGray;
this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.Black;
this.dataGrid1.SelectionBackColor = System.Drawing.Color.Firebrick;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.White;
this.dataGrid1.Size = new System.Drawing.Size(520, 200);
this.dataGrid1.TabIndex = 3;
//
// button2
//
this.button2.Location = new System.Drawing.Point(208, 104);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(80, 24);
this.button2.TabIndex = 4;
this.button2.Text = "删除";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(312, 104);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(80, 24);
this.button3.TabIndex = 5;
this.button3.Text = "取消";
//
// button4
//
this.button4.Location = new System.Drawing.Point(416, 104);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(80, 24);
this.button4.TabIndex = 6;
this.button4.Text = "退出";
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// Deletesuper
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(520, 332);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.dataGrid1);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.Name = "Deletesuper";
this.Text = "删除商家";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void button4_Click(object sender, System.EventArgs e)
{
this.Dispose();
}
private void button1_Click(object sender, System.EventArgs e)
{
this.dataGrid1.DataSource=_3DLib.SelectAll.getAllInfo(4);
}
private void button2_Click(object sender, System.EventArgs e)
{
string name=textBox1.Text.Trim();
if(name.Equals(""))
{
MessageBox.Show("请填写删除条件!");
this.textBox1.Focus();
return;
}
if(_3DLib.Delete.deleteInfo("提供商","",name).Equals("OK"))
{
MessageBox.Show("删除成功!");
}
else MessageBox.Show("删除失败!");
this.dataGrid1.DataSource=_3DLib.SelectAll.getAllInfo(4);
this.dataGrid1.Refresh();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -