📄 新建 文本文档.txt
字号:
using System;
using System.Windows.Forms;
using System.ComponentModel;
using System.Data;
using System.Resources;
using System.Drawing;
namespace InstMsnger
{
public class AddGroup : Form
{
private Button button1;
private Button button2;
private ComboBox comboBox1;
private Container components;
private Label label1;
private Label label2;
private Label label3;
private Label label4;
public GroupSet MT;
private Panel panel1;
private TextBox textBox1;
private TextBox textBox2;
private TextBox textBox3;
public AddGroup()
{
this.components = null;
this.InitializeComponent();
}
private void AddGroup_Load(object sender, EventArgs e)
{
this.LoadFcc();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
DataTable table1 = this.MT.Db.DBList("Select * From WorkGroup").Clone();
table1.Rows.Add(table1.NewRow());
table1.Rows[0]["GroupName"] = this.textBox1.Text;
table1.Rows[0]["GroupBZ"] = this.textBox2.Text;
table1.Rows[0]["NumSet"] = this.textBox3.Text;
table1.Rows[0]["ByFcId"] = this.comboBox1.SelectedValue;
this.MT.Db.InsDb(table1.Rows[0], "WorkGroup", "GroupId");
if (this.MT.GroupDataGrid.DataSource != null)
{
this.MT.GroupDtt.Clear();
this.MT.LoadGroupList();
}
base.Close();
}
catch
{
MessageBox.Show("添加记录失败,请检查您所输入的数据是否正确。", "PoinTO短讯系统");
}
}
private void button2_Click(object sender, EventArgs e)
{
base.Close();
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
ResourceManager manager1 = new ResourceManager(typeof(AddGroup));
this.panel1 = new Panel();
this.comboBox1 = new ComboBox();
this.label3 = new Label();
this.textBox3 = new TextBox();
this.label4 = new Label();
this.label2 = new Label();
this.textBox2 = new TextBox();
this.button1 = new Button();
this.button2 = new Button();
this.textBox1 = new TextBox();
this.label1 = new Label();
this.panel1.SuspendLayout();
base.SuspendLayout();
this.panel1.BackgroundImage = (Image) manager1.GetObject("panel1.BackgroundImage");
this.panel1.Controls.Add(this.comboBox1);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.textBox3);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.textBox2);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.textBox1);
this.panel1.Controls.Add(this.label1);
this.panel1.Location = new Point(-4, -64);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x180, 0xe8);
this.panel1.TabIndex = 1;
this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
this.comboBox1.Location = new Point(0x9c, 160);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new Size(180, 20);
this.comboBox1.TabIndex = 14;
this.label3.AutoSize = true;
this.label3.BackColor = Color.Transparent;
this.label3.Location = new Point(0x74, 0xa4);
this.label3.Name = "label3";
this.label3.Size = new Size(0x23, 0x11);
this.label3.TabIndex = 13;
this.label3.Text = "所属:";
this.textBox3.BorderStyle = BorderStyle.FixedSingle;
this.textBox3.Location = new Point(0x34, 160);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new Size(0x2c, 0x15);
this.textBox3.TabIndex = 3;
this.textBox3.Text = "10";
this.label4.AutoSize = true;
this.label4.BackColor = Color.Transparent;
this.label4.Location = new Point(0x10, 0xa4);
this.label4.Name = "label4";
this.label4.Size = new Size(0x23, 0x11);
this.label4.TabIndex = 12;
this.label4.Text = "次序:";
this.label2.AutoSize = true;
this.label2.BackColor = Color.Transparent;
this.label2.Location = new Point(0x10, 0x7c);
this.label2.Name = "label2";
this.label2.Size = new Size(0x23, 0x11);
this.label2.TabIndex = 11;
this.label2.Text = "备注:";
this.textBox2.BorderStyle = BorderStyle.FixedSingle;
this.textBox2.Location = new Point(0x34, 100);
this.textBox2.Multiline = true;
this.textBox2.Name = "textBox2";
this.textBox2.Size = new Size(0x11c, 0x38);
this.textBox2.TabIndex = 2;
this.textBox2.Text = "";
this.button1.BackColor = Color.Transparent;
this.button1.FlatStyle = FlatStyle.Popup;
this.button1.Location = new Point(140, 0xbc);
this.button1.Name = "button1";
this.button1.Size = new Size(0x2c, 0x17);
this.button1.TabIndex = 4;
this.button1.Text = "确定";
this.button1.Click += new EventHandler(this.button1_Click);
this.button2.BackColor = Color.Transparent;
this.button2.FlatStyle = FlatStyle.Popup;
this.button2.Location = new Point(0xc0, 0xbc);
this.button2.Name = "button2";
this.button2.Size = new Size(0x2c, 0x17);
this.button2.TabIndex = 5;
this.button2.Text = "取消";
this.button2.Click += new EventHandler(this.button2_Click);
this.textBox1.BorderStyle = BorderStyle.FixedSingle;
this.textBox1.Location = new Point(0x34, 0x4c);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new Size(0x11c, 0x15);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
this.label1.AutoSize = true;
this.label1.BackColor = Color.Transparent;
this.label1.Location = new Point(0x10, 80);
this.label1.Name = "label1";
this.label1.Size = new Size(0x23, 0x11);
this.label1.TabIndex = 1;
this.label1.Text = "名称:";
this.AutoScaleBaseSize = new Size(6, 14);
base.ClientSize = new Size(360, 0x99);
base.Controls.Add(this.panel1);
base.FormBorderStyle = FormBorderStyle.FixedDialog;
base.Icon = (Icon) manager1.GetObject("$this.Icon");
base.MaximizeBox = false;
base.MinimizeBox = false;
base.Name = "AddGroup";
base.ShowInTaskbar = false;
base.StartPosition = FormStartPosition.CenterScreen;
this.Text = "添加所属小部门或工作组";
base.Load += new EventHandler(this.AddGroup_Load);
this.panel1.ResumeLayout(false);
base.ResumeLayout(false);
}
private void LoadFcc()
{
DataTable table1 = this.MT.FcDtt.Copy();
this.comboBox1.DataSource = table1;
this.comboBox1.DisplayMember = "FcName";
this.comboBox1.ValueMember = "Id";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -