コード例 #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 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>";
                }
            }
        }