📄 selfmakejackmessui.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using SetupOperDBLibrary;
using System.Data;
namespace UI
{
/// <summary>
/// SelfMakeJackMessUI 的摘要说明。
/// </summary>
public class SelfMakeJackMessUI : System.Windows.Forms.Form
{
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolBarButton2;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.ToolBarButton toolBarButton4;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ToolBarButton toolBarButton5;
private System.ComponentModel.IContainer components;
public SelfMakeJackMessUI()
{
//
// 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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SelfMakeJackMessUI));
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
this.SuspendLayout();
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton4,
this.toolBarButton3,
this.toolBarButton5});
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Location = new System.Drawing.Point(0, 0);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(432, 71);
this.toolBar1.TabIndex = 1;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// toolBarButton1
//
this.toolBarButton1.ImageIndex = 5;
//
// toolBarButton2
//
this.toolBarButton2.ImageIndex = 1;
//
// toolBarButton3
//
this.toolBarButton3.ImageIndex = 3;
//
// toolBarButton4
//
this.toolBarButton4.ImageIndex = 2;
//
// listView1
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader3,
this.columnHeader1,
this.columnHeader2});
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.FullRowSelect = true;
this.listView1.GridLines = true;
this.listView1.Location = new System.Drawing.Point(0, 71);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(432, 266);
this.listView1.TabIndex = 2;
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.DoubleClick += new System.EventHandler(this.listView1_DoubleClick);
//
// columnHeader3
//
this.columnHeader3.Text = "编号";
this.columnHeader3.Width = 57;
//
// columnHeader1
//
this.columnHeader1.Text = "提醒时间";
this.columnHeader1.Width = 132;
//
// columnHeader2
//
this.columnHeader2.Text = "提醒内容";
this.columnHeader2.Width = 239;
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(62, 59);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// toolBarButton5
//
this.toolBarButton5.ImageIndex = 4;
//
// SelfMakeJackMessUI
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(432, 337);
this.Controls.Add(this.listView1);
this.Controls.Add(this.toolBar1);
this.Name = "SelfMakeJackMessUI";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "自定义提醒";
this.Load += new System.EventHandler(this.SelfMakeJackMessUI_Load);
this.Activated += new System.EventHandler(this.SelfMakeJackMessUI_Activated);
this.ResumeLayout(false);
}
#endregion
private void SelfMakeJackMessUI_Load(object sender, System.EventArgs e)
{
DataTable table=new DataTable();
SetupSelectAllSelfJackMess mess=new SetupSelectAllSelfJackMess();
mess.SelectAllSelfJackMess(table);
this.listView1.Items.Clear();
foreach(DataRow row in table.Rows)
{
ListViewItem item=new ListViewItem(row[0].ToString().Trim());
item.SubItems.Add(row[2].ToString().Trim());
item.SubItems.Add(row[1].ToString().Trim());
this.listView1.Items.Add(item);
}
}
private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
if(e.Button==this.toolBarButton5)//刷新
{
this.Close();
}
if(e.Button==this.toolBarButton1)//刷新
{
SelfMakeJackMessUI_Load( sender, e);
}
if(e.Button==this.toolBarButton2)//添加
{
AddJackMessUI add=new AddJackMessUI();
add.ShowDialog(this);
}
if(e.Button==this.toolBarButton3)//删除
{
try
{
if(this.listView1.SelectedItems.Count>0)
{
SetupDeleteSelfJackmessByid del=new SetupDeleteSelfJackmessByid();
if(del.DeleteSelfJackmessByid(this.listView1.SelectedItems[0].SubItems[0].Text))
{
MessageBox.Show("删除成功!");
}
else
{
MessageBox.Show("删除失败!");
}
}
else
{
MessageBox.Show("请选择要删除的信息!");
}
SelfMakeJackMessUI_Load( sender, e);
}
catch
{
}
}
if(e.Button==this.toolBarButton4)//更改
{
try
{
if(this.listView1.SelectedItems.Count>0)
{
UpdateSelfmessUI up=new UpdateSelfmessUI(this.listView1.SelectedItems[0]);
up.ShowDialog(this);
}
else
{
MessageBox.Show("请选择要更新的信息!");
}
}
catch
{
}
}
}
private void listView1_DoubleClick(object sender, System.EventArgs e)
{
try
{
if(this.listView1.SelectedItems.Count>0)
{
UpdateSelfmessUI up=new UpdateSelfmessUI(this.listView1.SelectedItems[0]);
up.ShowDialog(this);
}
else
{
MessageBox.Show("请选择要更新的信息!");
}
}
catch
{
}
}
private void SelfMakeJackMessUI_Activated(object sender, System.EventArgs e)
{
SelfMakeJackMessUI_Load( sender, e);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -