📄 frmplatfteacherinfo.cs
字号:
System.Data.OracleClient.OracleConnection tp_myConn = Connection.DBConnection;
if (tp_myConn == null)
{
return;
}
//对数据库进行查询操作
string tp_mySql = "SELECT DeptID FROM charge_Dept_Info";
OracleCommand tp_selCommand = new OracleCommand(tp_mySql,tp_myConn);
OracleDataReader cbbDataReader = null;
try
{
cbbDataReader = tp_selCommand.ExecuteReader();
}
catch(Exception ee)
{
MessageBox.Show("数据库查询出错,消息如下:\r\n"+ee.Message,"消息:",MessageBoxButtons.OK,MessageBoxIcon.Warning);
return;
}
//如果没有查询到任何部门,则退出本窗体
if (!cbbDataReader.HasRows)
{
MessageBox.Show("不存在任何部门,无法新建教工信息!");
this.Close();
return;
}
cbbSex.Items.Add("男");
cbbSex.Items.Add("女");
cbbSex.SelectedIndex = 0;
cbbSex.DropDownStyle = ComboBoxStyle.DropDownList;
//新增信息操作窗体
//toolbar设置
//tbrButtonAdd.Enabled = false;
//tbrButtonSave.Enabled = false;
//tbrButtonEdit.Enabled = false;
//tbrButtonDel.Enabled = false;
//tbrButtonUsed.Enabled = false;
//tbrButtonUsed.Visible = true;
//groupbox设置
txtTeacherName.ReadOnly = false;
txtUserNumber.ReadOnly = false;
cbbSex.Enabled = true;
txtHeadShip.ReadOnly =false;
//txtTitle.ReadOnly =false;
txtDeptName.ReadOnly = true;
btnDeptSel.Enabled = true;
//dtpEnroDate.Enabled = true;
//txtBuildName.ReadOnly = true;
//btnBuildSel.Enabled = true;
//txtRoomNumber.ReadOnly =false;
//txtFaimlyAddr.ReadOnly = false;
//txtContWay.ReadOnly = false;
//txtZipCode.ReadOnly = false;
//txtEmail.ReadOnly =false;
//txtBirthDate.ReadOnly = false;
//txtHomeTown.ReadOnly =false;
//txtPolitState.ReadOnly =false;
//txtNation.ReadOnly =false;
//txtIDCard.ReadOnly = false;
//txtBookBarCode.ReadOnly = false;
//按钮设置
btnAdd.Enabled = false;
btnSave.Enabled = false;
btnEdit.Enabled = false;
btnDel.Enabled = false;
//内容初始化
labId.Text = "";
txtTeacherName.Text = "";
txtUserNumber.Text ="";
txtHeadShip.Text ="";
//txtTitle.Text ="";
txtDeptName.Text ="";
//dtpEnroDate.Value =Convert.ToDateTime("2004-08-01 12:00:00");
//txtBuildName.Text ="";
//txtRoomNumber.Text ="";
//txtFaimlyAddr.Text ="";
//txtContWay.Text ="";
//txtZipCode.Text ="";
//txtEmail.Text ="";
//txtBirthDate.Text ="";
//txtHomeTown.Text ="";
//txtPolitState.Text ="";
//txtNation.Text ="";
//txtIDCard.Text ="";
//txtBookBarCode.Text ="";
//ptbPersPhoto.Image = PlatFCommon.imglistGlobal.Images[1];// Image.FromFile("暂无.BMP");//没有图片则置picturebox为默认图片
bPicModified = false;
defaultPic = true;
txtTeacherName.Focus();
}
/// <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(CfrmPlatFTeacherInfo));
this.gbTeacher1 = new System.Windows.Forms.GroupBox();
this.cbbSex = new System.Windows.Forms.ComboBox();
this.txtTeacherName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.labId = new System.Windows.Forms.Label();
this.txtUserNumber = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.btnDeptSel = new System.Windows.Forms.Button();
this.imageListtbr = new System.Windows.Forms.ImageList(this.components);
this.tbrTeacher = new System.Windows.Forms.ToolBar();
this.toolBarButton8 = new System.Windows.Forms.ToolBarButton();
this.tbrButtonSave = new System.Windows.Forms.ToolBarButton();
this.tbrButtonExit = new System.Windows.Forms.ToolBarButton();
this.label7 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.gbTeacher2 = new System.Windows.Forms.GroupBox();
this.txtHeadShip = new System.Windows.Forms.TextBox();
this.txtDeptName = new System.Windows.Forms.TextBox();
this.gbTeacher = new System.Windows.Forms.GroupBox();
this.btnExit = new System.Windows.Forms.Button();
this.btnDel = new System.Windows.Forms.Button();
this.btnEdit = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnAdd = new System.Windows.Forms.Button();
this.gbTeacher1.SuspendLayout();
this.gbTeacher2.SuspendLayout();
this.gbTeacher.SuspendLayout();
this.SuspendLayout();
//
// gbTeacher1
//
this.gbTeacher1.Controls.Add(this.cbbSex);
this.gbTeacher1.Controls.Add(this.txtTeacherName);
this.gbTeacher1.Controls.Add(this.label1);
this.gbTeacher1.Controls.Add(this.label5);
this.gbTeacher1.Controls.Add(this.labId);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -