示例#1
0
        void bttnUpdate_Click(object sender, EventArgs e)
        {
            Advice a = new Advice();

            a.ID         = AdviceID;
            a.MyQueryPwd = txtPwd.Text.Trim();
            AdviceHelper.UpdateAdvice(a, new string[] { "MyQueryPwd" });
            Alert2("修改成功");
        }
示例#2
0
 /// <summary>
 /// 更新反馈标签;
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void UpdateAdviceTag()
 {
     if (!string.IsNullOrEmpty(AdviceTag))
     {
         Advice advice = new Advice();
         advice.ID        = AdviceID;
         advice.AdviceTag = AdviceTag;
         string[] fields = new string[] { "ID", "Updated", "AdviceTag" };
         AdviceHelper.UpdateAdvice(advice, fields);
     }
 }
示例#3
0
        public override bool Update(We7.Model.Core.PanelContext data)
        {
            string id     = GetValue <string>(data, "ID");
            Advice advice = AdviceHelper.GetAdvice(id);

            if (advice == null)
            {
                Insert(data);
            }
            else
            {
                advice.Title   = GetValue <string>(data, "Title");
                advice.UserID  = GetValue <string>(data, "UserID");
                advice.Content = GetValue <string>(data, "Content");
                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");

                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");

                //下面是添加模型信息
                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      = data.Objects["AdviceTypeID"] as string;

                List <string> udpatedFields = new List <string>()
                {
                    "ModelXml", "ModelName", "ModelSchema", "TypeID", "Title", "UserID", "Content", "Updated", "Name", "Email", "Phone", "Address", "Fax", "Display1", "Display2", "Display3"
                };
                if (!String.IsNullOrEmpty(GetValue <string>(data, "IsShow")))
                {
                    udpatedFields.Add("IsShow");
                }

                AdviceHelper.UpdateAdvice(advice, udpatedFields.ToArray());
                SetValue(data, "ID", advice.ID);
            }
            return(true);
        }
示例#4
0
        /// <summary>
        /// 管理员标记为已处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AdminHandButton_Click(object sender, EventArgs e)
        {
            Advice advice = new Advice();

            advice.EnumState    = StateMgr.StateProcess(advice.EnumState, EnumLibrary.Business.AdviceEnum, (int)EnumLibrary.AdviceEnum.AdminHandle);
            advice.State        = (int)AdviceState.Finished;
            advice.Updated      = DateTime.Now;
            advice.ID           = AdviceID;
            advice.AdviceTag    = ddlAdviceTag.SelectedItem.Value;
            advice.ProcessState = ((int)ProcessStates.Finished).ToString();
            string[] fields = new string[] { "ID", "State", "EnumState", "Updated", "AdviceTag", "ProcessState" };
            AdviceHelper.UpdateAdvice(advice, fields);
            actionTable.Visible = false;
            Messages.ShowMessage("反馈已标记为处理。");
        }
示例#5
0
        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();
        }
示例#6
0
        /// <summary>
        /// 必须办理回复事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void MustHandleButton_Click(object sender, EventArgs e)
        {
            List <string> adviceIDs = GetIDs();
            int           count     = 0;

            foreach (string adviceID in adviceIDs)
            {
                Advice advice = AdviceHelper.GetAdvice(adviceID);
                advice.MustHandle = 1;
                string[] fields = new string[] { "MustHandle" };
                AdviceHelper.UpdateAdvice(advice, fields);
                count++;
            }
            CurrentQuery = CreateQuery();
            LoadAdvices();
            Messages.ShowMessage(string.Format("您已经成功将{0}条反馈信息追加为 必须回复。", count.ToString()));
        }
示例#7
0
        protected void UnControlDisplayButton_Click(object sender, EventArgs e)
        {
            List <string> adviceIDs = GetIDs();
            int           count     = 0;

            foreach (string adviceID in adviceIDs)
            {
                Advice advice   = AdviceHelper.GetAdvice(adviceID);
                int    state    = (int)EnumLibrary.AdviceDisplay.DefaultDisplay;
                string stateStr = StateMgr.StateProcess(advice.EnumState, EnumLibrary.Business.AdviceDisplay, state);
                advice.EnumState = stateStr;
                string[] fields = new string[] { "EnumState" };
                AdviceHelper.UpdateAdvice(advice, fields);
                count++;
            }
            CurrentQuery = CreateQuery();
            LoadAdvices();
            Messages.ShowMessage(string.Format("您已经成功将{0}条反馈信息追加为 前台显示不控制。", count.ToString()));
        }
示例#8
0
        /// <summary>
        /// 催办
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void HastenButton_Click(object sender, EventArgs e)
        {
            List <string> adviceIDs    = GetIDs();
            int           count        = 0;
            List <string> adviceIDList = new List <string>();

            foreach (string adviceID in adviceIDs)
            {
                Advice advice = AdviceHelper.GetAdvice(adviceID);
                if (advice.MustHandle == 1)
                {
                    advice.MustHandle = 2;
                    string[] fields = new string[] { "MustHandle" };
                    adviceIDList.Add(adviceID);
                    AdviceHelper.UpdateAdvice(advice, fields);
                    count++;
                }
            }
            CurrentQuery = CreateQuery();
            LoadAdvices();
            Messages.ShowMessage(string.Format("您已经成功将{0}条反馈信息进行了 催促办理。", count.ToString()));
        }
示例#9
0
        /// <summary>
        /// 更新反馈标签;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UpdateAdviceTag()
        {
            if (this.ddlAdviceTag.Items.Count < 1)
            {
                DataBindAdviceTag();
            }
            string adviceTag = txtAdviceTag.Text.Trim();

            if (string.IsNullOrEmpty(adviceTag) && this.ddlAdviceTag.Items.Count > 0)
            {
                adviceTag = this.ddlAdviceTag.Items[0].Value;
            }
            else if (adviceTag == "noTag" && this.ddlAdviceTag.Items.Count > 0)
            {
                adviceTag = this.ddlAdviceTag.Items[0].Value;
            }
            Advice advice = new Advice();

            advice.ID        = AdviceID;
            advice.AdviceTag = adviceTag;
            string[] fields = new string[] { "ID", "Updated", "AdviceTag" };
            AdviceHelper.UpdateAdvice(advice, fields);
        }
示例#10
0
        /// <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);
            }
        }