?? formsettingsalary.cs
字號(hào):
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data ;
namespace BlueHill.BlueHillWindows.SalaryManagement
{
/// <summary>
/// FormSettingSalary 的摘要說(shuō)明。
/// </summary>
public class FormSettingSalary : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.ComponentModel.Container components = null;
Salary sm=new Salary ();
FormSalaryManagement rs=new FormSalaryManagement ();
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtBaseSalary;
private int emptId;
public FormSettingSalary(int id)
{
InitializeComponent();
this.emptId =id;
}
/// 清理所有正在使用的資源。
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗體設(shè)計(jì)器生成的代碼
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FormSettingSalary));
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtBaseSalary = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(144, 152);
this.btnOK.Name = "btnOK";
this.btnOK.TabIndex = 1;
this.btnOK.Text = "確定";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(264, 152);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "取消";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtBaseSalary);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.pictureBox2);
this.groupBox1.Location = new System.Drawing.Point(16, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(456, 128);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
//
// txtBaseSalary
//
this.txtBaseSalary.Location = new System.Drawing.Point(248, 56);
this.txtBaseSalary.Name = "txtBaseSalary";
this.txtBaseSalary.Size = new System.Drawing.Size(192, 21);
this.txtBaseSalary.TabIndex = 2;
this.txtBaseSalary.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(128, 56);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 23);
this.label1.TabIndex = 1;
this.label1.Text = "基本薪資";
//
// pictureBox2
//
this.pictureBox2.AccessibleRole = System.Windows.Forms.AccessibleRole.TitleBar;
this.pictureBox2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox2.BackgroundImage")));
this.pictureBox2.Location = new System.Drawing.Point(64, 48);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(40, 32);
this.pictureBox2.TabIndex = 0;
this.pictureBox2.TabStop = false;
//
// FormSettingSalary
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(488, 189);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormSettingSalary";
this.Text = "基本薪資設(shè)定";
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void btnCancel_Click(object sender, System.EventArgs e)
{
this.Hide ();
rs.Show ();
}
private void btnOK_Click(object sender, System.EventArgs e)
{
if(txtBaseSalary.Text == "")
{
MessageBox.Show ("請(qǐng)輸入基本薪資","注意",MessageBoxButtons.OK ,MessageBoxIcon.Warning );
}
else
{
bool f=false;
if (f==false)
{
try
{
string str=txtBaseSalary.Text ;
int setSalary=System.Convert .ToInt32 (str);
DateTime nowDate=System.DateTime .Now;
DataTable dt=sm.FormSettingSalary (this.emptId ,setSalary,nowDate);
}
catch
{
MessageBox.Show ("請(qǐng)輸入正確的格式","注意",MessageBoxButtons.OK,MessageBoxIcon.Warning );
return;
}
this.Hide ();
rs.Show ();
}
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -