public IList <TrainPlanEmployee> GetTrainPlanEmployeeInfo(int trainPlanID, int trainEmployeeID, decimal process, int statusID, string memo, int startRowIndex, int maximumRows, string orderBy) { IList <TrainPlanEmployee> objEmployeeList = new List <TrainPlanEmployee>(); Database db = DatabaseFactory.CreateDatabase(); string sqlCommand = "USP_TRAIN_PLAN_EMPLOYEE_S"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "p_start_row_index", DbType.Int32, startRowIndex); db.AddInParameter(dbCommand, "p_page_size", DbType.Int32, maximumRows); db.AddInParameter(dbCommand, "p_order_by", DbType.String, GetMappingOrderBy(orderBy)); db.AddOutParameter(dbCommand, "p_count", DbType.Int32, 4); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { TrainPlanEmployee obj = CreateModelObject(dataReader); objEmployeeList.Add(obj); } } _recordCount = Convert.ToInt32(db.GetParameterValue(dbCommand, "p_count")); return(objEmployeeList); }
/// <summary> /// 更新培训计划员工 /// </summary> /// <param name="obj"></param> public void UpdateTrainPlanEmployee(TrainPlanEmployee obj) { Database db = DatabaseFactory.CreateDatabase(); string sqlCommand = "USP_TRAIN_PLAN_EMPLOYEE_U"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "p_train_plan_id", DbType.Int32, obj.TrainPlanID); db.AddInParameter(dbCommand, "p_train_employee_id", DbType.Int32, obj.TrainPlanEmployeeID); db.AddInParameter(dbCommand, "p_process", DbType.VarNumeric, obj.Process); db.AddInParameter(dbCommand, "p_status_id", DbType.Int32, obj.StatusID); db.AddInParameter(dbCommand, "p_memo", DbType.String, obj.Memo); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// 根据计划ID和员工ID返回唯一的培训计划员工信息 /// </summary> /// <param name="trainPlanID"></param> /// <param name="trainEmployeeID"></param> /// <returns></returns> public TrainPlanEmployee GetTrainPlanEmployeeInfo(int trainPlanID, int trainEmployeeID) { TrainPlanEmployee obj = new TrainPlanEmployee(); Database db = DatabaseFactory.CreateDatabase(); string sqlCommand = "USP_TRAIN_PLAN_EMPLOYEE_G"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "p_train_plan_id", DbType.Int32, trainPlanID); db.AddInParameter(dbCommand, "p_train_employee_id", DbType.Int32, trainEmployeeID); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { obj = CreateModelObject(dataReader); } } return(obj); }
/// <summary> /// 更新培训计划员工 /// </summary> /// <param name="obj"></param> public void UpdateTrainPlanEmployee(TrainPlanEmployee obj) { dal.UpdateTrainPlanEmployee(obj); }
/// <summary> /// 添加培训计划员工 /// </summary> /// <param name="obj"></param> public void AddTrainPlanEmployee(TrainPlanEmployee obj) { dal.AddTrainPlanEmployee(obj); }