AIMS/AIMS/PublicUI/frmCreateTemplate.cs

58 lines
1.5 KiB
C#

using AIMSBLL;
using AIMSExtension;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AIMS.PublicUI.UI
{
public partial class frmCreateTemplate : Form
{
public DateTime InRoomTime;
public int PatientId = 0;
public int TypeId = 0; //1 手术模板 2 手术复苏模板
public frmCreateTemplate()
{
InitializeComponent();
}
private void tsbSava_Click(object sender, EventArgs e)
{
if (txtName.Text.Trim() == "")
{
MessageBox.Show("模板名称不能为空!");
return;
}
if(BOperationTemplate.Exists(txtName.Text.Trim(),TypeId))
{
MessageBox.Show("名称不能重复!");
return;
}
try
{
int IsPublic = radioButton1.Checked == true ? 1 : 0;
BOperationTemplate.Add(InRoomTime,txtName.Text.Trim(), PatientId, TypeId,IsPublic);
MessageBox.Show("保存成功!");
Close();
}
catch (Exception ex)
{
PublicMethod.WriteLog(ex);
MessageBox.Show("保存失败!");
}
}
private void tsbExit_Click(object sender, EventArgs e)
{
Close();
}
}
}