public void Submit_OnClick(object sender, EventArgs e) { var isChanged = false; try { if (string.IsNullOrEmpty(tbCommentRemark.Text)) { LtlMessage.Text = Utils.GetMessageHtml("批示失败,必须填写意见!", false); return; } foreach (int contentID in _idArrayList) { var remarkInfo = new RemarkInfo(0, SiteId, _channelId, contentID, ERemarkTypeUtils.GetValue(ERemarkType.Comment), tbCommentRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); ApplyManager.Log(SiteId, _channelId, contentID, ELogTypeUtils.GetValue(ELogType.Comment), AuthRequest.AdminName, _adminInfo.DepartmentId); } isChanged = true; } catch (Exception ex) { LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false); isChanged = false; } if (isChanged) { LayerUtils.Close(Page); } }
public void Redo_OnClick(object sender, EventArgs e) { if (string.IsNullOrEmpty(TbRedoRemark.Text)) { LtlMessage.Text = Utils.GetMessageHtml("要求返工失败,必须填写意见!", false); return; } try { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, _channelId, _contentId); var remarkInfo = new RemarkInfo(0, SiteId, contentInfo.ChannelId, contentInfo.Id, ERemarkTypeUtils.GetValue(ERemarkType.Redo), TbRedoRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); ApplyManager.Log(SiteId, contentInfo.ChannelId, contentInfo.Id, ELogTypeUtils.GetValue(ELogType.Redo), AuthRequest.AdminName, _adminInfo.DepartmentId); contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Redo)); Main.ContentApi.Update(SiteId, contentInfo.ChannelId, contentInfo); LtlMessage.Text = Utils.GetMessageHtml("要求返工成功", true); var configInfo = Main.GetConfigInfo(SiteId); if (!configInfo.ApplyIsOpenWindow) { Utils.Redirect(_returnUrl); } } catch (Exception ex) { LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false); } }
public void Comment_OnClick(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(TbCommentRemark.Text)) { LtlMessage.Text = Utils.GetMessageHtml("批示失败,必须填写意见", false); return; } var remarkInfo = new RemarkInfo(0, SiteId, _contentInfo.ChannelId, _contentInfo.Id, ERemarkTypeUtils.GetValue(ERemarkType.Comment), TbCommentRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); ApplyManager.Log(SiteId, _contentInfo.ChannelId, _contentInfo.Id, ELogTypeUtils.GetValue(ELogType.Comment), AuthRequest.AdminName, _adminInfo.DepartmentId); LtlMessage.Text = Utils.GetMessageHtml("办件批示成功", true); if (!ConfigInfo.ApplyIsOpenWindow) { Utils.SwalSuccess("办件批示成功", "", "确 认", $"location.href = '{ListPageUrl}'"); } } catch (Exception ex) { LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false); } }
public void Translate_OnClick(object sender, EventArgs e) { var translateChannelId = Utils.ToInt(DdlTranslateChannelId.SelectedValue); if (translateChannelId == 0) { LtlMessage.Text = Utils.GetMessageHtml("转移失败,必须选择转移目标", false); return; } try { _contentInfo.Set(ContentAttribute.TranslateFromChannelId, _contentInfo.ChannelId.ToString()); _contentInfo.ChannelId = translateChannelId; Main.ContentApi.Update(SiteId, _contentInfo.ChannelId, _contentInfo); if (!string.IsNullOrEmpty(TbTranslateRemark.Text)) { var remarkInfo = new RemarkInfo(0, SiteId, _contentInfo.ChannelId, _contentInfo.Id, ERemarkTypeUtils.GetValue(ERemarkType.Translate), TbTranslateRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); } ApplyManager.LogTranslate(SiteId, _contentInfo.ChannelId, _contentInfo.Id, Main.ChannelApi.GetChannelName(SiteId, _contentInfo.ChannelId), AuthRequest.AdminName, _adminInfo.DepartmentId); LtlMessage.Text = Utils.GetMessageHtml("办件转移成功", true); if (!ConfigInfo.ApplyIsOpenWindow) { Utils.SwalSuccess("办件转移成功", "", "确 认", $"location.href = '{ListPageUrl}'"); } } catch (Exception ex) { LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false); } }
public void SwitchTo_OnClick(object sender, EventArgs e) { var switchToDepartmentId = Utils.ToInt(Request.Form["switchToDepartmentId"]); if (switchToDepartmentId == 0) { LtlMessage.Text = Utils.GetMessageHtml("转办失败,必须选择转办部门", false); return; } var switchToDepartmentName = DepartmentManager.GetDepartmentName(switchToDepartmentId); try { ContentDao.UpdateDepartmentId(SiteId, _contentInfo.ChannelId, _contentInfo.Id, switchToDepartmentId); var remarkInfo = new RemarkInfo(0, SiteId, _contentInfo.ChannelId, _contentInfo.Id, ERemarkTypeUtils.GetValue(ERemarkType.SwitchTo), TbSwitchToRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); ApplyManager.LogSwitchTo(SiteId, _contentInfo.ChannelId, _contentInfo.Id, switchToDepartmentName, AuthRequest.AdminName, _adminInfo.DepartmentId); LtlMessage.Text = Utils.GetMessageHtml("办件转办成功", true); if (!ConfigInfo.ApplyIsOpenWindow) { Utils.SwalSuccess("办件转办成功", "", "确 认", $"location.href = '{ListPageUrl}'"); } } catch (Exception ex) { LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false); } }
public void Submit_OnClick(object sender, EventArgs e) { var isChanged = false; try { var switchToDepartmentID = Utils.ToInt(Request.Form["switchToDepartmentID"]); if (switchToDepartmentID == 0) { LtlMessage.Text = Utils.GetMessageHtml("转办失败,必须选择转办部门!", false); return; } var switchToDepartmentName = DepartmentManager.GetDepartmentName(switchToDepartmentID); foreach (int contentID in _idArrayList) { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, _channelId, contentID); var state = EStateUtils.GetEnumType(contentInfo.GetString(ContentAttribute.State)); if (state != EState.Denied && state != EState.Checked) { contentInfo.Set(ContentAttribute.DepartmentId, switchToDepartmentID.ToString()); Main.ContentApi.Update(SiteId, contentInfo.ChannelId, contentInfo); if (!string.IsNullOrEmpty(tbSwitchToRemark.Text)) { var remarkInfo = new RemarkInfo(0, SiteId, contentInfo.ChannelId, contentID, ERemarkTypeUtils.GetValue(ERemarkType.SwitchTo), tbSwitchToRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); } ApplyManager.LogSwitchTo(SiteId, contentInfo.ChannelId, contentID, switchToDepartmentName, AuthRequest.AdminName, _adminInfo.DepartmentId); } } isChanged = true; } catch (Exception ex) { LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false); isChanged = false; } if (isChanged) { LayerUtils.Close(Page); } }
public void Submit_OnClick(object sender, EventArgs e) { var isChanged = false; try { var translateNodeID = Utils.ToInt(ddlNodeID.SelectedValue); if (translateNodeID == 0) { LtlMessage.Text = Utils.GetMessageHtml("转移失败,必须选择转移目标!", false); return; } var chananelInfo = Main.ChannelApi.GetChannelInfo(SiteId, _channelId); foreach (int contentID in _idArrayList) { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, _channelId, contentID); contentInfo.Set(ContentAttribute.TranslateFromChannelId, contentInfo.ChannelId.ToString()); contentInfo.ChannelId = translateNodeID; Main.ContentApi.Update(SiteId, contentInfo.ChannelId, contentInfo); if (!string.IsNullOrEmpty(tbTranslateRemark.Text)) { var remarkInfo = new RemarkInfo(0, SiteId, contentInfo.ChannelId, contentID, ERemarkTypeUtils.GetValue(ERemarkType.Translate), tbTranslateRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); } ApplyManager.LogTranslate(SiteId, contentInfo.ChannelId, contentID, chananelInfo.ChannelName, AuthRequest.AdminName, _adminInfo.DepartmentId); } isChanged = true; } catch (Exception ex) { LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false); isChanged = false; } if (isChanged) { LayerUtils.Close(Page); } }
public static string GetApplyRemark(int siteId, int contentID) { var remarkBuilder = new StringBuilder(); var remarkInfoArrayList = RemarkDao.GetRemarkInfoArrayList(siteId, contentID); foreach (RemarkInfo remarkInfo in remarkInfoArrayList) { if (!string.IsNullOrEmpty(remarkInfo.Remark)) { if (remarkBuilder.Length > 0) { remarkBuilder.Append("<br />"); } remarkBuilder.Append( $@"<span style=""color:gray;"">{ERemarkTypeUtils.GetText(ERemarkTypeUtils.GetEnumType(remarkInfo.RemarkType))}意见: </span>{Utils .MaxLengthText(remarkInfo.Remark, 25)}"); } } return(remarkBuilder.ToString()); }
public void Submit_OnClick(object sender, EventArgs e) { var isChanged = false; try { if (string.IsNullOrEmpty(tbRedoRemark.Text)) { LtlMessage.Text = Utils.GetMessageHtml("要求返工失败,必须填写意见!", false); return; } foreach (int contentID in _idArrayList) { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, _channelId, contentID); var state = EStateUtils.GetEnumType(contentInfo.GetString(ContentAttribute.State)); if (state == EState.Replied || state == EState.Redo) { var remarkInfo = new RemarkInfo(0, SiteId, contentInfo.ChannelId, contentInfo.Id, ERemarkTypeUtils.GetValue(ERemarkType.Redo), tbRedoRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); ApplyManager.Log(SiteId, contentInfo.ChannelId, contentID, ELogTypeUtils.GetValue(ELogType.Redo), AuthRequest.AdminName, _adminInfo.DepartmentId); contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Redo)); Main.ContentApi.Update(SiteId, contentInfo.ChannelId, contentInfo); } } isChanged = true; } catch (Exception ex) { LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false); isChanged = false; } if (isChanged) { LayerUtils.Close(Page); } }
public void Accept_OnClick(object sender, EventArgs e) { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, _channelId, _contentId); var remarkInfo = new RemarkInfo(0, SiteId, contentInfo.ChannelId, contentInfo.Id, ERemarkTypeUtils.GetValue(ERemarkType.Accept), TbAcceptRemark.Text, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); RemarkDao.Insert(remarkInfo); ApplyManager.Log(SiteId, contentInfo.ChannelId, contentInfo.Id, ELogTypeUtils.GetValue(ELogType.Accept), AuthRequest.AdminName, _adminInfo.DepartmentId); contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Accepted)); Main.ContentApi.Update(SiteId, contentInfo.ChannelId, contentInfo); LtlMessage.Text = Utils.GetMessageHtml("申请受理成功", true); var configInfo = Main.GetConfigInfo(SiteId); if (!configInfo.ApplyIsOpenWindow) { Utils.Redirect(_returnUrl); } }
protected override void OnInit(EventArgs e) { base.OnInit(e); var channelId = AuthRequest.GetQueryInt("channelId"); var contentId = AuthRequest.GetQueryInt("contentId"); _returnUrl = AuthRequest.GetQueryString("returnUrl"); _contentInfo = Main.ContentApi.GetContentInfo(SiteId, channelId, contentId); _adminInfo = Main.AdminApi.GetAdminInfoByUserId(AuthRequest.AdminId); var state = EStateUtils.GetEnumType(_contentInfo.GetString(ContentAttribute.State)); if (IsPostBack) { return; } if (PhBtnAccept != null) { PhBtnAccept.Visible = InteractManager.IsPermission(SiteId, _contentInfo.ChannelId, Permissions.Accept); } if (PhBtnSwitchToTranslate != null) { PhBtnSwitchToTranslate.Visible = InteractManager.IsPermission(SiteId, _contentInfo.ChannelId, Permissions.SwitchToTranslate); } if (PhBtnReply != null) { PhBtnReply.Visible = InteractManager.IsPermission(SiteId, _contentInfo.ChannelId, Permissions.Reply); } if (PhBtnCheck != null) { PhBtnCheck.Visible = state != EState.Checked && InteractManager.IsPermission(SiteId, _contentInfo.ChannelId, Permissions.Check); } if (PhBtnComment != null) { PhBtnComment.Visible = state != EState.Checked && InteractManager.IsPermission(SiteId, _contentInfo.ChannelId, Permissions.Comment); } if (PhBtnReturn != null) { PhBtnReturn.Visible = !ConfigInfo.ApplyIsOpenWindow; } var tableColumns = Main.ContentApi.GetTableColumns(SiteId, _contentInfo.ChannelId); var isSingle = true; var builder = new StringBuilder(); foreach (var tableColumn in tableColumns) { if (tableColumn.InputStyle == null || Utils.EqualsIgnoreCase(tableColumn.AttributeName, nameof(IContentInfo.Title)) || Utils.EqualsIgnoreCase(tableColumn.AttributeName, nameof(IContentInfo.IsHot)) || Utils.EqualsIgnoreCase(tableColumn.AttributeName, nameof(IContentInfo.IsColor)) || Utils.EqualsIgnoreCase(tableColumn.AttributeName, nameof(IContentInfo.IsRecommend)) || Utils.EqualsIgnoreCase(tableColumn.AttributeName, nameof(IContentInfo.IsTop)) || Utils.EqualsIgnoreCase(tableColumn.AttributeName, ContentAttribute.DepartmentId) || Utils.EqualsIgnoreCase(tableColumn.AttributeName, ContentAttribute.Content)) { continue; } var value = _contentInfo.GetString(tableColumn.AttributeName); if (Utils.EqualsIgnoreCase(tableColumn.AttributeName, ContentAttribute.TypeId)) { value = InteractManager.GetTypeName(Utils.ToInt(value)); } else if (Utils.EqualsIgnoreCase(tableColumn.AttributeName, ContentAttribute.IsPublic)) { value = Utils.ToBool(value) ? "公开" : "不公开"; } else if (Utils.EqualsIgnoreCase(tableColumn.AttributeName, ContentAttribute.FileUrl)) { if (!string.IsNullOrEmpty(value)) { value = $@"<a href=""{value}"" target=""_blank"">{value}</a>"; } } else if (Utils.EqualsIgnoreCase(tableColumn.AttributeName, ContentAttribute.State)) { value = EStateUtils.GetText(state); } if (isSingle) { builder.Append("<tr>"); } builder.Append( $@"<th>{tableColumn.InputStyle.DisplayName}</th><td>{value}</td>"); if (!isSingle) { builder.Append("</tr>"); } isSingle = !isSingle; } if (!isSingle) { builder.Append("</tr>"); } LtlTitle.Text = _contentInfo.Title; LtlApplyAttributes.Text = builder.ToString(); LtlContent.Text = _contentInfo.GetString(ContentAttribute.Content); if (PhReply != null) { if (state == EState.Denied || state == EState.Replied || state == EState.Redo || state == EState.Checked) { var replyInfo = ReplyDao.GetReplyInfoByContentId(SiteId, _contentInfo.Id); if (replyInfo != null) { PhReply.Visible = true; LtlDepartmentAndUserName.Text = $"{DepartmentManager.GetDepartmentName(replyInfo.DepartmentId)}({replyInfo.UserName})"; LtlReplyAddDate.Text = Utils.GetDateAndTimeString(replyInfo.AddDate); LtlReply.Text = replyInfo.Reply; if (!string.IsNullOrEmpty(replyInfo.FileUrl)) { LtlReplyFileUrl.Text = $@"<a href=""{replyInfo.FileUrl}"" target=""_blank"">{replyInfo.FileUrl}</a>"; } } } } if (BtnSwitchTo != null) { var departmentId = _contentInfo.GetInt(ContentAttribute.DepartmentId); BtnSwitchTo.Attributes.Add("onclick", ModalDepartmentSelectSingle.GetOpenWindowString(SiteId, _contentInfo.ChannelId)); var scriptBuilder = new StringBuilder(); if (departmentId > 0) { var departmentName = DepartmentManager.GetDepartmentName(departmentId); scriptBuilder.Append( $@"<script>departmentSelect('{departmentName}', {departmentId});</script>"); } LtlScript.Text = scriptBuilder.ToString(); } if (DdlTranslateChannelId != null) { var nodeInfoList = InteractManager.GetInteractChannelInfoList(SiteId); foreach (var nodeInfo in nodeInfoList) { if (nodeInfo.Id != _contentInfo.ChannelId) { var listItem = new ListItem(nodeInfo.ChannelName, nodeInfo.Id.ToString()); DdlTranslateChannelId.Items.Add(listItem); } } } RptRemarks.DataSource = RemarkDao.GetDataSourceByContentId(SiteId, _contentInfo.Id); RptRemarks.ItemDataBound += RptRemarks_ItemDataBound; RptRemarks.DataBind(); if (RptLogs != null) { RptLogs.DataSource = LogDao.GetDataSourceByContentId(SiteId, _contentInfo.Id); RptLogs.ItemDataBound += RptLogs_ItemDataBound; RptLogs.DataBind(); } }