AIMS/AIMSControls/OperationAfter/frmOperationReview.cs
2023-08-16 22:32:16 +08:00

171 lines
6.2 KiB
C#

using AIMSBLL;
using DrawGraph;
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.OperationAfter.UI
{
public partial class frmOperationReview : Form
{
public frmOperationReview()
{
InitializeComponent();
}
private void frmOperationReview_Load(object sender, EventArgs e)
{
if (AIMSExtension.PublicMethod.OperatorNo == "admin")
{
tsbSet.Visible = true;
}
else
{
tsbSet.Visible = false;
}
dgv.DataSource = BOperationReview.GetOperationReviewDataTable(txtMdrecNo.Text.Trim(), txtPatientName.Text.Trim(),
dtpOperationBeginTime.Value.ToString("yyyy-MM-dd"),
dtpOperationEndTime.Value.AddDays(1).ToString("yyyy-MM-dd")
);
}
private void tsbEditApply_Click(object sender, EventArgs e)
{
if (dgv.Rows.Count > 0)
{
AIMS.OperationFront.UI.frmOperationApplyDetail frmOperationApplyDetail = new OperationFront.UI.frmOperationApplyDetail();
frmOperationApplyDetail.State = AIMSExtension.EditState.EDIT;
int ApplyId = int.Parse(dgv.CurrentRow.Cells["ApplyId"].Value.ToString());
frmOperationApplyDetail.EditApplyId = ApplyId;
frmOperationApplyDetail.FormClosed += new FormClosedEventHandler(btnFind_Click);
frmOperationApplyDetail.ShowDialog();
}
else
{
MessageBox.Show("请选择患者");
}
}
private void tsbOperationReview_Click(object sender, EventArgs e)
{
if (dgv.Rows.Count > 0)
{
int PatientId = int.Parse(dgv.CurrentRow.Cells["PatientId"].Value.ToString());
int ApplyId = int.Parse(dgv.CurrentRow.Cells["ApplyId"].Value.ToString());
AIMS.OperationAanesthesia.frmAanesthesiaRecord frmAnasRecord = new AIMS.OperationAanesthesia.frmAanesthesiaRecord();
frmAnasRecord.PatientId = PatientId;
frmAnasRecord.ApplyId = ApplyId;
frmAnasRecord.State = AIMSExtension.EditState.BROWSE;
frmAnasRecord.ShowDialog();
}
else
{
MessageBox.Show("请选择患者");
}
}
private void tsbOperationRecover_Click(object sender, EventArgs e)
{
if (dgv.Rows.Count > 0)
{
int PatientId = int.Parse(dgv.CurrentRow.Cells["PatientId"].Value.ToString());
int ApplyId = int.Parse(dgv.CurrentRow.Cells["ApplyId"].Value.ToString());
AIMS.OperationAanesthesia.frmAanesthesiaRecover frmAnasRecord = new OperationAanesthesia.frmAanesthesiaRecover();
frmAnasRecord.PatientId = PatientId;
frmAnasRecord.ApplyId = ApplyId;
frmAnasRecord.State = AIMSExtension.EditState.BROWSE;
frmAnasRecord.ShowDialog();
}
else
{
MessageBox.Show("请选择患者");
}
}
private void tsbExit_Click(object sender, EventArgs e)
{
Close();
}
private void tsbSet_Click(object sender, EventArgs e)
{
}
private void btnFind_Click(object sender, EventArgs e)
{
dgv.DataSource = BOperationReview.GetOperationReviewDataTable(txtMdrecNo.Text.Trim(), txtPatientName.Text.Trim(),
dtpOperationBeginTime.Value.ToString("yyyy-MM-dd"),
dtpOperationEndTime.Value.AddDays(1).ToString("yyyy-MM-dd")
);
}
private void tspBAGD_Click(object sender, EventArgs e)
{
int count = 0;
for (int i = 0; i < dgv.Rows.Count; i++)
{
bool isChoose = bool.Parse(dgv.Rows[i].Cells[0].EditedFormattedValue.ToString());
if (isChoose)
{
int ApplyId = int.Parse(dgv.Rows[i].Cells["ApplyId"].Value.ToString());
count += BOperationApply.Update(" MedicalRecord='已归档',MedicalRecordTime='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where Id=" + ApplyId, null);
}
}
if (count > 0)
{
MessageBox.Show("提交病案成功!", "系统提示");
btnFind_Click(null, null);
}
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
int count = 0;
for (int i = 0; i < dgv.Rows.Count; i++)
{
bool isChoose = bool.Parse(dgv.Rows[i].Cells[0].EditedFormattedValue.ToString());
if (isChoose)
{
int ApplyId = int.Parse(dgv.Rows[i].Cells["ApplyId"].Value.ToString());
count += BOperationApply.Update(" MedicalRecord=null,MedicalRecordTime=null where Id=" + ApplyId, null);
}
}
if (count > 0)
{
MessageBox.Show("提交病案成功!", "系统提示");
btnFind_Click(null, null);
}
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
if (dgv.Rows.Count > 0)
{
int PatientId = int.Parse(dgv.CurrentRow.Cells["PatientId"].Value.ToString());
int ApplyId = int.Parse(dgv.CurrentRow.Cells["ApplyId"].Value.ToString());
AIMS.OperationAanesthesia.frmAanesthesiaRecord frmAnasRecord = new AIMS.OperationAanesthesia.frmAanesthesiaRecord();
frmAnasRecord.PatientId = PatientId;
frmAnasRecord.ApplyId = ApplyId;
frmAnasRecord.State = AIMSExtension.EditState.BROWSE;
frmAnasRecord.ShowDialog();
}
else
{
MessageBox.Show("请选择患者");
}
}
}
}