예제 #1
0
        public static void Log(int siteId, int channelId, int contentID, string logType, string administratorName, int departmentId)
        {
            var logInfo = new LogInfo(0, siteId, channelId, contentID, departmentId, administratorName, logType, Utils.GetIpAddress(), DateTime.Now, string.Empty);

            var departmentName = DepartmentManager.GetDepartmentName(departmentId);

            ELogType eLogType = ELogTypeUtils.GetEnumType(logType);

            if (eLogType == ELogType.Accept)
            {
                logInfo.Summary = $"{departmentName}({administratorName})受理办件";
            }
            else if (eLogType == ELogType.Deny)
            {
                logInfo.Summary = $"{departmentName}({administratorName})拒绝受理办件";
            }
            else if (eLogType == ELogType.Reply)
            {
                logInfo.Summary = $"{departmentName}({administratorName})回复办件";
            }
            else if (eLogType == ELogType.Comment)
            {
                logInfo.Summary = $"{departmentName}({administratorName})批示办件";
            }
            else if (eLogType == ELogType.Redo)
            {
                logInfo.Summary = $"{departmentName}({administratorName})要求返工";
            }
            else if (eLogType == ELogType.Check)
            {
                logInfo.Summary = $"{departmentName}({administratorName})审核通过";
            }
            LogDao.Insert(logInfo);
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
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);
            }
        }
예제 #5
0
        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);
            }
        }
예제 #6
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);
            }
        }
예제 #7
0
        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);
            }
        }
예제 #8
0
        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);
            }
        }
예제 #9
0
        public void Page_Load(object sender, EventArgs e)
        {
            _contentId = Utils.ToInt(Request.QueryString["contentId"]);

            if (IsPostBack)
            {
                return;
            }

            if (_contentId > 0)
            {
                var logInfoList = LogDao.GetLogInfoList(SiteId, _contentId);
                var builder     = new StringBuilder();

                var count = logInfoList.Count;
                var i     = 1;
                foreach (var logInfo in logInfoList)
                {
                    if (logInfo.DepartmentId > 0)
                    {
                        builder.Append(
                            $@"<tr class=""info""><td class=""text-center""> {DepartmentManager.GetDepartmentName(
                                logInfo.DepartmentId)} {ELogTypeUtils.GetText(ELogTypeUtils.GetEnumType(logInfo.LogType))}<br />{Utils
                                .GetDateAndTimeString(logInfo.AddDate)} </td></tr>");
                    }
                    else
                    {
                        builder.Append(
                            $@"<tr class=""info""><td class=""text-center""> {ELogTypeUtils.GetText(
                                ELogTypeUtils.GetEnumType(logInfo.LogType))}<br />{Utils.GetDateAndTimeString(logInfo.AddDate)} </td></tr>");
                    }
                    if (i++ < count)
                    {
                        builder.Append(@"<tr><td class=""text-center""><img src=""assets/images/flow.gif"" /></td></tr>");
                    }
                }

                LtlFlows.Text = builder.ToString();

                if (string.IsNullOrEmpty(LtlFlows.Text))
                {
                    LtlFlows.Text = @"<h3 style=""margin-top: 20px;text-align: center;"">暂无</h3>";
                }
            }
        }
예제 #10
0
        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);
            }
        }
예제 #11
0
        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);
            }
        }
예제 #12
0
        public static void LogTranslate(int siteId, int channelId, int contentID, string nodeName, string administratorName, int departmentId)
        {
            var logInfo = new LogInfo(0, siteId, channelId, contentID, departmentId, administratorName, ELogTypeUtils.GetValue(ELogType.Translate), Utils.GetIpAddress(), DateTime.Now,
                                      $"{DepartmentManager.GetDepartmentName(departmentId)}({administratorName})从分类“{nodeName}”转移办件至此 ");

            LogDao.Insert(logInfo);
        }
예제 #13
0
        public static void LogSwitchTo(int siteId, int channelId, int contentID, string switchToDepartmentName, string administratorName, int departmentId)
        {
            var logInfo = new LogInfo(0, siteId, channelId, contentID, departmentId, administratorName, ELogTypeUtils.GetValue(ELogType.SwitchTo), Utils.GetIpAddress(), DateTime.Now,
                                      $"{DepartmentManager.GetDepartmentName(departmentId)}({administratorName})转办办件至{switchToDepartmentName} ");

            LogDao.Insert(logInfo);
        }
예제 #14
0
        public static void LogNew(int siteId, int channelId, int contentID, string realName, string toDepartmentName)
        {
            var logInfo = new LogInfo(0, siteId, channelId, contentID, 0, string.Empty, ELogTypeUtils.GetValue(ELogType.New), Utils.GetIpAddress(), DateTime.Now,
                                      $"前台{realName}提交办件{toDepartmentName}");

            LogDao.Insert(logInfo);
        }