Example #1
0
        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);
            }
        }
Example #2
0
        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 Reply_OnClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TbReply.Text))
            {
                LtlMessage.Text = Utils.GetMessageHtml("回复失败,必须填写答复内容", false);
                return;
            }
            try
            {
                ReplyDao.DeleteByContentId(SiteId, _contentInfo.Id);
                var fileUrl   = UploadFile(HifFileUrl.PostedFile);
                var replyInfo = new ReplyInfo(0, SiteId, _contentInfo.ChannelId, _contentInfo.Id, TbReply.Text, fileUrl, _adminInfo.DepartmentId, AuthRequest.AdminName, DateTime.Now);
                ReplyDao.Insert(replyInfo);

                ApplyManager.Log(SiteId, _contentInfo.ChannelId, _contentInfo.Id, ELogTypeUtils.GetValue(ELogType.Reply), AuthRequest.AdminName, _adminInfo.DepartmentId);
                if (_adminInfo.DepartmentId > 0)
                {
                    ContentDao.UpdateDepartmentId(SiteId, _contentInfo.ChannelId, _contentInfo.Id, _adminInfo.DepartmentId);
                }
                ContentDao.UpdateState(SiteId, _contentInfo.ChannelId, _contentInfo.Id, EState.Replied);

                LtlMessage.Text = Utils.GetMessageHtml("办件回复成功", true);

                if (!ConfigInfo.ApplyIsOpenWindow)
                {
                    Utils.SwalSuccess("办件回复成功", "", "确 认", $"location.href = '{ListPageUrl}'");
                }
            }
            catch (Exception ex)
            {
                LtlMessage.Text = Utils.GetMessageHtml(ex.Message, false);
            }
        }