📄 addjcinfo_form.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BusinessLayer;
using Entity;
namespace rsMange
{
public partial class AddJcInfo_Form : Form
{
JiangFa2 jf = new JiangFa2();
Operate_Jiangfa2Table op_jf2 = new Operate_Jiangfa2Table();
string oldyy;
public AddJcInfo_Form()
{
InitializeComponent();
}
public AddJcInfo_Form(JiangFa2 jf)
{
InitializeComponent();
oldyy = jf.Yuanying;
this.jf = jf;
this.Text = "修改奖惩信息";
this.label2.Text = "新奖惩原因:";
txtFs.Text = jf.Fs.ToString();
txtYy.Text = jf.Yuanying;
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
if (this.Text != "修改奖惩信息")
{
if (this.txtFs.Text.Trim() == "" || this.txtYy.Text.Trim() == "")
{
MessageBox.Show("请填写完整!", "提示");
}
else
{
jf.Fs = int.Parse(this.txtFs.Text.Trim());
jf.Yuanying = this.txtYy.Text.Trim();
int c = op_jf2.NewAddJf(jf);
if (c > 0)
{
MessageBox.Show("添加成功!", "提示");
this.Close();
}
else
MessageBox.Show(" 添加失败!请查看帮助", "出错了");
}
}
else
{
if (this.txtFs.Text.Trim() == "" || this.txtYy.Text.Trim() == "")
{
MessageBox.Show("请填写完整!", "提示");
}
else
{
jf.Fs = int.Parse(this.txtFs.Text.Trim());
jf.Yuanying = this.txtYy.Text.Trim();
int c = op_jf2.UpdateJfByYy(jf, oldyy);
if (c > 0)
{
MessageBox.Show("修改成功!", "提示");
this.Close();
}
else
MessageBox.Show(" 修改失败!请查看帮助", "出错了");
}
}
}
private void txtFs_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = e.KeyChar > '9' || e.KeyChar < '0';
if (e.KeyChar == (char)8||e.KeyChar=='-')
e.Handled = false;
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -