培训
This commit is contained in:
@@ -69,7 +69,25 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
if (model != null)
|
||||
{
|
||||
this.txtCode.Text = model.Code;
|
||||
this.txtName.Text = model.Name;
|
||||
this.txtContent.Text = model.Content;
|
||||
this.txtRemark.Text = model.Remark;
|
||||
this.txtPersonNum.Text = model.PersonNum.ToString();
|
||||
this.txtLocation.Text = model.Location;
|
||||
this.txtDuration.Text = model.Duration.ToString();
|
||||
this.txtLecturer.Text = model.Lecturer;
|
||||
if (!string.IsNullOrEmpty(model.UnitIds))
|
||||
{
|
||||
this.drpUnits.SelectedValueArray = model.UnitIds.Split(',');
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.WorkPostIds))
|
||||
{
|
||||
this.drpWorkPost.SelectedValueArray = model.WorkPostIds.Split(',');
|
||||
}
|
||||
if (model.TrainingTime != null)
|
||||
{
|
||||
this.txtTrainingTime.Text = string.Format("{0:yyyy-MM-dd}", model.TrainingTime);
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(model.CourseId))
|
||||
{
|
||||
var course = BLL.PostTrainingCourseService.GetCourseById(model.CourseId);
|
||||
@@ -88,7 +106,10 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
{
|
||||
////自动生成编码
|
||||
this.txtCode.Text = SQLHelper.RunProcNewId("SpGetNewCode5", "dbo.PostTraining_Record", "Code", "");
|
||||
this.txtLecturer.Text = this.CurrUser.UserName;
|
||||
this.txtTrainingTime.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
this.Grid1DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +120,10 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
{
|
||||
//培训单位
|
||||
UnitService.InitUnitDropDownList(this.drpUnits, this.ProjectId, false);
|
||||
//获取适用岗位下拉框
|
||||
PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, false);
|
||||
//所属岗位
|
||||
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true);
|
||||
////获取适用岗位下拉框
|
||||
//PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, false);
|
||||
//获取培训类别下拉框
|
||||
PostTrainingCategoryService.InitPostTrainingCategoryDropDownList(this.drpCategory, false);
|
||||
//获取培训方式下拉框
|
||||
@@ -127,36 +150,10 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
{
|
||||
recordDetails = (from x in Funs.DB.View_PostTraining_RecordDetail
|
||||
where x.RecordId == this.Id
|
||||
orderby x.UnitName, x.RoleName, x.PersonName
|
||||
orderby x.UnitName, x.WorkPostName, x.PersonName
|
||||
select x).ToList();
|
||||
Grid1.DataSource = recordDetails;
|
||||
Grid1.DataBind();
|
||||
//for (int i = 0; i < Grid1.Rows.Count; i++)
|
||||
//{
|
||||
// bool isRed = true;
|
||||
// string trainDetailId = Grid1.Rows[i].DataKeys[0].ToString();
|
||||
// var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == trainDetailId);
|
||||
// if (getAtt != null)
|
||||
// {
|
||||
// isRed = false;
|
||||
// }
|
||||
// if (isRed)
|
||||
// {
|
||||
// var getRecordDetail = recordDetails.FirstOrDefault(x => x.DetailId == trainDetailId);
|
||||
// if (getRecordDetail != null && !string.IsNullOrEmpty(this.TestPlanId)) ////未参加过培训的人员
|
||||
// {
|
||||
// var getTestRecord = Funs.DB.Training_TestRecord.FirstOrDefault(x => x.TestManId == getRecordDetail.PersonId && x.TestPlanId == this.TestPlanId);
|
||||
// if (getTestRecord != null)
|
||||
// {
|
||||
// isRed = false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (isRed)
|
||||
// {
|
||||
// Grid1.Rows[i].RowCssClass = "Red";
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -174,16 +171,16 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
this.SaveData(BLL.Const.BtnSave);
|
||||
}
|
||||
//培训岗位
|
||||
string roleIds = string.Empty;
|
||||
foreach (var item in this.drpRole.SelectedValueArray)
|
||||
string workPostIds = string.Empty;
|
||||
foreach (var item in this.drpWorkPost.SelectedValueArray)
|
||||
{
|
||||
roleIds += item + ",";
|
||||
workPostIds += item + ",";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(roleIds))
|
||||
if (!string.IsNullOrEmpty(workPostIds))
|
||||
{
|
||||
roleIds = roleIds.Substring(0, roleIds.LastIndexOf(","));
|
||||
workPostIds = workPostIds.Substring(0, workPostIds.LastIndexOf(","));
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SelectPerson.aspx?RecordId={0}&RoleIds={1}", this.Id, roleIds, "编辑 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SelectPerson.aspx?RecordId={0}&WorkPostIds={1}", this.Id, workPostIds, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -277,18 +274,18 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
}
|
||||
|
||||
//培训岗位
|
||||
string roleIds = string.Empty;
|
||||
foreach (var item in this.drpRole.SelectedValueArray)
|
||||
string workPostIds = string.Empty;
|
||||
foreach (var item in this.drpWorkPost.SelectedValueArray)
|
||||
{
|
||||
roleIds += item + ",";
|
||||
workPostIds += item + ",";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(roleIds))
|
||||
if (!string.IsNullOrEmpty(workPostIds))
|
||||
{
|
||||
roleIds = roleIds.Substring(0, roleIds.LastIndexOf(","));
|
||||
workPostIds = workPostIds.Substring(0, workPostIds.LastIndexOf(","));
|
||||
}
|
||||
|
||||
newModel.UnitIds = unitIds;
|
||||
newModel.RoleIds = roleIds;
|
||||
newModel.WorkPostIds = workPostIds;
|
||||
if (!string.IsNullOrEmpty(this.Id))
|
||||
{
|
||||
newModel.Id = this.Id;
|
||||
@@ -326,6 +323,33 @@ namespace FineUIPro.Web.HSSE.PostTraining
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导入
|
||||
/// <summary>
|
||||
/// 导入按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpCategory.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择培训类别!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpCourse.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择培训课程!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.Id))
|
||||
{
|
||||
this.SaveData(BLL.Const.BtnSave);
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RecordIn.aspx?RecordId={0}", this.Id, "导入 - "), "导入", 900, 560));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 附件上传
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
|
||||
Reference in New Issue
Block a user