📄 applyrecord.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections ;
namespace Hr.component
{
public class ApplyRecord:Hr.component.DatabaseOperation
{
private int personID;
private int companyID;
public ApplyRecord()
{
//
// TODO: Add constructor logic here
//
}
#region Properties of temp store
public int PersonID
{
get
{
return personID;
}
set
{
personID = value;
}
}
public int CompanyID
{
get
{
return companyID;
}
set
{
companyID = value;
}
}
#endregion
#region Functions of temp store
public static void AddApplyRecord(ArrayList tempary)
{
SqlConnection myConn=new SqlConnection(strConn);
SqlCommand myCm=new SqlCommand("AddApplyRecord",myConn);
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
{
myConn.Open() ;
myCm.ExecuteNonQuery() ;
}
catch(System.Data.SqlClient.SqlException er)
{
throw new Exception(er.Message);
}
finally
{
myCm.Dispose() ;
myConn.Close() ;
}
}
public static void DeleteCompany(int companyId)
{
strSQL = "Delete From ApplyRecord Where companyID="+companyId.ToString();
try
{
ExecuteNonQuery(strSQL);
}
catch
{
throw new Exception("Delete book FAILED!");
}
}
public void DeleteCompany()
{
strSQL = "Delete From ApplyRecord Where companyID=" + this.CompanyID.ToString();
try
{
ExecuteNonQuery(strSQL);
}
catch
{
throw new Exception("Delete ApplyRecord FAILED!");
}
}
public static void DeletePerson(int personId)
{
strSQL = "Delete From ApplyRecord Where personID="+personId.ToString();
try
{
ExecuteNonQuery(strSQL);
}
catch
{
throw new Exception("Delete ApplyRecord FAILED!");
}
}
public static void DeleteGroup(string names)
{
strSQL = "Delete From ApplyRecord Where personID in ('" + names + "')";
try
{
ExecuteNonQuery(strSQL);
}
catch
{
throw new Exception("Delete person FAILED!");
}
}
public void DeletePerson()
{
strSQL = "Delete From ApplyRecord Where personID=" + this.PersonID.ToString();
try
{
ExecuteNonQuery(strSQL);
}
catch
{
throw new Exception("Delete ApplyRecord FAILED!");
}
}
public static void DeleteApplyRecordByID(int Id)
{
strSQL = "Delete From ApplyRecord Where ApplyRecordID="+Id.ToString();
try
{
ExecuteNonQuery(strSQL);
}
catch
{
throw new Exception("删除简历发生错误!");
}
}
public static void DeleteApplyRecord(int companyId,int personId)
{
strSQL = "Delete From ApplyRecord Where companyID="+companyId.ToString()+
" And personID=" + personId.ToString();
try
{
ExecuteNonQuery(strSQL);
}
catch
{
throw new Exception("删除简历发生错误!");
}
}
public void DeleteApplyRecord()
{
strSQL = "Delete From ApplyRecord Where companyID="+this.CompanyID.ToString()+
" And personID=" + this.PersonID.ToString();
try
{
ExecuteNonQuery(strSQL);
}
catch
{
throw new Exception("删除简历发生错误!");
}
}
public static DataSet GetPersonCompany(int companyId,int personId)
{
strSQL = "SELECT * FROM ApplyRecord Where companyID=" + companyId.ToString()+" and personID=" + personId.ToString();
try
{
return ExecuteReturnDS(strSQL);
}
catch
{
throw new Exception("读取信息失败!");
}
}
public static DataSet GetPersonByCompanyId(int companyId)
{
strSQL = "SELECT * FROM ApplyRecord Where companyID=" + companyId.ToString();
try
{
return ExecuteReturnDS(strSQL);
}
catch
{
throw new Exception("读取指定公司应聘信息失败!");
}
}
public static DataSet GetCompany(int personId)
{
strSQL = "SELECT * FROM ApplyRecord Where personID=" + personId.ToString();
try
{
return ExecuteReturnDS(strSQL);
}
catch
{
throw new Exception("读取指定个人求职信息失败!");
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -