优化
This commit is contained in:
@@ -25,6 +25,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.GetButtonPower();
|
||||
WorkPostService.InitWorkPostDropDownList(drpWorkPost, true);
|
||||
InitTreeMenu();
|
||||
}
|
||||
}
|
||||
@@ -172,6 +173,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 下拉触发事件
|
||||
|
||||
/// <summary>
|
||||
/// 适用岗位下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drp_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 绑定数据
|
||||
@@ -206,6 +222,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
strSql += " AND CompanyTrainingItemName LIKE @CompanyTrainingItemName";
|
||||
listStr.Add(new SqlParameter("@CompanyTrainingItemName", "%" + this.txtCompanyTrainingItemName.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.drpWorkPost.SelectedValue) && this.drpWorkPost.SelectedValue != Const._Null)
|
||||
{
|
||||
strSql += " AND (WorkPostIds IS NULL OR WorkPostIds LIKE @WorkPostId)";
|
||||
listStr.Add(new SqlParameter("@WorkPostId", "%" + this.drpWorkPost.SelectedValue + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
@@ -362,7 +383,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, getD.CompanyTrainingItemCode, getD.CompanyTrainingItemId, BLL.Const.CompanyTrainingMenuId, BLL.Const.BtnDelete);
|
||||
BLL.CompanyTrainingItemService.DeleteCompanyTrainingItemById(rowID);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,7 +393,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
@@ -398,7 +419,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -488,13 +509,13 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
{
|
||||
if (e.CommandName == "Attach")
|
||||
{
|
||||
string attUrl = this.Grid1.Rows[e.RowIndex].Values[this.Grid1.Columns.Count - 1].ToString();
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
string url = Funs.RootPath + attUrl;
|
||||
FileInfo info = new FileInfo(url);
|
||||
string savedName = Path.GetFileName(url);
|
||||
@@ -507,7 +528,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
if (Path.GetExtension(savedName) == ".mp4" || Path.GetExtension(savedName).ToLower() == ".mp4" || Path.GetExtension(savedName) == ".m4v")
|
||||
{
|
||||
string mpUrl = HttpUtility.UrlEncode(attUrl.Replace('\\', '/'));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/player.aspx?url={0}", attUrl.Replace('\\', '/'), "播放 - "),"播放视频",700,560));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/player.aspx?url={0}", attUrl.Replace('\\', '/'), "播放 - "), "播放视频", 700, 560));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -520,7 +541,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
System.Web.HttpContext.Current.Response.TransmitFile(url, 0, fileSize);
|
||||
System.Web.HttpContext.Current.Response.Flush();
|
||||
System.Web.HttpContext.Current.Response.End();
|
||||
System.Web.HttpContext.Current.Response.End();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
Reference in New Issue
Block a user