集成人员同步,专项检查同步
This commit is contained in:
@@ -0,0 +1,193 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Check
|
||||
{
|
||||
public partial class CheckSpecialProView : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string CheckSpecialId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["CheckSpecialId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["CheckSpecialId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义集合
|
||||
/// </summary>
|
||||
private static List<Model.View_CheckSpecialProDetail> checkSpecialDetails = new List<Model.View_CheckSpecialProDetail>();
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
hdAttachUrl.Text = string.Empty;
|
||||
hdId.Text = string.Empty;
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
checkSpecialDetails.Clear();
|
||||
|
||||
this.CheckSpecialId = Request.Params["CheckSpecialId"];
|
||||
var checkSpecial = BLL.Check_CheckSpecialProService.GetCheckSpecialByCheckSpecialId(this.CheckSpecialId);
|
||||
if (checkSpecial != null)
|
||||
{
|
||||
this.txtCheckSpecialCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.CheckSpecialId);
|
||||
if (checkSpecial.CheckTime != null)
|
||||
{
|
||||
this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkSpecial.CheckTime);
|
||||
}
|
||||
if (!String.IsNullOrEmpty(checkSpecial.CheckType))
|
||||
{
|
||||
this.rbType.SelectedValue = checkSpecial.CheckType;
|
||||
}
|
||||
this.txtPartInPersonNames.Text = checkSpecial.PartInPersonNames;
|
||||
if (!string.IsNullOrEmpty(checkSpecial.CheckItemSetId))
|
||||
{
|
||||
var getCheckItem = Funs.DB.Technique_CheckItemSet.FirstOrDefault(x => x.CheckItemSetId == checkSpecial.CheckItemSetId);
|
||||
this.txtSupCheckItemSet.Text = getCheckItem.CheckItemName;
|
||||
}
|
||||
//this.txtSupCheckItemSet.Text = Technique_CheckItemSetService.GetCheckItemSetNameById(checkSpecial.CheckItemSetId);
|
||||
this.txtPartInPersons.Text = checkSpecial.PartInPersons;
|
||||
checkSpecialDetails = (from x in Funs.DB.View_CheckSpecialProDetail
|
||||
where x.CheckSpecialId == this.CheckSpecialId
|
||||
orderby x.UnitName, x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
Grid1.DataSource = checkSpecialDetails;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 附件上传
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.CheckSpecialId))
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&type=-1", this.CheckSpecialId, BLL.Const.ProjectCheckSpecialMenuId)));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
string checkSpecialDetailId = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
if (e.CommandName == "click")
|
||||
{
|
||||
var detail = Check_CheckSpecialProDetailService.GetCheckSpecialDetailByCheckSpecialDetailId(Grid1.DataKeys[e.RowIndex][0].ToString());
|
||||
if (detail != null)
|
||||
{
|
||||
List<string> getList = Funs.GetStrListByStr(detail.DataId, '|');
|
||||
foreach (var item in getList)
|
||||
{
|
||||
List<string> getItemList = Funs.GetStrListByStr(item, ',');
|
||||
if (getItemList.Count() > 1)
|
||||
{
|
||||
if (getItemList[0].ToString() == "1")
|
||||
{
|
||||
var getRe = RectifyNoticesService.GetRectifyNoticesById(getItemList[1].ToString());
|
||||
if (getRe != null)
|
||||
{
|
||||
if (getRe.CompleteManId == this.CurrUser.UserId && (string.IsNullOrEmpty(getRe.States) || getRe.States == Const.State_0))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RectifyNoticesAdd.aspx?RectifyNoticesId={0}", getRe.RectifyNoticesId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RectifyNoticesView.aspx?RectifyNoticesId={0}", getRe.RectifyNoticesId, "查看 - ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getItemList[0].ToString() == "2")
|
||||
{
|
||||
var getpu = PunishNoticeService.GetPunishNoticeById(getItemList[1].ToString());
|
||||
if (getpu.CompileMan == this.CurrUser.UserId && (string.IsNullOrEmpty(getpu.PunishStates) || getpu.PunishStates == Const.State_0))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PunishNoticeEdit.aspx?PunishNoticeId={0}", getpu.PunishNoticeId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PunishNoticeView.aspx?PunishNoticeId={0}", getpu.PunishNoticeId, "查看 - ")));
|
||||
}
|
||||
}
|
||||
if (getItemList[0].ToString() == "3")
|
||||
{
|
||||
var getpau = Check_PauseNoticeService.GetPauseNoticeByPauseNoticeId(getItemList[1].ToString());
|
||||
if (getpau.CompileManId == this.CurrUser.UserId && (string.IsNullOrEmpty(getpau.PauseStates) || getpau.PauseStates == Const.State_0))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PauseNoticeEdit.aspx?PauseNoticeId={0}", getpau.PauseNoticeId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PauseNoticeView.aspx?PauseNoticeId={0}", getpau.PauseNoticeId, "查看 - ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.CommandName == "attchUrl")
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&edit=1&type=-1", checkSpecialDetailId, BLL.Const.ProjectCheckSpecialMenuId)));
|
||||
}
|
||||
}
|
||||
|
||||
protected string ConvertImageUrlByImage(object CheckSpecialDetailId)
|
||||
{
|
||||
string url = string.Empty;
|
||||
string httpUrl = string.Empty;
|
||||
var sysSet6 = (from x in Funs.DB.Sys_Set where x.SetName == "程序访问地址" select x).ToList().FirstOrDefault();
|
||||
if (sysSet6 != null)
|
||||
{
|
||||
httpUrl = sysSet6.SetValue;
|
||||
}
|
||||
if (CheckSpecialDetailId != null)
|
||||
{
|
||||
var imhurl = BLL.AttachFileService.getFileUrl(CheckSpecialDetailId.ToString());
|
||||
if (imhurl != null)
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowImage(httpUrl, imhurl);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
var details = (from x in Funs.DB.View_CheckSpecialProDetail
|
||||
where x.CheckSpecialId == this.CheckSpecialId
|
||||
select x).ToList();
|
||||
Grid1.DataSource = details;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user