private void SaveNotepad()
{
try
{
if (string.IsNullOrEmpty(string_NotepadCreateTime))
{
int result = _data.AddNotepad(txtNotepadTitle.Text, txtNotepadContent.Text);
if (result == 1)
{
BtnSaveNotepad.Enabled = false;
if (bianqianTimer.Enabled) bianqianTimer.Stop();
LoadNotepad();
}
else
{
MessageBox.Show("保存失败");
}
}
else
{
int result = _data.UpdateNotepad(string_NotepadCreateTime, txtNotepadTitle.Text, txtNotepadContent.Text);
if (result == 1)
{
BtnSaveNotepad.Enabled = false;
if (bianqianTimer.Enabled) bianqianTimer.Stop();
LoadNotepad();
}
else
{
MessageBox.Show("保存失败");
}
}
}
catch (Exception)
{
throw;
}
}