📄 resume.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using My.Hr.DbBase;
using System.Collections ;
namespace My.Hr
{
/// <summary>
/// Summary description for TempStore.
/// </summary>
public class Resume:DbBase.Base
{
private int personID;
private int companyID;
public Resume()
{
//
// TODO: Add constructor logic here
//
}
#region Properties of temp store
/// <summary>
/// Book ID
/// </summary>
public int PersonID
{
get
{
return personID;
}
set
{
personID = value;
}
}
/// <summary>
/// User ID
/// </summary>
public int CompanyID
{
get
{
return companyID;
}
set
{
companyID = value;
}
}
#endregion
#region Functions of temp store
/// <summary>
/// Add new book in temp store.
/// </summary>
public static void Add(ArrayList tempary)
{
SqlConnection myCn=new SqlConnection(strConn);
SqlCommand myCm=new SqlCommand("AddResume",myCn);
myCm.CommandType =CommandType.StoredProcedure ;
myCm.Parameters.Add(new SqlParameter("@personID",SqlDbType.Int));
myCm.Parameters["@personID"].Value =tempary[0];
myCm.Parameters.Add(new SqlParameter("@companyID",SqlDbType.Int));
myCm.Parameters["@companyID"].Value =tempary[1];
myCm.Parameters.Add(new SqlParameter("@personName",SqlDbType.VarChar,50));
myCm.Parameters["@personName"].Value =tempary[2];
myCm.Parameters.Add(new SqlParameter("@companyName",SqlDbType.VarChar,50));
myCm.Parameters["@companyName"].Value =tempary[3];
myCm.Parameters.Add(new SqlParameter("@CWorkPosition",SqlDbType.VarChar,50));
myCm.Parameters["@CWorkPosition"].Value =tempary[4];
myCm.Parameters.Add(new SqlParameter("@PWorkPosition",SqlDbType.VarChar,50));
myCm.Parameters["@PWorkPosition"].Value =tempary[5];
try
{
myCn.Open() ;
myCm.ExecuteNonQuery() ;
}
catch(System.Data.SqlClient.SqlException er)
{
throw new Exception(er.Message);
}
finally
{
myCm.Dispose() ;
myCn.Close() ;
}
}
/// <summary>
/// Delete book from temp store
/// </summary>
/// <param name="bookId">Book ID(int)</param>
/// <param name="userId">User ID(int)</param>
public static void DeleteCompany(int companyId)
{
strSQL = "Delete From resume Where companyID="+companyId.ToString();
try
{
ExecuteSql(strSQL);
}
catch
{
throw new Exception("Delete book FAILED!");
}
}
/// <summary>
/// Delete book from temp store
/// </summary>
public void DeleteCompany()
{
strSQL = "Delete From resume Where companyID=" + this.CompanyID.ToString();
try
{
ExecuteSql(strSQL);
}
catch
{
throw new Exception("Delete resume FAILED!");
}
}
/// <summary>
/// Delete book from temp store
/// </summary>
/// <param name="bookId">Book ID(int)</param>
/// <param name="userId">User ID(int)</param>
public static void DeletePerson(int personId)
{
strSQL = "Delete From resume Where personID="+personId.ToString();
try
{
ExecuteSql(strSQL);
}
catch
{
throw new Exception("Delete resume FAILED!");
}
}
public static void DeleteGroup(string names)
{
strSQL = "Delete From resume Where personID in ('" + names + "')";
try
{
ExecuteSql(strSQL);
}
catch
{
throw new Exception("Delete person FAILED!");
}
}
/// <summary>
/// Delete book from temp store
/// </summary>
public void DeletePerson()
{
strSQL = "Delete From resume Where personID=" + this.PersonID.ToString();
try
{
ExecuteSql(strSQL);
}
catch
{
throw new Exception("Delete resume FAILED!");
}
}
/// <summary>
/// Delete book from temp store
/// </summary>
/// <param name="bookId">Book ID(int)</param>
/// <param name="userId">User ID(int)</param>
public static void DeleteResume(int companyId,int personId)
{
strSQL = "Delete From resume Where companyID="+companyId.ToString()+
" And personID=" + personId.ToString();
try
{
ExecuteSql(strSQL);
}
catch
{
throw new Exception("Delete resume FAILED!");
}
}
/// <summary>
/// Delete book from temp store
/// </summary>
public void DeleteResume()
{
strSQL = "Delete From resume Where companyID="+this.CompanyID.ToString()+
" And personID=" + this.PersonID.ToString();
try
{
ExecuteSql(strSQL);
}
catch
{
throw new Exception("Delete resume FAILED!");
}
}
/// <summary>
/// Get all the books in the temp store
/// </summary>
/// <param name="userId">User ID(int)</param>
/// <returns>return books(DataSet)</returns>
public static DataSet GetPerson(int companyId)
{
strSQL = "SELECT * FROM resume Where companyID=" + companyId.ToString();
try
{
return ExecuteSql4Ds(strSQL);
}
catch
{
throw new Exception("Get all the persons FAILED!");
}
}
/// <summary>
/// Get all the books in the temp store
/// </summary>
/// <param name="userId">User ID(int)</param>
/// <returns>return books(DataSet)</returns>
public static DataSet GetCompany(int personId)
{
strSQL = "SELECT * FROM resume Where personID=" + personId.ToString();
try
{
return ExecuteSql4Ds(strSQL);
}
catch
{
throw new Exception("Get all the companies FAILED!");
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -