Files
KJD/TEMUKJD/WXForms/TalkForms/TalkAutoReplyConfigForm.cs
T
2026-03-11 15:42:24 +08:00

68 lines
1.9 KiB
C#

using AllBase.Model.Result;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
namespace TemuKJD.WXForms.TalkForms
{
public partial class TalkAutoReplyConfigForm : BaseGeneralForm
{
List<KeyValuePair<string, string>> lstTalkTemplatePair;
public TalkAutoReplyConfigForm(List<KeyValuePair<string, string>> _lstTalkTemplatePair)
{
InitializeComponent();
lstTalkTemplatePair = _lstTalkTemplatePair;
}
private void ChatMessageForm_Load(object sender, EventArgs e)
{
if (lstTalkTemplatePair != null)
{
string txt = "";
foreach(var vp in lstTalkTemplatePair)
{
txt += vp.Key + "###" + vp.Value + "\r\n";
}
txt.Trim('\r', '\n');
this.txtTalk.Text = txt;
}
}
private void btnGetSelect_Click(object sender, EventArgs e)
{
try
{
WxTalkForm.UpdateAutoReply(txtTalk.Text.Trim(' ', '\r', '\n'));
BaseMsgForm.ShowInfo("保存成功");
this.Close();
}
catch
{
BaseMsgForm.ShowInfo("保存失败,请重试");
}
}
private void btnDefault_Click(object sender, EventArgs e)
{
try
{
WxTalkForm.UpdateAutoReply(WxTalkForm.defaultTalkTemplate);
BaseMsgForm.ShowInfo("还原成功");
}
catch
{
BaseMsgForm.ShowInfo("还原失败,请重试");
this.Close();
}
}
}
}