public long AddEmployee(CPersonnel Employee) { long EmployeeID = 0; List <OleDbParameter> Param = new List <OleDbParameter>(); Param.Add(Db.MakeInParam("WorkID", System.Data.OleDb.OleDbType.VarChar, 20, Employee.WorkID)); Param.Add(Db.MakeInParam("Name", System.Data.OleDb.OleDbType.VarChar, 20, Employee.Name)); Param.Add(Db.MakeInParam("Alias", System.Data.OleDb.OleDbType.VarChar, 20, Employee.Alias)); Param.Add(Db.MakeInParam("Sex", System.Data.OleDb.OleDbType.VarChar, 3, Employee.Sex)); Param.Add(Db.MakeInParam("Birth", System.Data.OleDb.OleDbType.VarChar, 50, Employee.Birth)); Param.Add(Db.MakeInParam("IdentityCard", System.Data.OleDb.OleDbType.VarChar, 30, Employee.IdentityCard)); Param.Add(Db.MakeInParam("EduLevel", System.Data.OleDb.OleDbType.VarChar, 10, Employee.EduLevel)); Param.Add(Db.MakeInParam("HoldDate", OleDbType.DBTimeStamp, 8, Convert.ToDateTime(Employee.HoldDate.ToString()))); Param.Add(Db.MakeInParam("ContractDate", OleDbType.DBTimeStamp, 8, Convert.ToDateTime(Employee.ContractDate.ToString()))); Param.Add(Db.MakeInParam("DimissionDate", OleDbType.DBTimeStamp, 8, Convert.ToDateTime(Employee.DimissionDate.ToString()))); //Param.Add(Db.MakeInParam("HoldDate", System.Data.OleDb.OleDbType.DBTimeStamp, 8, Employee.HoldDate)); //Param.Add(Db.MakeInParam("ContractDate", System.Data.OleDb.OleDbType.DBTimeStamp, 8, Employee.ContractDate)); //Param.Add(Db.MakeInParam("DimissionDate", System.Data.OleDb.OleDbType.DBTimeStamp, 8, Employee.DimissionDate)); Param.Add(Db.MakeInParam("WorkAddress", System.Data.OleDb.OleDbType.VarChar, 256, Employee.WorkAddress)); Param.Add(Db.MakeInParam("WorkPhone", System.Data.OleDb.OleDbType.VarChar, 50, Employee.WorkPhone)); Param.Add(Db.MakeInParam("QQ", System.Data.OleDb.OleDbType.VarChar, 50, Employee.QQ)); Param.Add(Db.MakeInParam("MSN", System.Data.OleDb.OleDbType.VarChar, 50, Employee.MSN)); Param.Add(Db.MakeInParam("EMail", System.Data.OleDb.OleDbType.VarChar, 50, Employee.EMail)); Param.Add(Db.MakeInParam("Fax", System.Data.OleDb.OleDbType.VarChar, 50, Employee.Fax)); Param.Add(Db.MakeInParam("MobilePhone", System.Data.OleDb.OleDbType.VarChar, 50, Employee.MobilePhone)); Param.Add(Db.MakeInParam("HomePhone", System.Data.OleDb.OleDbType.VarChar, 50, Employee.HomePhone)); Param.Add(Db.MakeInParam("Addrees", System.Data.OleDb.OleDbType.VarChar, 256, Employee.Addrees)); Param.Add(Db.MakeInParam("Outjob", System.Data.OleDb.OleDbType.Integer, 4, Employee.Outjob)); EmployeeID = Db.ExecIdentityInsert(@"INSERT INTO tPersonnel(WorkID,Name, Alias,Sex,Birth, IdentityCard,EduLevel,HoldDate,Contract,DimissionDate, WorkAddress, WorkPhone, QQ, MSN, EMail,Fax, MobilePhone, HomePhone, Addrees,Outjob) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?, ?,?,?,?,?)", Param); return(EmployeeID); }
public bool UpdateEmployee(CPersonnel Employee) { List <OleDbParameter> Param = new List <OleDbParameter>(); Param.Add(Db.MakeInParam("WorkID", System.Data.OleDb.OleDbType.VarChar, 20, Employee.WorkID)); Param.Add(Db.MakeInParam("Name", System.Data.OleDb.OleDbType.VarChar, 20, Employee.Name)); Param.Add(Db.MakeInParam("Alias", System.Data.OleDb.OleDbType.VarChar, 20, Employee.Alias)); Param.Add(Db.MakeInParam("Sex", System.Data.OleDb.OleDbType.VarChar, 3, Employee.Sex)); Param.Add(Db.MakeInParam("Birth", System.Data.OleDb.OleDbType.VarChar, 50, Employee.Birth)); Param.Add(Db.MakeInParam("IdentityCard", System.Data.OleDb.OleDbType.VarChar, 30, Employee.IdentityCard)); Param.Add(Db.MakeInParam("EduLevel", System.Data.OleDb.OleDbType.VarChar, 10, Employee.EduLevel)); Param.Add(Db.MakeInParam("HoldDate", OleDbType.DBTimeStamp, 8, Convert.ToDateTime(Employee.HoldDate.ToString()))); Param.Add(Db.MakeInParam("ContractDate", OleDbType.DBTimeStamp, 8, Convert.ToDateTime(Employee.ContractDate.ToString()))); Param.Add(Db.MakeInParam("DimissionDate", OleDbType.DBTimeStamp, 8, Convert.ToDateTime(Employee.DimissionDate.ToString()))); //Param.Add(Db.MakeInParam("HoldDate", System.Data.OleDb.OleDbType.DBTimeStamp, 8, Employee.HoldDate)); //Param.Add(Db.MakeInParam("ContractDate", System.Data.OleDb.OleDbType.DBTimeStamp, 8, Employee.ContractDate)); //Param.Add(Db.MakeInParam("DimissionDate", System.Data.OleDb.OleDbType.DBTimeStamp, 8, Employee.DimissionDate)); Param.Add(Db.MakeInParam("WorkAddress", System.Data.OleDb.OleDbType.VarChar, 256, Employee.WorkAddress)); Param.Add(Db.MakeInParam("WorkPhone", System.Data.OleDb.OleDbType.VarChar, 50, Employee.WorkPhone)); Param.Add(Db.MakeInParam("QQ", System.Data.OleDb.OleDbType.VarChar, 50, Employee.QQ)); Param.Add(Db.MakeInParam("MSN", System.Data.OleDb.OleDbType.VarChar, 50, Employee.MSN)); Param.Add(Db.MakeInParam("EMail", System.Data.OleDb.OleDbType.VarChar, 50, Employee.EMail)); Param.Add(Db.MakeInParam("Fax", System.Data.OleDb.OleDbType.VarChar, 50, Employee.Fax)); Param.Add(Db.MakeInParam("MobilePhone", System.Data.OleDb.OleDbType.VarChar, 50, Employee.MobilePhone)); Param.Add(Db.MakeInParam("HomePhone", System.Data.OleDb.OleDbType.VarChar, 50, Employee.HomePhone)); Param.Add(Db.MakeInParam("Addrees", System.Data.OleDb.OleDbType.VarChar, 256, Employee.Addrees)); Param.Add(Db.MakeInParam("Outjob", System.Data.OleDb.OleDbType.Integer, 4, Employee.Outjob)); Param.Add(Db.MakeInParam("PersonnelID", System.Data.OleDb.OleDbType.VarChar, 256, Employee.PersonnelID)); if (Db.ExecSql(@"Update tPersonnel Set WorkID=?, Name=?, Alias=?, Sex=?, Birth=?, IdentityCard=?,EduLevel=?,HoldDate=?,Contract=?, DimissionDate=?, WorkAddress=?, WorkPhone=?, QQ=?, MSN=?, EMail=?,Fax=?, MobilePhone=?, HomePhone=?, Addrees=?,Outjob=? WHERE (PersonnelID = ?)", Param) > 0) { return(true); } else { return(false); } }
public FormEmployeeInfo() { m_Personnel = new CPersonnel(); m_PersonnelResume = new CPersonnelResume(); InitializeComponent(); }