/// <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; } }
protected override Criteria CreateListCriteria() { if (c == null) { c = new Criteria(); if (!string.IsNullOrEmpty(AdviceType)) { string modelName; try { modelName = new AdviceTypeHelper().GetAdviceType(AdviceType).ModelName; } catch { modelName = AdviceType; } c.Add(CriteriaType.Equals, "ModelName", modelName); c.Add(CriteriaType.Equals, "TypeID", AdviceTypeID); } if (!string.IsNullOrEmpty(Request[QueryKey])) { c.Add(CriteriaType.Equals, "SN", AdviceTypeID); } if (!string.IsNullOrEmpty(Request["KeyWord"])) { c.Add(CriteriaType.Like, "Title", "%" + Request["KeyWord"].Trim() + "%"); } if (IsShow) { c.Add(CriteriaType.Equals, "IsShow", 1); } if (SecurityQuery) { c.Add(CriteriaType.Equals, "MyQueryPwd", Request["Password"]); } } return(c); }
/// <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 GetAdviceTypeID(string ModelName) { List <AdviceType> list = AdviceTypeHelper.GetAdviceTypes(); foreach (AdviceType advicetype in list) { if (advicetype.ModelName == ModelName) { return(advicetype.ID); } } return(String.Empty); }
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); } }
/// <summary> /// 生成查询条件 /// </summary> /// <returns></returns> protected override Criteria CreateListCriteria() { string modelName; try { modelName = new AdviceTypeHelper().GetAdviceType(AdviceType).ModelName; } catch { modelName = AdviceType; } Criteria c = new Criteria(CriteriaType.Equals, "ModelName", modelName); c.Add(CriteriaType.Equals, "TypeID", AdviceTypeID); if (IsShow) { c.Add(CriteriaType.Equals, "IsShow", 1); } return(c); }
void BindingTypeData() { List <AdviceType> list = AdviceTypeHelper.GetAdviceTypes(); if (list == null) { return; } foreach (AdviceType adviceType in list) { string name = adviceType.Title; string value = adviceType.ID; ListItem item = new ListItem(name, value); MenuDropDownList.Items.Add(item); } }
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(); }
private void Bind() { string selectMemberName = SearchTextBox.Text.Trim(); string selectAccountName = AccountTextBox.Text.Trim(); bool accountName = false; List <string> ids = new List <string>(); if (selectAccountName != null && selectAccountName != "") { Account a = AccountHelper.GetAccountByLoginName(selectAccountName); if (a != null) { ids.Add(a.ID); } int i = selectAccountName.IndexOf("管理员"); if (i >= 0) { ids.Add("{00000000-0000-0000-0000-000000000000}"); } accountName = true; } if (AdvicePager.Count < 0) { AdvicePager.PageIndex = 0; } AdvicePager.FreshMyself(); List <AdviceType> adviceTypeList = new List <AdviceType>(); AdvicePager.RecorderCount = AdviceTypeHelper.GetAdviceTypeCountByName(selectMemberName, ids, accountName); if (AdvicePager.RecorderCount < 1) { Messages.ShowMessage("您还没有添加任何反馈模型"); DataGridView.DataSource = adviceTypeList; DataGridView.DataBind(); return; } adviceTypeList = AdviceTypeHelper.SearchAdviceTypeByName(selectMemberName, ids, accountName, AdvicePager.Begin, AdvicePager.PageSize); if (adviceTypeList.Count < 1) { Messages.ShowMessage("您还没有添加任何反馈模型"); return; } DataGridView.DataSource = adviceTypeList; DataGridView.DataBind(); }
/// <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("请先选择反馈模型后再获取回复邮件!"); } }
protected void SubmitButton_Click(object sender, EventArgs e) { AdviceType adviceType = new AdviceType(); adviceType.CreateDate = DateTime.Now; int index; if (int.TryParse(SortNumber.Text, out index)) { adviceType.Index = index; } adviceType.Title = AdviceNameText.Text.Trim(); adviceType.Description = RemarkText.Text.Trim(); if (string.IsNullOrEmpty(adviceType.Title)) { Messages.ShowError("模型名称不能为空"); return; } if (AdviceTypeID == null || AdviceTypeID == "") // 新建 { adviceType.AccountID = AccountID; string adviceTypeID = We7Helper.CreateNewID(); adviceType.ID = adviceTypeID; AdviceTypeHelper.AddAdviceType(adviceType); } else // 修改 { adviceType.ID = AdviceTypeID; AdviceTypeHelper.UpdateAdviceType(adviceType); Messages.ShowMessage("" + AdviceNameText.Text + " 模型修改成功!!"); } //记录日志 string content = string.Format("编辑了模型“{0}”的信息", adviceType.Title); AddLog("编辑反馈模型", content); if (AdviceTypeID == null || AdviceTypeID == "") { string rawurl = We7Helper.AddParamToUrl(Request.RawUrl, "saved", "1"); rawurl = We7Helper.RemoveParamFromUrl(rawurl, "adviceTypeID"); rawurl = We7Helper.AddParamToUrl(rawurl, "adviceTypeID", We7Helper.GUIDToFormatString(adviceType.ID)); Response.Redirect(rawurl); } }
/// <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> /// 创建Config文件 /// </summary> /// <param name="path"></param> protected void CreateFile() { if (String.IsNullOrEmpty(ddlAdviceType.SelectedValue)) { Messages.ShowMessage("请选择模型!"); return; } if (AdviceTypeID != null && AdviceTypeID != "") { adviceType.Updated = DateTime.Now; adviceType.ID = AdviceTypeID; AdviceTypeHelper.UpdateAdviceType(AdviceTypeID, ddlAdviceType.SelectedValue); } //记录日志 string content = string.Format("修改反馈模型:“{0}”", adviceType.Title); AddLog("反馈模型管理", content); Messages.ShowMessage("您成功修改" + ConfigNameTextBox.Text.ToString().Trim() + "模型信息。"); }
/// <summary> /// 绑定反馈类别 /// </summary> void BindAdvice() { AdviceTypeDropDownList.Items.Clear(); List <AdviceType> adviceType = AdviceTypeHelper.GetAdviceTypes(); if (adviceType != null) { for (int i = 0; i < adviceType.Count; i++) { if (adviceType[i].MailMode != "") { string name = adviceType[i].Title; string value = adviceType[i].ID; ListItem item = new ListItem(name, value); AdviceTypeDropDownList.Items.Add(item); } } } }
/// <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); }
public override void InitControl() { hfValue.Value = lblValue.Text = (Value ?? "").ToString(); string result = ""; if (!string.IsNullOrEmpty(Request["model"])) { ModelInfo mi = ModelHelper.GetModelInfoByName(Request["model"]); if (mi != null && !string.IsNullOrEmpty(mi.RelationModelName)) { AdviceType adviceType = AdviceTypeHelper.GetAdviceTypeByModelName(mi.RelationModelName); if (adviceType != null && !string.IsNullOrEmpty(adviceType.ID)) { string adviceTypeID = adviceType.ID; result = "<a href='" + GetUrl() + "?typeID=" + adviceTypeID + "&RelationID=" + hfValue.Value + "'>查看反馈</a>"; } } } ltlText.Text = result; }
void BindAdvice() { AdviceTypeDropDownList.Items.Clear(); List <AdviceType> adviceType = AdviceTypeHelper.GetAdviceTypes(); AdviceTypeDropDownList.Items.Add("=====切换到其他模型====="); if (adviceType != null) { for (int i = 0; i < adviceType.Count; i++) { if (adviceType[i].MailMode != "") { string name = adviceType[i].Title; string value = We7Helper.AddParamToUrl(Request.RawUrl, "adviceTypeID", adviceType[i].ID); ListItem item = new ListItem(name, value); AdviceTypeDropDownList.Items.Add(item); } } } AdviceTypeDropDownList.Visible = true; }
public string GetText(object dataItem, ColumnInfo columnInfo) { string result = "#"; string v = ModelControlField.GetValue(dataItem, columnInfo.Name); string[] columnInfoSZ = columnInfo.Expression.Split(new char[] { '|' }); if (columnInfoSZ.Length > 1 && !string.IsNullOrEmpty(columnInfoSZ[1])) { ModelInfo mi = ModelHelper.GetModelInfoByName(columnInfoSZ[1]); if (mi != null && !string.IsNullOrEmpty(mi.RelationModelName)) { AdviceType adviceType = AdviceTypeHelper.GetAdviceTypeByModelName(mi.RelationModelName); if (adviceType != null && !string.IsNullOrEmpty(adviceType.ID)) { string adviceTypeID = adviceType.ID; result = "<a href='/admin/Advice/AdviceListEx.aspx?typeID=" + adviceTypeID + "&RelationID=" + v + "'>查看反馈</a>"; } } } return(result); }
/// <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> /// <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; } } } }
public bool InsertEmailAdvice(We7.Model.Core.PanelContext data) { Advice advice = new Advice(); advice.OwnID = Security.CurrentAccountID; //advice.TypeID = GetAdviceTypeID(data.ModelName); //advice.ID = GetValue<string>(data, "ID"); advice.Title = GetValue <string>(data, "Title"); advice.UserID = GetValue <string>(data, "UserID"); advice.Content = GetValue <string>(data, "Content"); advice.CreateDate = DateTime.Now; advice.Updated = DateTime.Now; advice.Name = GetValue <string>(data, "Name"); advice.Email = GetValue <string>(data, "Email"); advice.Address = GetValue <string>(data, "Address"); advice.Phone = GetValue <string>(data, "Phone"); advice.Fax = GetValue <string>(data, "Fax"); advice.State = (int)AdviceState.WaitAccept; advice.SN = AdviceHelper.CreateArticleSN(); int isshow; Int32.TryParse(GetValue <string>(data, "IsShow"), out isshow); string stateStr = StateMgr.StateProcess(advice.EnumState, EnumLibrary.Business.AdviceDisplay, isshow); advice.IsShow = isshow; advice.EnumState = stateStr; advice.Display1 = GetValue <string>(data, "Display1"); advice.Display2 = GetValue <string>(data, "Display2"); advice.Display3 = GetValue <string>(data, "Display3"); if (advice.SN < 100000) { advice.SN = advice.SN + 100000; } advice.MyQueryPwd = We7Helper.CreateNewID().Substring(1, 8); //下面是添加模型信息 string config, schema; advice.ModelXml = GetModelDataXml(data, advice.ModelXml, out schema, out config);//获取模型数据 advice.ModelConfig = config; advice.ModelName = data.ModelName; advice.ModelSchema = schema; advice.TypeID = GetValue <string>(data, "TypeID"); if (String.IsNullOrEmpty(advice.TypeID)) { AdviceType type = AdviceTypeHelper.GetAdviceTypeByModelName(data.ModelName); if (type != null) { advice.TypeID = type.ID; } } AdviceHelper.AddAdvice(advice); SetValue(data, "ID", advice.ID); try { AdviceHelper.SendNotifyMail(advice.ID); } catch { } finally { } return(true); }
/// <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"); } } } } }