?? moveemployee.cs
字號:
using System;
using System.Data ;
using System.Data .SqlClient ;
namespace BlueHill.BlueHillWindows.DepartmentManagement
{
/// <summary>
/// MoveEmployee 的摘要說明。
/// </summary>
public class MoveEmployee
{
public MoveEmployee()
{
//
// TODO: 在此處添加構(gòu)造函數(shù)邏輯
//
}
public SqlConnection conn=null;
public SqlCommand com=null;
public SqlConnection conn1=null;
public SqlCommand com1=null;
public string deptname;
public string deptname1;
public void updateemployee()
{
conn=new SqlConnection("integrated security=SSPI;data source=(local);initial catalog=BlueHill");
conn.Open();
com=new SqlCommand("update tblEmployee set DeptID =(select DeptID from tblDepartment where DeptName ='" + deptname +"') where DeptID=(select DeptID from tblDepartment where DeptName ='" + deptname1 +"')",conn);
}
public void deldept()
{
conn1=new SqlConnection("integrated security=SSPI;data source=(local);initial catalog=BlueHill");
conn1.Open();
com1=new SqlCommand("delete tblDepartment where DeptName ='" + deptname1 +"'",conn1);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -