/// <summary> /// 转办 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ToOtherButton_Click(object sender, EventArgs e) { UpdateAdviceTag(); if (OperationInfo(AdviceState.WaitHandle)) { AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); if (adviceType != null) { if (adviceType.ParticipateMode == (int)AdviceParticipateMode.Mail || adviceType.ParticipateMode == (int)AdviceParticipateMode.All) { List <string> contents = AccountHelper.GetPermissionContents(AccountID, AdviceTypeID); if (contents.Contains("Advice.Admin") || We7Helper.IsEmptyID(AccountID)) { ToOtherReplyUser(); } } } Messages.ShowMessage(" :) 转办成功!"); //记录日志 string content = string.Format("转办了留言反馈:“{0}”的详细信息", AdviceID); AddLog("留言反馈详细信息", content); BindReplayList(); actionTable.Visible = false; } }
/// <summary> /// 界面加载 /// </summary> void InitializePage() { ContentModelCollection cmc = new ContentModelCollection(); ContentModelCollection orcmc = ModelHelper.GetAllContentModel(); foreach (We7.Model.Core.ContentModel c in orcmc) { if (c.Type == ModelType.ADVICE) { cmc.Add(c); } } ddlAdviceType.DataSource = cmc; ddlAdviceType.DataTextField = "label"; ddlAdviceType.DataValueField = "name"; ddlAdviceType.DataBind(); ddlAdviceType.Items.Insert(0, new ListItem("请选择", "")); adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); if (adviceType != null) { ConfigNameTextBox.Text = adviceType.Title.ToString(); ddlAdviceType.SelectedValue = adviceType.ModelName; } }
/// <summary> /// 反馈模型名称 /// </summary> void SetTitleName() { if (AdviceTypeID != null && AdviceTypeID != "") { AdviceType a = AdviceTypeHelper.GetAdviceType(AdviceTypeID); if (a != null) { NameLabel.Text = a.Title + "列表"; } } }
string GetAdviceTypeNameByID() { if (AdviceTypeID != "") { string title = AdviceTypeHelper.GetAdviceType(AdviceTypeID).Title.ToString(); return(title + "监控管理"); } else { return("反馈监控管理"); } }
string GetChannelProcessLayerNO(string id) { string adviceTypeID = AdviceHelper.GetAdvice(id).TypeID; AdviceType adviceType = AdviceTypeHelper.GetAdviceType(adviceTypeID); if (adviceType.FlowSeries != null) { return(adviceType.FlowSeries.ToString()); } else { return(""); } }
/// <summary> /// 更新时初始化页面数据 /// </summary> void InitializePage() { // 问题hideExtraProperties AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); if (adviceType != null) { AdviceNameText.Text = adviceType.Title; RemarkText.Text = adviceType.Description; StartTimeText.Text = adviceType.CreateDate.ToString(); AdviceCreatedText.Text = GetAccountNameText(adviceType.AccountID); } }
void Initialize() { BindReplayList(); Advice adviceModel = ThisAdvice; adviceModel.IsRead = 0; AdviceHelper.UpdateAdvice(adviceModel, null); if (AdviceTypeID != null && AdviceTypeID != "") { NameLabel.Text = AdviceTypeHelper.GetAdviceType(AdviceTypeID).Title.ToString() + "详细信息";; } PagePathLiteral.Text = BuildPagePath(); InitializeButtons(); DataBindAdviceTag(); BindReplyUserList(); }
/// <summary> /// 获取邮件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ReceiveBtn_Click(object sender, EventArgs e) { if (AdviceTypeID != null && AdviceTypeID != "") { AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); //try //{ MailHelper mailHelper = AdviceHelper.GetMailHelper(adviceType); string typeName = typeof(AdviceHelper).ToString(); bool delete = false; if (DeleteEmailTextBox.Text == "1") { delete = true; } string stateText = adviceType.StateText; MailResult result = mailHelper.ReceiveMail("We7.CMS.Utils.dll", typeName, "HandleReceiveMail", delete, stateText); LoadAdvices(); string errorRoot = "<a href=\"/admin/Advice/AdviceProcessManage.aspx\" >反馈监控管理</a>"; string message = ""; if (result.Count > 0) { message = "您共获取到了" + result.Count + "封邮件"; } else { message = "Sorry,没有邮件可以获取..."; } if (result.Success > 0) { message += ",并成功受理了" + result.Success + "条反馈信息。"; } else if (result.Count > 0 && result.Success == 0) { message += ",有" + result.Count + "封回复邮件存在错误信息,不可直接对应回复到反馈信息,请到" + errorRoot + " <邮件回复>下进行处理。"; } Messages.ShowMessage(message); //} //catch (Exception ex) //{ // Messages.ShowMessage("系统繁忙,请稍后在试!错误信息:"+ex.Message); //} } else { Messages.ShowMessage("请先选择反馈模型后再获取回复邮件!"); } }
/// <summary> /// 操作按钮状态初始化 /// </summary> private void InitializeButtons() { bool canAccept = false; //反馈受理 bool canAdmin = false; //反馈管理 bool canHandle = false; //反馈办理 bool canRead = false; //查看 bool canCheck = false; //审核 //模型不为空,并且是用户登陆时验证是否具有权限 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"); AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); string stateText = adviceType.StateText; if (adviceType.FlowSeries > 0) { canCheck = true; } if (adviceType.ParticipateMode == (int)AdviceParticipateMode.Mail) { ReceiveHyperLink.Visible = false; } } else { canAccept = canAdmin = canCheck = canHandle = true; } DeleteHyperLink.Visible = canAdmin; //删除 HastenHyperLink.Visible = canAdmin; //催办 MustHandleHyperLink.Visible = canAccept || canAdmin; //必须办理 ReceiveHyperLink.Visible = canAdmin; //接收反馈回复邮件 DisplayHyperLink.Visible = canAdmin; //前台显示 UndisplayHyperLink.Visible = canAdmin; //前台不显示 UnControlDisplayHyperLink.Visible = canAdmin; //前台不控制 }
/// <summary> /// 初始化页面信息 /// </summary> void LoadAdvices() { AdviceUPager.PageIndex = PageNumber; AdviceUPager.ItemCount = AdviceHelper.QueryAdviceCountByAll(CurrentQuery); AdviceUPager.UrlFormat = We7Helper.AddParamToUrl(Request.RawUrl.Replace("{", "{{").Replace("}", "}}"), Keys.QRYSTR_PAGEINDEX, "{0}"); AdviceUPager.PrefixText = "共 " + AdviceUPager.MaxPages + " 页 · 第 " + AdviceUPager.PageIndex + " 页 · "; List <Advice> list = new List <Advice>(); list = AdviceHelper.GetAdviceByQuery(CurrentQuery, AdviceUPager.Begin - 1, AdviceUPager.Count); AdviceType adviceType = new AdviceType(); foreach (Advice a in list) { if (a.MustHandle > 1) { HasMustHandle = true; } if (a.TypeID != null && a.TypeID != "") { adviceType = AdviceTypeHelper.GetAdviceType(a.TypeID); if (adviceType != null) { a.TypeTitle = adviceType.Title; } } if (a.UserID != null && a.UserID.Length > 0) { a.Name = AccountHelper.GetAccount(a.UserID, new string[] { "LastName" }).LastName; } if (a.Name == null || a.Name == "") { a.Name = "匿名用户"; } a.TimeNote = GetTimeNote(a.CreateDate); a.AlertNote = GetAlertNote(a.ToHandleTime, adviceType.RemindDays, a.MustHandle); } AdviceGridView.DataSource = list; AdviceGridView.DataBind(); BuildStateLinks();//刷新状态统计栏 }
/// <summary> /// 绑定前台模型名称 /// </summary> /// <param name="id"></param> /// <returns></returns> public string GetAdviceText(string id) { if (id != null && id != "") { string typeID = AdviceHelper.GetAdvice(id).TypeID; if (typeID != null && typeID != "") { return(AdviceTypeHelper.GetAdviceType(typeID).Title.ToString()); } else { return(""); } } else { return(""); } }
void DeleteTypeList(string[] ids) { List <Advice> list = new List <Advice>(); string aTitle = ""; foreach (string id in ids) { list = AdviceHelper.GetAdvices(id); foreach (Advice a in list) { AdviceHelper.DeleteAdvice(a.ID); aTitle += String.Format("{0};", a.Title); } } //记录日志 string content = string.Format("删除了{0}个反馈模型:“{1}”", ids.Length.ToString(), aTitle); AddLog("反馈模型管理", content); string titles = ""; List <string> listString = new List <string>(); foreach (string id in ids) { AdviceType at = AdviceTypeHelper.GetAdviceType(id); AdviceTypeHelper.DeleteAdviceType(id); titles += String.Format("{0};", at.Title); string menuName = at.Title + "管理"; We7.CMS.Common.MenuItem menuItem = MenuHelper.GetMenuItemByTitle(menuName); if (menuItem != null) { listString.Add(menuItem.ID); } } if (listString != null) { MenuHelper.DeleteMenuItem(listString); } //记录日志 string atContent = string.Format("删除了{0}个反馈模型:“{1}”", ids.Length.ToString(), titles); AddLog("反馈模型管理", atContent); }
/// <summary> /// 构建当前位置导航 /// </summary> /// <returns></returns> string BuildPagePath() { string pos = ""; if (AdviceTypeID != null) { AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); if (adviceType != null) { pos = "开始 > <a >设置</a> > <a href=\"../Advice/AdviceTypes.aspx\" >反馈模型</a> > <a>编辑模型【" + adviceType.Title + "】</a>"; NameLabel.Text = "编辑反馈模型【" + adviceType.Title + "】"; } } else { pos = "开始 > <a >设置</a> > <a href=\"../Advice/AdviceTypes.aspx\" >反馈模型</a> > <a>创建新模型</a>"; } return(pos); }
/// <summary> /// 根据模型ID查询用户名称 /// </summary> /// <param name="id"></param> /// <returns></returns> public string GetAccountNameByAdviceTypeID(string id) { if (id == null || id == "") { return(""); } AdviceType adviceType = AdviceTypeHelper.GetAdviceType(id); if (adviceType == null || adviceType.AccountID == null || adviceType.AccountID == "") { return("匿名用户"); } else if (adviceType.AccountID == "{00000000-0000-0000-0000-000000000000}") { return("管理员"); } else { return(AccountHelper.GetAccount(adviceType.AccountID, new string[] { "LoginName" }).LoginName); } }
/// <summary> /// 初始化页面信息 /// </summary> void LoadAdvices() { query = null; //CurrentQuery.State = (int)CurrentState; AdviceUPager.PageIndex = PageNumber; AdviceUPager.ItemCount = AdviceHelper.QueryAdviceCountByAll(CurrentQuery); AdviceUPager.UrlFormat = We7Helper.AddParamToUrl(Request.RawUrl.Replace("{", "{{").Replace("}", "}}"), Keys.QRYSTR_PAGEINDEX, "{0}"); AdviceUPager.PrefixText = "共 " + AdviceUPager.MaxPages + " 页 · 第 " + AdviceUPager.PageIndex + " 页 · "; List <Advice> list = new List <Advice>(); list = AdviceHelper.GetAdviceByQuery(CurrentQuery, AdviceUPager.Begin - 1, AdviceUPager.Count); AdviceType adviceType = new AdviceType(); foreach (Advice a in list) { if (a.TypeID != null && a.TypeID != "") { adviceType = AdviceTypeHelper.GetAdviceType(a.TypeID); if (adviceType != null) { a.TypeTitle = adviceType.Title; } } if (a.UserID != null && a.UserID.Length > 0) { a.Name = AccountHelper.GetAccount(a.UserID, new string[] { "LoginName" }).LoginName; } if (a.Name == null || a.Name == "") { a.Name = "匿名用户"; } } AdviceGridView.DataSource = list; AdviceGridView.DataBind(); }
/// <summary> /// 绑定权限数据 /// </summary> /// <param name="e"></param> /// <param name="ownerType"></param> void BindPermisstionsData(GridViewRowEventArgs e, string ownerType) { if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header) { AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); if (adviceType != null) { e.Row.Cells[6].Visible = false; e.Row.Cells[7].Visible = false; e.Row.Cells[8].Visible = false; //上报办理涉及到审核(一审,二审,三审) if (adviceType.StateText == "上报办理" && adviceType.FlowSeries.ToString() != null) { switch (adviceType.FlowSeries) { case 1: e.Row.Cells[6].Visible = true; e.Row.Cells[7].Visible = false; e.Row.Cells[8].Visible = false; break; case 2: e.Row.Cells[6].Visible = true; e.Row.Cells[7].Visible = true; e.Row.Cells[8].Visible = false; if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[6].Text = "一审"; } break; case 3: e.Row.Cells[6].Visible = true; e.Row.Cells[7].Visible = true; e.Row.Cells[8].Visible = true; if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[6].Text = "一审"; } break; } } if (e.Row.RowType == DataControlRowType.DataRow) { System.Web.UI.HtmlControls.HtmlInputHidden roleIDHidden = (System.Web.UI.HtmlControls.HtmlInputHidden)e.Row.FindControl("IDHidden"); string roleID = roleIDHidden.Value; CheckBox AdviceAdminCheckbox = (CheckBox)e.Row.FindControl("AdviceAdminCheckbox"); if (AdviceAdminCheckbox != null) { if (PermissionIsadviceTypeecked(ownerType, roleID, AdviceTypeID, "Advice.Admin")) { AdviceAdminCheckbox.Checked = true; } else { AdviceAdminCheckbox.Checked = false; } } CheckBox AdviceReadCheckBox = (CheckBox)e.Row.FindControl("AdviceReadCheckBox"); if (AdviceReadCheckBox != null) { if (PermissionIsadviceTypeecked(ownerType, roleID, AdviceTypeID, "Advice.Read")) { AdviceReadCheckBox.Checked = true; } else { AdviceReadCheckBox.Checked = false; } } CheckBox AdviceAcceptCheckbox = (CheckBox)e.Row.FindControl("AdviceAcceptCheckbox"); if (AdviceAcceptCheckbox != null) { if (PermissionIsadviceTypeecked(ownerType, roleID, AdviceTypeID, "Advice.Accept")) { AdviceAcceptCheckbox.Checked = true; } else { AdviceAcceptCheckbox.Checked = false; } } CheckBox AdviceHandleCheckbox = (CheckBox)e.Row.FindControl("AdviceHandleCheckbox"); if (AdviceHandleCheckbox != null) { if (PermissionIsadviceTypeecked(ownerType, roleID, AdviceTypeID, "Advice.Handle")) { AdviceHandleCheckbox.Checked = true; } else { AdviceHandleCheckbox.Checked = false; } } CheckBox AdviceFirstAuditCheckBox = (CheckBox)e.Row.FindControl("AdviceFirstAuditCheckBox"); if (AdviceFirstAuditCheckBox != null) { if (PermissionIsadviceTypeecked(ownerType, roleID, AdviceTypeID, "Advice.FirstAudit")) { AdviceFirstAuditCheckBox.Checked = true; } else { AdviceFirstAuditCheckBox.Checked = false; } } CheckBox AdviceSecondAuditCheckBox = (CheckBox)e.Row.FindControl("AdviceSecondAuditCheckBox"); if (AdviceSecondAuditCheckBox != null) { if (PermissionIsadviceTypeecked(ownerType, roleID, AdviceTypeID, "Advice.SecondAudit")) { AdviceSecondAuditCheckBox.Checked = true; } else { AdviceSecondAuditCheckBox.Checked = false; } } CheckBox AdviceThirdAuditCheckBox = (CheckBox)e.Row.FindControl("AdviceThirdAuditCheckBox"); if (AdviceThirdAuditCheckBox != null) { if (PermissionIsadviceTypeecked(ownerType, roleID, AdviceTypeID, "Advice.ThirdAudit")) { AdviceThirdAuditCheckBox.Checked = true; } else { AdviceThirdAuditCheckBox.Checked = false; } } } } } }
/// <summary> /// 操作信息 /// </summary> /// <returns></returns> protected bool OperationInfo(AdviceState state, string direction, bool saveReply) { try { AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); Advice a = ThisAdvice; //处理反馈回复信息 AdviceReply adviceReply = null; if (saveReply) { adviceReply = new AdviceReply(); adviceReply.AdviceID = AdviceID; adviceReply.Content = We7Helper.ConvertPageBreakFromVisualToChar(ReplyContentTextBox.Value); adviceReply.Suggest = ToAdviceTextBox.Text; adviceReply.UserID = AccountID; adviceReply.CreateDate = DateTime.Now; adviceReply.Updated = DateTime.Now; //增加回复数 a.ReplyCount += 1; } //更新反馈信息 a.Updated = DateTime.Now; a.ToHandleTime = DateTime.Now; if (UserIDTextBox.Text.Trim() != "") { a.ToOtherHandleUserID = UserIDTextBox.Text.ToString(); } else { a.ToOtherHandleUserID = AccountID; } a.State = (int)state; //处理反馈进度 Advice oldAdvice = AdviceHelper.GetAdvice(AdviceID); Processing ap = ProcessHelper.GetAdviceProcess(oldAdvice); ap.UpdateDate = DateTime.Now; ap.ProcessAccountID = AccountID; ap.ApproveName = AccountHelper.GetAccount(AccountID, new string[] { "LastName" }).LastName; ap.ProcessDirection = direction.ToString(); ap.Remark = ToAdviceTextBox.Text; if (state == AdviceState.WaitHandle) { a.ProcessState = ((int)state).ToString(); string myText = "请 {0} 办理一下反馈“{1}”。"; string userName = AccountHelper.GetAccount(UserIDTextBox.Text, new string[] { "LastName" }).LastName; ap.Remark = string.Format(myText, userName, a.Title) + "<br>" + ap.Remark; } switch (state) { case AdviceState.All: break; case AdviceState.WaitAccept: case AdviceState.WaitHandle: case AdviceState.Finished: break; case AdviceState.Checking: int auditLevel = 0; if (We7Helper.IsNumber(a.ProcessState)) { auditLevel = int.Parse(a.ProcessState); } if (auditLevel < 0) { auditLevel = 0; } auditLevel += 1; if (auditLevel > adviceType.FlowSeries) { a.ProcessState = ((int)AdviceState.Finished).ToString(); a.State = (int)AdviceState.Finished; a.MustHandle = 0; } else { a.ProcessState = auditLevel.ToString(); } break; default: break; } ap.CurLayerNO = a.ProcessState; ap.AdviceState = (AdviceState)a.State; AdviceHelper.OperationAdviceInfo(adviceReply, oldAdvice, ap); if (state == AdviceState.WaitHandle) { AdviceHelper.UpdateAdvice(a, new string[] { "ToHandleTime", "ToOtherHandleUserID" }); } if (state == AdviceState.Finished) { AdviceEmailConfigs adviceEmailConfigs = new AdviceEmailConfigs(); AdviceEmailConfigInfo info = adviceEmailConfigs["ReplyUser"]; AdviceHelper.SendResultMailToAdvicer(a, adviceReply, adviceType, info); } return(true); } catch (Exception ex) { Messages.ShowError(" 信息操作失败!原因:" + ex.Message); return(false); } }
/// <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; } } } }
/// <summary> /// 绑定权限数据 /// </summary> /// <param name="e"></param> /// <param name="ownerType"></param> void BindPermisstionsData(GridViewRowEventArgs e, string ownerType) { if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header) { AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); if (adviceType != null) { e.Row.Cells[6].Visible = false; e.Row.Cells[7].Visible = false; e.Row.Cells[8].Visible = false; //上报办理涉及到审核(一审,二审,三审) if (adviceType.StateText == "上报办理" && adviceType.FlowSeries.ToString() != null) { switch (adviceType.FlowSeries) { case 1: e.Row.Cells[6].Visible = true; e.Row.Cells[7].Visible = false; e.Row.Cells[8].Visible = false; break; case 2: e.Row.Cells[6].Visible = true; e.Row.Cells[7].Visible = true; e.Row.Cells[8].Visible = false; if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[6].Text = "一审"; } break; case 3: e.Row.Cells[6].Visible = true; e.Row.Cells[7].Visible = true; e.Row.Cells[8].Visible = true; if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[6].Text = "一审"; } break; } } if (e.Row.RowType == DataControlRowType.DataRow) { System.Web.UI.HtmlControls.HtmlInputHidden roleIDHidden = (System.Web.UI.HtmlControls.HtmlInputHidden)e.Row.FindControl("IDHidden"); string roleID = roleIDHidden.Value; int typeID = ownerType == "role" ? Constants.OwnerRole : Constants.OwnerAccount; List <string> ps = AccountHelper.GetPermissionContents(typeID.ToString(CultureInfo.InvariantCulture), roleID, AdviceTypeID); if (ps == null) { Messages.ShowError("无权限设置!"); return; } CheckBox AdviceAdminCheckbox = (CheckBox)e.Row.FindControl("AdviceAdminCheckbox"); if (AdviceAdminCheckbox != null) { AdviceAdminCheckbox.Checked = ps.Contains("Advice.Admin"); } CheckBox AdviceReadCheckBox = (CheckBox)e.Row.FindControl("AdviceReadCheckBox"); if (AdviceReadCheckBox != null) { AdviceReadCheckBox.Checked = ps.Contains("Advice.Read"); } CheckBox AdviceAcceptCheckbox = (CheckBox)e.Row.FindControl("AdviceAcceptCheckbox"); if (AdviceAcceptCheckbox != null) { AdviceAcceptCheckbox.Checked = ps.Contains("Advice.Accept"); } CheckBox AdviceHandleCheckbox = (CheckBox)e.Row.FindControl("AdviceHandleCheckbox"); if (AdviceHandleCheckbox != null) { AdviceHandleCheckbox.Checked = ps.Contains("Advice.Handle"); } CheckBox AdviceFirstAuditCheckBox = (CheckBox)e.Row.FindControl("AdviceFirstAuditCheckBox"); if (AdviceFirstAuditCheckBox != null) { AdviceFirstAuditCheckBox.Checked = ps.Contains("Advice.FirstAudit"); } CheckBox AdviceSecondAuditCheckBox = (CheckBox)e.Row.FindControl("AdviceSecondAuditCheckBox"); if (AdviceSecondAuditCheckBox != null) { AdviceSecondAuditCheckBox.Checked = ps.Contains("Advice.SecondAudit"); } CheckBox AdviceThirdAuditCheckBox = (CheckBox)e.Row.FindControl("AdviceThirdAuditCheckBox"); if (AdviceThirdAuditCheckBox != null) { AdviceThirdAuditCheckBox.Checked = ps.Contains("Advice.ThirdAudit"); } CheckBox AdviceRefuseCheckbox = (CheckBox)e.Row.FindControl("AdviceRefuseCheckbox"); if (AdviceRefuseCheckbox != null) { AdviceRefuseCheckbox.Checked = ps.Contains("Advice.Refuse"); } CheckBox AdviceTransferCheckbox = (CheckBox)e.Row.FindControl("AdviceTransferCheckbox"); if (AdviceTransferCheckbox != null) { AdviceTransferCheckbox.Checked = ps.Contains("Advice.Transfer"); } } } } }
/// <summary> /// 更新时初始化页面数据 /// </summary> void InitializePage() { AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); if (AdviceTypeID != null) { //页面赋值 RemindDaysTxtBox.Text = adviceType.RemindDays.ToString(); if (adviceType.StateText != "") { RadlAdviceType.Items.FindByText(adviceType.StateText.ToString()).Selected = true; } if (adviceType.FlowSeries > 0) { FlowSeriesDropDownList.Items.FindByValue(adviceType.FlowSeries.ToString()).Selected = true; } if (adviceType.FlowInnerDepart.ToString() == "1") { FlowInnerDepartCheckBox.Checked = true; } switch ((AdviceParticipateMode)adviceType.ParticipateMode) { case AdviceParticipateMode.Mail: EmailCheckBox.Checked = true; NoteCheckBox.Checked = false; break; case AdviceParticipateMode.SMS: EmailCheckBox.Checked = false; NoteCheckBox.Checked = true; break; case AdviceParticipateMode.All: EmailCheckBox.Checked = true; NoteCheckBox.Checked = true; break; default: EmailCheckBox.Checked = false; NoteCheckBox.Checked = false; break; } if (adviceType.UseSystemMail == 1 || adviceType.UseSystemMail == 0) //是否使用默认邮件地址 0 默认; 1 专用 { UseSystemMailRadioButtonList.Items.FindByValue(adviceType.UseSystemMail.ToString()).Selected = true; } if (adviceType.MailSMTPServer != "" && adviceType.MailSMTPServer != null) { SMTPServerTextBox.Text = adviceType.MailSMTPServer.ToString(); } if (adviceType.POPServer != "" && adviceType.POPServer != null) { SysPopServerTextBox.Text = adviceType.POPServer.ToString(); } if (adviceType.MailAddress != null && adviceType.MailAddress != "") { EmailAddressTextBox.Text = adviceType.MailAddress.ToString(); } if (adviceType.MailUser != null && adviceType.MailUser != "") { MailUserTextBox.Text = adviceType.MailUser; } if (adviceType.MailPassword != null && adviceType.MailPassword != "") { MailPasswordTextBox.Text = adviceType.MailPassword; } if (adviceType.SMSUser != null && adviceType.SMSUser != "") { string[] noteUser = adviceType.SMSUser.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < noteUser.Length; i++) { NoteCheckBoxList.Items.FindByValue(noteUser[i].ToString()).Selected = true; } } if (adviceType.MailMode != null && adviceType.MailMode != "") { string[] mailMode = adviceType.MailMode.Split(new string[] { "0" }, StringSplitOptions.None); for (int i = 0; i < mailMode.Length; i++) { if (mailMode[i].Trim() != "") { EmailCheckBoxList.Items.FindByValue("0" + mailMode[i].ToString()).Selected = true; } } } } }