using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using CY.IDAL;
|
using System.Data.SqlClient;
|
using System.Data;
|
using CY.Model;
|
using System.Transactions;
|
namespace CY.SQLDAL
|
{
|
//简历信息工作经验
|
public class OA_StaffResumeWorkDAL : IOA_StaffResumeWorkDAL
|
{
|
private Database _dataBase = null;
|
|
public OA_StaffResumeWorkDAL()
|
{
|
_dataBase = new Database();
|
}
|
|
public OA_StaffResumeWorkDAL(Database dataBase)
|
{
|
_dataBase = dataBase;
|
}
|
|
/// <summary>
|
/// 新增
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public bool InserModel(Infrastructure.Domain.IAggregateRoot model)
|
{
|
Model.OA_StaffResumeWork trueModel = model as Model.OA_StaffResumeWork;
|
if (trueModel == null)
|
{
|
return false;
|
}
|
IList<SqlParameter> sqlParms = new List<SqlParameter>()
|
{ new SqlParameter("@Memberid", trueModel.Memberid) ,
|
new SqlParameter("@R_W_StudyStartTime", trueModel.R_W_StudyStartTime) ,
|
new SqlParameter("@R_W_StudyEndTime", trueModel.R_W_StudyEndTime) ,
|
new SqlParameter("@R_W_CompanyName", trueModel.R_W_CompanyName) ,
|
new SqlParameter("@R_W_Industry", trueModel.R_W_Industry) ,
|
new SqlParameter("@R_W_CompanyScale", trueModel.R_W_CompanyScale) ,
|
new SqlParameter("@R_W_CompanyNature", trueModel.R_W_CompanyNature) ,
|
new SqlParameter("@R_W_Department", trueModel.R_W_Department) ,
|
new SqlParameter("@R_W_Post", trueModel.R_W_Post) ,
|
new SqlParameter("@R_W_WorkDetail", trueModel.R_W_WorkDetail) ,
|
new SqlParameter("@OrderNum", trueModel.OrderNum) ,
|
new SqlParameter("@LastUpdateTime", trueModel.LastUpdateTime) ,
|
new SqlParameter("@Operator", trueModel.Operator)
|
};
|
try
|
{
|
_dataBase.Query("sp_OA_StaffResumeWork_Insert", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>());
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return true;
|
}
|
|
/// <summary>
|
/// 修改
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public bool UpdateModel(Infrastructure.Domain.IAggregateRoot model)
|
{
|
Model.OA_StaffResumeWork trueModel = model as Model.OA_StaffResumeWork;
|
if (trueModel == null)
|
{
|
return false;
|
}
|
IList<SqlParameter> sqlParms = new List<SqlParameter>()
|
{ new SqlParameter("@Keyid", trueModel.Keyid) ,
|
new SqlParameter("@Memberid", trueModel.Memberid) ,
|
new SqlParameter("@R_W_StudyStartTime", trueModel.R_W_StudyStartTime) ,
|
new SqlParameter("@R_W_StudyEndTime", trueModel.R_W_StudyEndTime) ,
|
new SqlParameter("@R_W_CompanyName", trueModel.R_W_CompanyName) ,
|
new SqlParameter("@R_W_Industry", trueModel.R_W_Industry) ,
|
new SqlParameter("@R_W_CompanyScale", trueModel.R_W_CompanyScale) ,
|
new SqlParameter("@R_W_CompanyNature", trueModel.R_W_CompanyNature) ,
|
new SqlParameter("@R_W_Department", trueModel.R_W_Department) ,
|
new SqlParameter("@R_W_Post", trueModel.R_W_Post) ,
|
new SqlParameter("@R_W_WorkDetail", trueModel.R_W_WorkDetail) ,
|
new SqlParameter("@OrderNum", trueModel.OrderNum) ,
|
new SqlParameter("@LastUpdateTime", trueModel.LastUpdateTime) ,
|
new SqlParameter("@Operator", trueModel.Operator)
|
};
|
try
|
{
|
_dataBase.Query("sp_OA_StaffResumeWork_Update", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>());
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return true;
|
}
|
|
/// <summary>
|
/// 删除
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public bool DeleteModel(Infrastructure.Domain.IAggregateRoot model)
|
{
|
Model.OA_StaffResumeWork trueModel = model as Model.OA_StaffResumeWork;
|
if (trueModel == null)
|
{
|
return false;
|
}
|
IList<SqlParameter> sqlParms = new List<SqlParameter>()
|
{
|
new SqlParameter("@Keyid",trueModel.Keyid)
|
};
|
try
|
{
|
_dataBase.Query("sp_OA_StaffResumeWork_DeleteRow", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>());
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
|
return true;
|
}
|
|
/// <summary>
|
/// 分页查询
|
/// </summary>
|
/// <param name="query"></param>
|
/// <param name="pagination"></param>
|
/// <returns></returns>
|
public IEnumerable<Model.OA_StaffResumeWork> SelectModelPage(Infrastructure.Query.Query query, Infrastructure.Query.Pagination pagination)
|
{
|
throw new NotImplementedException();
|
}
|
|
/// <summary>
|
/// 单个查询
|
/// </summary>
|
/// <param name="query"></param>
|
/// <returns></returns>
|
public IEnumerable<Model.OA_StaffResumeWork> SelectAllModel(Infrastructure.Query.Query query)
|
{
|
throw new NotImplementedException();
|
}
|
|
/// <summary>
|
/// 根据编号获得信息
|
/// </summary>
|
/// <param name="Keyid">编号</param>
|
/// <returns></returns>
|
public OA_StaffResumeWork GetModelByKeyid(int? Keyid)
|
{
|
try
|
{
|
if (Keyid == null || Keyid < 0)
|
return null;//错误数据返会空
|
|
IList<OA_StaffResumeWork> result = _dataBase.SelectModel<OA_StaffResumeWork>(" * ", " OA_StaffResumeWork ", string.Format(" Keyid='{0}'", Keyid)) as IList<OA_StaffResumeWork>;//执行查询
|
|
return (null == result || result.Count == 0) ? null : result[0];//返回结果
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 根据厂商编号获得信息
|
/// </summary>
|
/// <param name="Memberid">厂商编号</param>
|
/// <returns></returns>
|
public IEnumerable<Model.OA_StaffResumeWork> GetListByMemberid(Guid Memberid)
|
{
|
try
|
{
|
if (Memberid == null || Memberid == Guid.Empty)
|
return null;//错误数据返会空
|
|
IList<OA_StaffResumeWork> result = _dataBase.SelectModel<OA_StaffResumeWork>(" * ", " OA_StaffResumeWork ", string.Format(" Memberid='{0}'", Memberid)) as IList<OA_StaffResumeWork>;//执行查询
|
|
return result;//返回结果
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 分页查询
|
/// </summary>
|
/// <param name="pagination"></param>
|
/// <returns></returns>
|
public IEnumerable<Model.OA_StaffResumeWork> SelectModelPage(Infrastructure.Query.Pagination pagination, Guid _Memberid, string _R_W_StudyStartTime, string _R_W_StudyEndTime, string _R_W_CompanyName, string _R_W_Industry, string _R_W_CompanyScale, string _R_W_CompanyNature, string _R_W_Department, string _R_W_Post, string _R_W_WorkDetail, int? _OrderNum, DateTime? _BeginLastUpdateTime, DateTime? _EndLastUpdateTime, string _Operator)
|
{
|
try
|
{
|
string condition = " 1=1 ";
|
|
if (_Memberid != Guid.Empty)
|
condition += " and Memberid = '" + _Memberid + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_StudyStartTime))
|
condition += " and R_W_StudyStartTime = '" + _R_W_StudyStartTime + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_StudyEndTime))
|
condition += " and R_W_StudyEndTime = '" + _R_W_StudyEndTime + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_CompanyName))
|
condition += " and R_W_CompanyName = '" + _R_W_CompanyName + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_Industry))
|
condition += " and R_W_Industry = '" + _R_W_Industry + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_CompanyScale))
|
condition += " and R_W_CompanyScale = '" + _R_W_CompanyScale + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_CompanyNature))
|
condition += " and R_W_CompanyNature = '" + _R_W_CompanyNature + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_Department))
|
condition += " and R_W_Department = '" + _R_W_Department + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_Post))
|
condition += " and R_W_Post = '" + _R_W_Post + "'";
|
|
if (!string.IsNullOrEmpty(_R_W_WorkDetail))
|
condition += " and R_W_WorkDetail = '" + _R_W_WorkDetail + "'";
|
|
if (_OrderNum.HasValue)
|
condition += " and OrderNum = '" + _OrderNum + "'";
|
|
if (_BeginLastUpdateTime.HasValue)
|
condition += string.Format(" and CAST(LastUpdateTime AS DATE) >='{0}'", _BeginLastUpdateTime);
|
|
if (_EndLastUpdateTime.HasValue)
|
condition += string.Format(" and CAST(LastUpdateTime AS DATE) <='{0}'", _EndLastUpdateTime);
|
|
if (!string.IsNullOrEmpty(_Operator))
|
condition += " and Operator = '" + _Operator + "'";
|
|
return _dataBase.SelectModelPage<Model.OA_StaffResumeWork>(pagination, " * ", " OA_StaffResumeWork ", " Keyid desc", " Keyid desc ", condition);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
}
|
}
|