using CircleFriendsTools;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UI.Framework.Forms;
namespace Weixin.CircleTools
{
public partial class SetSendModelForm : BaseForm
{
public SetSendModelForm()
{
InitializeComponent();
}
///
/// 更新
///
///
///
private void button1_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(textBox1.Text)) throw new Exception("名称不能为空");
if (string.IsNullOrWhiteSpace(memoEdit1.Text)) throw new Exception("文案不能为空");
var result = Class1.Config.send_templates.FirstOrDefault(f => f.ModelName.Trim() == textBox1.Text.Trim());
if (result == null) throw new Exception("该模板找不到");
result.Content = memoEdit1.Text;
Api.Framework.Tools.Util.Save(Class1.Config);
ShowSuccess("更新成功");
}
catch (Exception ex)
{
ShowError(ex);
}
finally
{
ShowContentModel();
}
}
private void SetSendModelForm_Load(object sender, EventArgs e)
{
ShowContentModel();
}
///
/// 显示一键发送模板(刷新)
///
private void ShowContentModel()
{
try
{
List