📄 frmplatfteacherinfo.cs
字号:
this.gbTeacher.Location = new System.Drawing.Point(8, 64);
this.gbTeacher.Name = "gbTeacher";
this.gbTeacher.Size = new System.Drawing.Size(752, 168);
this.gbTeacher.TabIndex = 44;
this.gbTeacher.TabStop = false;
this.gbTeacher.Text = "教工信息";
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(520, 312);
this.btnExit.Name = "btnExit";
this.btnExit.TabIndex = 13;
this.btnExit.Text = "退出";
this.btnExit.Visible = false;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// btnDel
//
this.btnDel.Location = new System.Drawing.Point(432, 328);
this.btnDel.Name = "btnDel";
this.btnDel.TabIndex = 12;
this.btnDel.Text = "删除";
this.btnDel.Visible = false;
this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
//
// btnEdit
//
this.btnEdit.Location = new System.Drawing.Point(344, 320);
this.btnEdit.Name = "btnEdit";
this.btnEdit.TabIndex = 9;
this.btnEdit.Text = "修改";
this.btnEdit.Visible = false;
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(248, 312);
this.btnSave.Name = "btnSave";
this.btnSave.TabIndex = 10;
this.btnSave.Text = "保存";
this.btnSave.Visible = false;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnAdd
//
this.btnAdd.Location = new System.Drawing.Point(168, 304);
this.btnAdd.Name = "btnAdd";
this.btnAdd.TabIndex = 8;
this.btnAdd.Text = "增加";
this.btnAdd.Visible = false;
//
// CfrmPlatFTeacherInfo
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(768, 239);
this.Controls.Add(this.gbTeacher);
this.Controls.Add(this.tbrTeacher);
this.Controls.Add(this.btnEdit);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnDel);
this.Controls.Add(this.btnSave);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "CfrmPlatFTeacherInfo";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "教工详细信息";
this.gbTeacher1.ResumeLayout(false);
this.gbTeacher2.ResumeLayout(false);
this.gbTeacher.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/***************************************************************************************************************
* 功能:信息的保存操作
*
* 输入参数:1、sender
* 2、e
* 输出参数:无
*
* 最后修改时间:04-08-13 by cellz
* ************************************************************************************************************/
private void btnSave_Click(object sender, System.EventArgs e)
{
bModified = true;
if (txtUserNumber.Text == "")
{
MessageBox.Show ("教工号不能为空!");
txtUserNumber.Focus();
return;
}
if (txtDeptName.Text == "")
{
MessageBox.Show ("请选择所属部门!");
btnDeptSel.Focus();
return;
}
System.Data.OracleClient.OracleConnection myConn = Connection.DBConnection;
if (myConn == null)
{
return;
}
//添加存储过程输入参数
OracleParameter[] inParam = {new OracleParameter(), new OracleParameter(),new OracleParameter(),
new OracleParameter(),new OracleParameter()
};
inParam[0].ParameterName = "p_name";
inParam[0].OracleType = OracleType.VarChar;
inParam[0].Value = txtTeacherName.Text.Trim();
inParam[1].ParameterName = "p_usernumber";
inParam[1].OracleType = OracleType.VarChar;
inParam[1].Value = txtUserNumber.Text.Trim();
inParam[2].ParameterName = "p_headship";
inParam[2].OracleType = OracleType.VarChar;
inParam[2].Value = txtHeadShip.Text.Trim();
inParam[3].ParameterName = "p_sex";
inParam[3].OracleType = OracleType.VarChar;
inParam[3].Value = cbbSex.Text.Trim();
inParam[4].ParameterName = "p_deptid";
inParam[4].OracleType = OracleType.Int32;
string stumajorid=Convert.ToString(txtDeptName.Tag);
int intmajorid=Convert.ToInt32(stumajorid);
inParam[4].Value = intmajorid;
OracleParameter[] outParam = {new OracleParameter(),new OracleParameter()};
outParam[0].ParameterName = "p_Result";
outParam[0].OracleType = OracleType.Int32;
outParam[0].Direction = ParameterDirection.Output;
outParam[1].ParameterName = "p_outuserid";
outParam[1].OracleType = OracleType.Int32;
outParam[1].Direction = ParameterDirection.Output;
//保存存储过程的调用
int retErrorVal = GlobleHelper.ExecStoredProc("SP_charge_SETtec", inParam, ref outParam);
if(retErrorVal == 7)//唯一键错误
{
MessageBox.Show("已有该学生存在,\r\n操作已被取消,请核对!","消息:",MessageBoxButtons.OK,MessageBoxIcon.Warning);
return;
}
if (Convert.ToInt32(outParam[0].Value) == 0) //保存成功
{ /*
ListViewItem cmicItem=new ListViewItem();
//string suserid=Convert.ToString(outParam[0].Value);
string suserid=Convert.ToString(outParam[1].Value);
lvTagTemp TagTemp= new lvTagTemp();
TagTemp.temp_id = suserid;
cmicItem.Tag = TagTemp;
cmicItem.Text=txtTeacherName.Text.Trim();
cmicItem.SubItems.Add(cbbSex.Text.Trim());
cmicItem.SubItems.Add(txtUserNumber.Text.Trim());
cmicItem.SubItems.Add(txtHeadShip.Text.Trim());
cmicItem.SubItems.Add(txtDeptName.Text.Trim());
tp_lvTeacher.Items.Add(cmicItem);
for(int i=0;i<tp_lvTeacher.Items.Count-1;i++)
{
tp_lvTeacher.Items[i].Selected = false;
}
tp_lvTeacher.Items[tp_lvTeacher.Items.Count-1].Selected = true;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -