public void Check_OnClick(object sender, EventArgs e) { try { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, _channelId, _contentId); ApplyManager.Log(SiteId, contentInfo.ChannelId, contentInfo.Id, ELogTypeUtils.GetValue(ELogType.Check), AuthRequest.AdminName, _adminInfo.DepartmentId); contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Checked)); 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 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 Submit_OnClick(object sender, EventArgs e) { var isChanged = false; ReplyDao.DeleteByContentId(SiteId, _contentInfo.Id); var fileUrl = UploadFile(HtmlFileUrl.PostedFile); var replyInfo = new ReplyInfo(0, SiteId, _contentInfo.ChannelId, _contentInfo.Id, TbReply.Text, string.Empty, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); ReplyDao.Insert(replyInfo); ApplyManager.Log(SiteId, _contentInfo.ChannelId, _contentInfo.Id, ELogTypeUtils.GetValue(ELogType.Reply), AuthRequest.AdminName, _adminInfo.DepartmentId); _contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Replied)); _contentInfo.Set(ContentAttribute.ReplyContent, replyInfo.Reply); _contentInfo.Set(ContentAttribute.ReplyFileUrl, replyInfo.FileUrl); if (_adminInfo.DepartmentId > 0) { _contentInfo.Set(ContentAttribute.DepartmentId, _adminInfo.DepartmentId.ToString()); _contentInfo.Set(ContentAttribute.ReplyDepartmentName, DepartmentManager.GetDepartmentName(_adminInfo.DepartmentId)); } _contentInfo.Set(ContentAttribute.ReplyUserName, _adminInfo.DisplayName); _contentInfo.Set(ContentAttribute.ReplyAddDate, replyInfo.AddDate); Main.ContentApi.Update(SiteId, _contentInfo.ChannelId, _contentInfo); isChanged = true; if (isChanged) { LayerUtils.Close(Page); } }
public void Deny_OnClick(object sender, EventArgs e) { if (string.IsNullOrEmpty(TbDenyReply.Text)) { LtlMessage.Text = Utils.GetMessageHtml("拒绝失败,必须填写拒绝理由", false); return; } var contentInfo = Main.ContentApi.GetContentInfo(SiteId, _channelId, _contentId); ReplyDao.DeleteByContentId(SiteId, contentInfo.Id); var replyInfo = new ReplyInfo(0, SiteId, contentInfo.ChannelId, contentInfo.Id, TbDenyReply.Text, string.Empty, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now); ReplyDao.Insert(replyInfo); ApplyManager.Log(SiteId, contentInfo.ChannelId, contentInfo.Id, ELogTypeUtils.GetValue(ELogType.Deny), AuthRequest.AdminName, _adminInfo.DepartmentId); contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Denied)); Main.ContentApi.Update(SiteId, contentInfo.ChannelId, contentInfo); LtlMessage.Text = Utils.GetMessageHtml("拒绝申请成功", true); var configInfo = Main.GetConfigInfo(SiteId); if (!configInfo.ApplyIsOpenWindow) { Utils.Redirect(_returnUrl); } }
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); ChannelId = Utils.ToInt(Request.QueryString["channelId"]); _isPermissionReply = InteractManager.IsPermission(SiteId, ChannelId, Permissions.Reply); _isPermissionEdit = InteractManager.IsPermission(SiteId, ChannelId, Permissions.Edit); if (!string.IsNullOrEmpty(Request.QueryString["delete"])) { var list = Utils.StringCollectionToIntList(Request.QueryString["IDCollection"]); if (list.Count > 0) { foreach (var contentId in list) { Main.ContentApi.Delete(SiteId, ChannelId, contentId); } LtlScript.Text = AlertUtils.Success("删除成功!", ""); } } else if (!string.IsNullOrEmpty(Request.QueryString["accept"])) { var list = Utils.StringCollectionToIntList(Request.QueryString["IDCollection"]); foreach (var contentId in list) { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, ChannelId, contentId); var state = EStateUtils.GetEnumType(contentInfo.GetString(ContentAttribute.State)); if (state == EState.New || state == EState.Denied) { contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Accepted)); Main.ContentApi.Update(SiteId, ChannelId, contentInfo); } } LtlScript.Text = AlertUtils.Success("受理申请成功!", ""); } else if (!string.IsNullOrEmpty(Request.QueryString["deny"])) { var list = Utils.StringCollectionToIntList(Request.QueryString["IDCollection"]); foreach (var contentId in list) { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, ChannelId, contentId); var state = EStateUtils.GetEnumType(contentInfo.GetString(ContentAttribute.State)); if (state == EState.New || state == EState.Accepted) { contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Denied)); Main.ContentApi.Update(SiteId, ChannelId, contentInfo); } } LtlScript.Text = AlertUtils.Success("拒绝受理申请成功!", ""); } else if (!string.IsNullOrEmpty(Request.QueryString["check"])) { var list = Utils.StringCollectionToIntList(Request.QueryString["IDCollection"]); foreach (var contentId in list) { var contentInfo = Main.ContentApi.GetContentInfo(SiteId, ChannelId, contentId); var state = EStateUtils.GetEnumType(contentInfo.GetString(ContentAttribute.State)); if (state == EState.Replied) { contentInfo.Set(ContentAttribute.State, EStateUtils.GetValue(EState.Checked)); Main.ContentApi.Update(SiteId, ChannelId, contentInfo); } } LtlScript.Text = AlertUtils.Success("审核申请成功!", ""); } SpContents.ControlToPaginate = RptContents; SpContents.ItemsPerPage = 25; SpContents.SelectCommand = GetSelectString(); SpContents.SortField = nameof(IContentInfo.Taxis); SpContents.SortMode = "DESC"; RptContents.ItemDataBound += RptContents_ItemDataBound; if (!IsPostBack) { SpContents.DataBind(); LtlTotalCount.Text = SpContents.TotalCount.ToString(); if (PhAccept != null) { PhAccept.Visible = InteractManager.IsPermission(SiteId, ChannelId, Permissions.Accept); HlAccept?.Attributes.Add("onclick", Utils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Accept=True", "IDCollection", "IDCollection", "请选择需要受理的申请!", "此操作将受理所选申请,确定吗?")); HlDeny?.Attributes.Add("onclick", Utils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Deny=True", "IDCollection", "IDCollection", "请选择需要拒绝的申请!", "此操作将拒绝受理所选申请,确定吗?")); } if (PhCheck != null) { PhCheck.Visible = InteractManager.IsPermission(SiteId, ChannelId, Permissions.Check); HlCheck?.Attributes.Add("onclick", Utils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Check=True", "IDCollection", "IDCollection", "请选择需要审核的申请!", "此操作将审核所选申请,确定吗?")); HlRedo?.Attributes.Add("onclick", ModalApplyRedo.GetOpenWindowString(SiteId, ChannelId)); } if (PhSwitchToTranslate != null) { PhSwitchToTranslate.Visible = InteractManager.IsPermission(SiteId, ChannelId, Permissions.SwitchToTranslate); HlSwitchTo?.Attributes.Add("onclick", ModalApplySwitchTo.GetOpenWindowString(SiteId, ChannelId)); HlTranslate?.Attributes.Add("onclick", ModalApplyTranslate.GetOpenWindowString(SiteId, ChannelId)); } if (PhComment != null) { PhComment.Visible = InteractManager.IsPermission(SiteId, ChannelId, Permissions.Comment); HlComment.Attributes.Add("onclick", ModalApplyComment.GetOpenWindowString(SiteId, ChannelId)); } if (PhDelete != null) { PhDelete.Visible = InteractManager.IsPermission(SiteId, ChannelId, Permissions.Delete) && ConfigInfo.ApplyIsDeleteAllowed; HlDelete.Attributes.Add("onclick", Utils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Delete=True", "IDCollection", "IDCollection", "请选择需要删除的申请!", "此操作将删除所选申请,确定吗?")); } //hlExport?.Attributes.Add("onclick", ModalContentExport.GetOpenWindowString(SiteId, _channelId)); } }