Пример #1
0
        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);
            }
        }
Пример #2
0
        /// <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() + "模型信息。");
        }
Пример #3
0
        /// <summary>
        /// 获取配置信息
        /// </summary>
        void GetConfigInfo()
        {
            AdviceParticipateMode type       = AdviceParticipateMode.None;
            AdviceType            adviceType = new AdviceType();

            adviceType.EnumState = StateMgr.StateProcess(adviceType.EnumState, EnumLibrary.Business.AdviceMode, Convert.ToInt32(RadlAdviceType.SelectedItem.Value.ToString()));
            //adviceType.ToWhichDepartment = Convert.ToInt32((AdviceToWhichDepartment)int.Parse(ToWhichDepartmentRadioButtonList.SelectedItem.Value.ToString()));
            adviceType.FlowSeries = Convert.ToInt32(FlowSeriesDropDownList.SelectedItem.Value);
            if (EmailCheckBox.Checked && NoteCheckBox.Checked == false)
            {
                type = AdviceParticipateMode.Mail;
            }
            else if (NoteCheckBox.Checked && EmailCheckBox.Checked == false)
            {
                type = AdviceParticipateMode.SMS;
            }
            else if (NoteCheckBox.Checked && EmailCheckBox.Checked)
            {
                type = AdviceParticipateMode.All;
            }

            adviceType.ParticipateMode = Convert.ToInt32(type);

            if (EmailCheckBox.Checked)
            //thehim:仅在邮件参与选中后保存下面数据
            {
                if (FlowInnerDepartCheckBox.Checked)
                {
                    adviceType.FlowInnerDepart = 1;
                }
                else
                {
                    adviceType.FlowInnerDepart = 0;
                }
                string mailMode = "";
                for (int j = 0; j < EmailCheckBoxList.Items.Count; j++)
                {
                    if (EmailCheckBoxList.Items[j].Selected)
                    {
                        mailMode += EmailCheckBoxList.Items[j].Value;
                    }
                }
                adviceType.MailMode       = mailMode;
                adviceType.UseSystemMail  = Convert.ToInt32(UseSystemMailRadioButtonList.SelectedItem.Value.ToString());
                adviceType.MailSMTPServer = SMTPServerTextBox.Text.ToString();
                adviceType.POPServer      = SysPopServerTextBox.Text.ToString();
                adviceType.MailAddress    = EmailAddressTextBox.Text.ToString();
                adviceType.MailUser       = MailUserTextBox.Text.ToString();
                adviceType.MailPassword   = MailPasswordTextBox.Text.ToString();
            }

            if (NoteCheckBox.Checked)
            {
                string noteUser = "";
                for (int i = 0; i < NoteCheckBoxList.Items.Count; i++)
                {
                    if (NoteCheckBoxList.Items[i].Selected)
                    {
                        noteUser += NoteCheckBoxList.Items[i].Value + ",";
                    }
                }
                adviceType.SMSUser = noteUser;
            }
            if (RemindDaysTxtBox.Text.Trim() == "")
            {
                RemindDaysTxtBox.Text = "0";
            }
            adviceType.RemindDays = Convert.ToInt32(RemindDaysTxtBox.Text.Trim());
            adviceType.ID         = AdviceTypeID;
            string[] fields = new string[] { "EnumState", "ToWhichDepartment", "FlowSeries", "ParticipateMode", "FlowInnerDepart", "MailMode", "UseSystemMail", "MailSMTPServer", "POPServer", "MailAddress", "MailUser", "MailPassword", "SMSUser", "RemindDays" };

            AdviceTypeHelper.UpdateAdviceType(adviceType, fields);
            Messages.ShowMessage("模型修改成功!");
        }