培训
This commit is contained in:
@@ -63,28 +63,39 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
/// </summary>
|
||||
private void InitDropDownList()
|
||||
{
|
||||
//单位
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
|
||||
////获取适用岗位下拉框
|
||||
//PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, true);
|
||||
////获取培训类别下拉框
|
||||
//PostTrainingCategoryService.InitPostTrainingCategoryDropDownList(this.drpCategory, true);
|
||||
////获取培训方式下拉框
|
||||
//PostTrainingMethodService.InitPostTrainingMethodDropDownList(this.drpMethod, null, true);
|
||||
//获取培训类别下拉框
|
||||
PostTrainingCategoryService.InitPostTrainingCategoryDropDownList(this.drpCategory, true);
|
||||
//获取培训方式下拉框
|
||||
PostTrainingMethodService.InitPostTrainingMethodDropDownList(this.drpMethod, null, true);
|
||||
////获取培训师资下拉框
|
||||
//PostTrainingTeachersService.InitPostTrainingTeachersDropDownList(this.drpTeachers, null, true);
|
||||
////获取培训效果下拉框
|
||||
//PostTrainingRecordService.InitPostTrainingOutcomeDropDownList(this.drpOutcome, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 培训类别下拉加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpCategory_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//培训课程
|
||||
PostTrainingCourseService.InitPostTrainingCourseDropDownList(this.drpCourse, this.drpCategory.SelectedValue, true);
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT Record.*,Person.PersonName,Role.Name AS RoleName
|
||||
FROM PostTraining_Record_Detail AS Detail
|
||||
LEFT JOIN PostTraining_Record AS Record ON Record.Id=Detail.RecordId
|
||||
LEFT JOIN SitePerson_Person AS Person ON Person.PersonId=Detail.PersonId
|
||||
LEFT JOIN PostTraining_Role AS Role ON Role.Id=Person.PostTrainingRoleId
|
||||
string strSql = @"SELECT Record.* ,SUser.UserName AS CompileManName
|
||||
FROM PostTraining_Record AS Record
|
||||
LEFT JOIN Sys_User AS SUser ON SUser.UserId=Record.CompileMan
|
||||
WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
@@ -93,26 +104,31 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
strSql += " AND Record.Code LIKE @Code";
|
||||
listStr.Add(new SqlParameter("@Code", "%" + this.txtCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Person.PersonName LIKE @PersonName";
|
||||
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
|
||||
strSql += " AND Record.Name LIKE @Name";
|
||||
listStr.Add(new SqlParameter("@Name", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
//if (this.drpRole.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// strSql += " AND Record.RoleId = @RoleId";
|
||||
// listStr.Add(new SqlParameter("@RoleId", this.drpRole.SelectedValue));
|
||||
//}
|
||||
//if (this.drpCategory.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// strSql += " AND Course.CategoryId = @CategoryId";
|
||||
// listStr.Add(new SqlParameter("@CategoryId", this.drpCategory.SelectedValue));
|
||||
//}
|
||||
//if (this.drpMethod.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// strSql += " AND Record.Method = @Method";
|
||||
// listStr.Add(new SqlParameter("@Method", this.drpMethod.SelectedValue));
|
||||
//}
|
||||
if (this.drpCategory.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND Record.CategoryId = @CategoryId";
|
||||
listStr.Add(new SqlParameter("@CategoryId", this.drpCategory.SelectedValue));
|
||||
}
|
||||
if (this.drpCourse.SelectedValue != null && this.drpCourse.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND Record.CourseId = @CourseId";
|
||||
listStr.Add(new SqlParameter("@CourseId", this.drpCourse.SelectedValue));
|
||||
}
|
||||
if (this.drpMethod.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND Record.Method = @Method";
|
||||
listStr.Add(new SqlParameter("@Method", this.drpMethod.SelectedValue));
|
||||
}
|
||||
//if (this.drpTeachers.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// strSql += " AND Record.Teachers = @Teachers";
|
||||
@@ -168,6 +184,71 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 格式化字符串
|
||||
|
||||
/// <summary>
|
||||
/// 获取单位名称
|
||||
/// </summary>
|
||||
/// <param name="unitIds"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertUnitName(object unitIds)
|
||||
{
|
||||
string unitName = string.Empty;
|
||||
if (unitIds != null)
|
||||
{
|
||||
List<string> infos = unitIds.ToString().Split(',').ToList();
|
||||
if (infos.Count() > 0)
|
||||
{
|
||||
foreach (var item in infos)
|
||||
{
|
||||
Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(item);
|
||||
if (unit != null)
|
||||
{
|
||||
unitName += unit.UnitName + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitName))
|
||||
{
|
||||
unitName = unitName.Substring(0, unitName.LastIndexOf(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
return unitName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取适用岗位名称
|
||||
/// </summary>
|
||||
/// <param name="roleIds"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertRoleName(object roleIds)
|
||||
{
|
||||
string roleName = string.Empty;
|
||||
if (roleIds != null)
|
||||
{
|
||||
List<string> infos = roleIds.ToString().Split(',').ToList();
|
||||
if (infos.Count() > 0)
|
||||
{
|
||||
foreach (var item in infos)
|
||||
{
|
||||
Model.PostTraining_Role role = BLL.PostTrainingRoleService.GetRoleById(item);
|
||||
if (role != null)
|
||||
{
|
||||
roleName += role.Name + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(roleName))
|
||||
{
|
||||
roleName = roleName.Substring(0, roleName.LastIndexOf(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
return roleName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
|
||||
Reference in New Issue
Block a user