/// <summary> /// 操作按钮状态初始化 /// </summary> private void InitializeButtons() { bool canAccept = false; //反馈受理 bool canAdmin = false; //反馈管理 bool canHandle = false; //反馈办理 bool canRead = false; //查看 bool canCheck = false; //审核 AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); //模型不为空,并且是用户登陆时验证是否具有权限 if (AdviceTypeID != null && !We7Helper.IsEmptyID(AccountID)) { List <string> contents = AccountHelper.GetPermissionContents(AccountID, AdviceTypeID); canAccept = contents.Contains("Advice.Accept"); canAdmin = contents.Contains("Advice.Admin"); canHandle = contents.Contains("Advice.Handle"); canRead = contents.Contains("Advice.Read"); //canAccept = AccountHelper.HavePermission(AccountID, AdviceTypeID, "Advice.Accept"); //canAdmin = AccountHelper.HavePermission(AccountID, AdviceTypeID, "Advice.Admin"); //canHandle = AccountHelper.HavePermission(AccountID, AdviceTypeID, "Advice.Handle"); //canRead = AccountHelper.HavePermission(AccountID, AdviceTypeID, "Advice.Read"); if (adviceType.FlowSeries > 0) { canCheck = true; } } else { canAccept = canAdmin = canCheck = canHandle = true; } canCheck = canCheck && (ThisAdvice.State == (int)AdviceState.Checking); canHandle = canHandle && (ThisAdvice.State == (int)AdviceState.WaitHandle || ThisAdvice.State == (int)AdviceState.WaitAccept && adviceType.StateText == "直接办理"); canAccept = canAccept && (ThisAdvice.State == (int)AdviceState.WaitAccept); TransactHyperLink.Visible = canHandle && (adviceType.StateText != "上报办理"); //办理 ToOtherHyperLink.Visible = (canHandle || canAccept) && (adviceType.StateText != "直接办理"); //转办 模型类别判断 trToOtherHandleUser.Visible = ToOtherHyperLink.Visible; //是否转办 trHandleRemark.Visible = ToOtherHyperLink.Visible; //转办备注 trPriority.Visible = ToOtherHyperLink.Visible; //邮件优先级 AuditReportHyperLink.Visible = canHandle && (adviceType.StateText == "上报办理"); //上报审核 ReportHyperLink.Visible = canCheck; chbSendEmail.Visible = canCheck; fontSendEmail.Visible = canCheck; ReturnHyperLink.Visible = (canHandle || canCheck) && (adviceType.StateText != "直接办理");//退回重办 办理类别 ReplyContentTextBox.Visible = canHandle || ThisAdvice.State == (int)AdviceState.Checking; AdminHandHyperLink.Visible = (canHandle || canAccept) && (ThisAdvice.State != (int)AdviceState.Finished); switch (adviceType.StateText) { case "转交办理": if (canHandle) { ToAdviceTextBox.Visible = true; toAdviceLabel.Text = "转交备注:"; } break; case "上报办理": switch (ThisAdvice.State) { case (int)AdviceState.Checking: toAdviceLabel.Text = "审核意见:"; ToAdviceTextBox.Visible = true; break; case (int)AdviceState.WaitHandle: toAdviceLabel.Visible = false; ToAdviceTextBox.Visible = false; break; case (int)AdviceState.WaitAccept: toAdviceLabel.Visible = false; ToAdviceTextBox.Visible = false; break; } break; case "直接办理": ToAdviceTextBox.Visible = false; break; default: break; } AdviceReply reply = AdviceReplyHelper.GetAdviceReplyByAdviceID(AdviceID); if (reply != null) { if (reply.Content != null && reply.Content != "") { Account accountModel = AccountHelper.GetAccount(ThisAdvice.ToOtherHandleUserID, new string[] { "LastName", "DepartmentID" }); string departmentAndUser = ""; if (accountModel != null) { Department dp = AccountHelper.GetDepartment(accountModel.DepartmentID, new string[] { "Name" }); if (dp != null && !string.IsNullOrEmpty(dp.Name)) { departmentAndUser = "******" + dp.Name + " - " + accountModel.LastName; } else { departmentAndUser = "******" + accountModel.LastName; } } if (ReplyContentTextBox.Visible) { ReplyContentTextBox.Value = We7Helper.ConvertPageBreakFromCharToVisual(reply.Content); } else { replyDiv.InnerHtml = We7Helper.ConvertPageBreakFromCharToVisual(reply.Content) + departmentAndUser; } } } }
void LoadArticle() { SourceTextBox.Value = GeneralConfigs.GetConfig().ArticleSourceDefault; if (ArticleID != null) { Article a = ThisArticle; TitleTextBox.Value = a.Title; SubTitleTextBox.Value = a.SubTitle; DescriptionTextBox.Value = a.Description; CreatedLabel.Text = a.Created.ToString(); UpdatedTextBox.Value = a.Updated.ToString(); ContentUrlTextBox.Value = a.ContentUrl; CreatorLabel.Text = GetAccountName(a.AccountID); txtInvalidDate.Value = a.Overdue.ToString(); AuthorTextBox.Value = a.Author; IndexTextBox.Value = a.Index.ToString(); SourceTextBox.Value = a.Source; //SourceTextBox.Disabled = true; if (a.KeyWord != null) { KeywordTextBox.Value = a.KeyWord.ToString(); } if (a.DescriptionKey != null) { DescriptionKeyTextBox.Value = a.DescriptionKey.ToString(); } SetDropdownList(StateDropDownList, a.State.ToString()); EnumLibrary.HomeRecommend type = (EnumLibrary.HomeRecommend)StateMgr.GetStateValueEnum(a.EnumState, EnumLibrary.Business.HomeRecommend); if (type == EnumLibrary.HomeRecommend.RecommendArticle) { IsShowCheckBox.Checked = true; } //IsShowCheckBox.Checked = (a.IsShow == 1) ? true : false; if (a.ContentType.ToString() != "") { ActicleTypeDropDownList.SelectedValue = a.ContentType.ToString(); } if ((TypeOfArticle)a.ContentType == TypeOfArticle.LinkArticle) { BodyDiv.Visible = false; linkSpan.Attributes["style"] = ""; } chkBold.Checked = !String.IsNullOrEmpty(a.FontWeight); chkItalic.Checked = !String.IsNullOrEmpty(a.FontStyle); ddlColor.SelectedValue = a.Color; //TODO:thj add it to get the state of AllowCommentsCheckBox if (a.AllowComments == 1) { AllowCommentsCheckBox.Checked = true; } else { AllowCommentsCheckBox.Checked = false; } if (a.Content != null && a.Content != "") { ContentTextBox.Value = We7Helper.ConvertPageBreakFromCharToVisual(a.Content); } if (!string.IsNullOrEmpty(a.ParentID) && !We7Helper.IsEmptyID(a.ParentID)) { Article pa = ArticleHelper.GetArticle(a.ParentID); if (pa != null) { ParentArticleTitle.Text = pa.Title; ParentArticleID.Value = pa.ID; } ParentArticleDiv.Visible = true; } } }