You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1992 lines
85 KiB
1992 lines
85 KiB
using DevExpress.XtraGrid.Columns;
|
|
using DevExpress.XtraGrid.Views.Grid;
|
|
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
|
using DevExpress.XtraPrinting.Native;
|
|
using FastReport;
|
|
using PEIS.Base;
|
|
using PEIS.Entity;
|
|
using PEIS.Event;
|
|
using PEIS.Presenter;
|
|
using PEIS.Utils;
|
|
using PEIS.View.Base;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
|
|
namespace PEIS.View.Enrollment
|
|
{
|
|
public partial class EnrollmentOrgForm : ViewBase, IEnrollmentOrgView
|
|
{
|
|
private BasePatient _baseInfo = null;
|
|
private EnrollmentPatient _chooseRegItem = null;
|
|
private EnrollmentPatient _regItem = new EnrollmentPatient();
|
|
private EnrollmentPatient _regInfo = new EnrollmentPatient();
|
|
|
|
// 指引单、报告单
|
|
private FastReport.Report _pReport;
|
|
|
|
private List<EnrollmentOrg> _lstOrg = new List<EnrollmentOrg>();
|
|
private List<BaseOrgPatient> _lstPatient = new List<BaseOrgPatient>();
|
|
private List<EnrollmentOrgGroup> _lstGroup = new List<EnrollmentOrgGroup>();
|
|
private List<FeeItem> _lstFeeItem = new List<FeeItem>();
|
|
private List<FeeItem> _lstFeeItem2 = new List<FeeItem>();
|
|
private List<Pack> _lstPack = new List<Pack>();
|
|
|
|
//List<EnrollmentOrgPatient> _lstGroupPatientTotal = new List<EnrollmentOrgPatient>();
|
|
|
|
private List<EnrollmentCheckCost> _lstCheckCost = new List<EnrollmentCheckCost>();
|
|
private List<EnrollmentCheckCost> _lstCheckCost2 = new List<EnrollmentCheckCost>();
|
|
private List<EnrollmentPatient> _lstEnrollmentPatient = new List<EnrollmentPatient>();
|
|
private List<EnrollmentPatient> _lstExcelEPatient = new List<EnrollmentPatient>();
|
|
private List<EnrollmentFeeItem> _lstEnrollmentFeeItem = new List<EnrollmentFeeItem>();
|
|
private List<EnrollmentOrgFeeItem> _lstGroupFeeItem = new List<EnrollmentOrgFeeItem>();
|
|
private List<EnrollmentOrgPatient> _lstGroupPatient = new List<EnrollmentOrgPatient>();
|
|
|
|
private GridHitInfo _hInfo = new GridHitInfo();
|
|
private Int64 topRowIndex = -1;
|
|
|
|
// 定义一个委托
|
|
public delegate void SelectedPatientDelegate(long? eid);
|
|
// 声明一个事件,供父窗体订阅
|
|
public event SelectedPatientDelegate SelectedPatientEvent;
|
|
|
|
public EnrollmentOrgForm()
|
|
{
|
|
InitializeComponent();
|
|
|
|
// 获取团体登记列表
|
|
TsmiOrgRefresh.Click += TsmiOrgRefresh_Click;
|
|
// 新增团体登记
|
|
TsmiOrgAdd.Click += TsmiOrgAdd_Click;
|
|
// 模糊检索
|
|
NameSearch.KeyDown += NameSearch_KeyDown;
|
|
PatientSearch.TextChanged += PatientSearch_TextChanged;
|
|
|
|
#region 处理日期选择先后
|
|
|
|
DtpBegDate.CloseUp += DtpBegDate_CloseUp;
|
|
DtpEndDate.CloseUp += DtpEndDate_CloseUp;
|
|
|
|
#endregion 处理日期选择先后
|
|
|
|
#region 分组列表按钮
|
|
|
|
OpsGroup.TsmiAdd.Click += TsmiAdd_Click;
|
|
OpsGroup.TsmiDelete.Click += TsmiDelete_Click;
|
|
OpsGroup.TsmiSave.Click += TsmiSave_Click;
|
|
OpsGroup.TsmiRefresh.Visible = false;
|
|
|
|
#endregion 分组列表按钮
|
|
|
|
DgvOrg.SelectionChanged += DgvOrg_SelectionChanged;
|
|
DgvOrg.CustomDrawRowIndicator += DgvOrg_CustomDrawRowIndicator;
|
|
DgvGroup.SelectionChanged += DgvGroup_SelectionChanged;
|
|
DgvGroup2.SelectionChanged += DgvGroup2_SelectionChanged;
|
|
|
|
DgvPatient.MouseDown += DgvPatient_MouseDown;
|
|
DgvPatient.DoubleClick += DgvPatient_DoubleClick;
|
|
RbAll.Click += RbAll_Click;
|
|
RbFit.Click += RbAll_Click;
|
|
NewBaseBtn.Click += NewBaseBtn_Click;
|
|
ImportBtn.Click += ImportBtn_Click;
|
|
|
|
DgvGroupPatient.MouseDown += DgvGroupPatient_MouseDown;
|
|
DgvGroupPatient.DoubleClick += DgvGroupPatient_DoubleClick; ;
|
|
|
|
DgvGroupFeeItem.MouseDown += DgvGroupFeeItem_MouseDown;
|
|
DgvGroupFeeItem.DoubleClick += DgvGroupFeeItem_DoubleClick;
|
|
DgvGroupFeeItem.CustomColumnDisplayText += DgvGroupFeeItem_CustomColumnDisplayText;
|
|
|
|
DgvPack.MouseDown += DgvPack_MouseDown;
|
|
DgvPack.DoubleClick += DgvPack_DoubleClick;
|
|
|
|
DgvFeeItem.MouseDown += DgvFeeItem_MouseDown;
|
|
DgvFeeItem.DoubleClick += DgvFeeItem_DoubleClick;
|
|
|
|
BtnApplyGroupFeeItem.Click += BtnApplyGroupFeeItem_Click;
|
|
|
|
FastCamera.Click += FastCamera_Click;
|
|
DgvEnrollment.SelectionChanged += DgvEnrollment_SelectionChanged;
|
|
DgvEnrollment.CustomDrawRowIndicator += DgvOrg_CustomDrawRowIndicator;
|
|
DgvEnrollment.CustomDrawGroupRow += DgvEnrollment_CustomDrawGroupRow;
|
|
DgvEnrollment.CustomColumnDisplayText += DgvEnrollment_CustomColumnDisplayText;
|
|
|
|
DgvEnrollmentFeeItem.RowStyle += DgvEnrollmentFeeItem_RowStyle;
|
|
DgvEnrollmentFeeItem.MouseDown += DgvEnrollmentFeeItem_MouseDown;
|
|
DgvEnrollmentFeeItem.DoubleClick += DgvEnrollmentFeeItem_DoubleClick;
|
|
DgvEnrollmentFeeItem.CustomDrawRowIndicator += DgvOrg_CustomDrawRowIndicator;
|
|
DgvEnrollmentFeeItem.CustomDrawGroupRow += DgvEnrollmentFeeItem_CustomDrawGroupRow;
|
|
|
|
DgvPack2.MouseDown += DgvPack2_MouseDown;
|
|
DgvPack2.DoubleClick += DgvPack2_DoubleClick;
|
|
|
|
DgvFeeItem2.MouseDown += DgvFeeItem2_MouseDown;
|
|
DgvFeeItem2.DoubleClick += DgvFeeItem2_DoubleClick;
|
|
|
|
TsmiOpenFeeItem.Click += TsmiOpenFeeItem_Click;
|
|
TsmiCheckOrg.Click += TsmiCheck4Org_Click;
|
|
TsmiCheckPerson.Click += TsmiCheck4Person_Click;
|
|
|
|
DgvCheckCost.RowStyle += DgvCheckCost_RowStyle;
|
|
DgvCheckCost.CustomDrawGroupRow += DgvCheckCost_CustomDrawGroupRow;
|
|
DgvCheckCost2.RowStyle += DgvCheckCost2_RowStyle;
|
|
|
|
|
|
// 打印个人收费单
|
|
TsmiPrintPerson.Click += TsmiPrintPerson_Click;
|
|
// 打印团体收费单
|
|
TsmiPrintTeam.Click += TsmiPrintTeam_Click;
|
|
// 打印分组收费单
|
|
TsmiPrintGroup.Click += TsmiPrintGroup_Click;
|
|
// 发送到科室
|
|
TsmiSend.Click += TsmiSend_Click;
|
|
// 打印导检单
|
|
TsmiPrintGuide.Click += TsmiPrintGuide_Click;
|
|
// 批量操作
|
|
TsmiBatchCtrl.Click += TsmiBatchCtrl_Click;
|
|
|
|
Shown += EnrollmentOrgForm_Shown;
|
|
|
|
TcOrg.SelectedPageChanged += TcOrg_SelectedPageChanged;
|
|
DgvPatient.CustomDrawRowIndicator += DgvPatient_CustomDrawRowIndicator;
|
|
DgvGroupPatient.CustomDrawRowIndicator += DgvGroupPatient_CustomDrawRowIndicator;
|
|
FeeItemSearch.TextChanged += FeeItemSearch_TextChanged;
|
|
FeeItemSearch2.TextChanged += FeeItemSearch2_TextChanged;
|
|
FastGroupMove.Click += FastGroupMove_Click;
|
|
FastExport.Click += FastExport_Click;
|
|
FastExportTime.Click += FastExportTime_Click;
|
|
FastDelete.Click += FastDelete_Click;
|
|
FastGroup.Click += FastGroup_Click;
|
|
FastCancelGroup.Click += FastCancelGroup_Click;
|
|
DgvEnrollment.RowCellClick += DgvEnrollment_RowCellClick;
|
|
|
|
|
|
// 撤回发送科室
|
|
FastRecall.Click += FastRecall_Click;
|
|
|
|
#region 团体订单
|
|
TFastCharge.Click += TFastCharge_Click;
|
|
TFastAllCharge.Click += TFastAllCharge_Click;
|
|
TFastDeleteCost.Click += TFastDeleteCost_Click;
|
|
TFastCancelCharge.Click += TFastCancelCharge_Click;
|
|
TFastChangeCost.Click += TFastChangeCost_Click;
|
|
#endregion
|
|
|
|
#region 个人订单
|
|
PFastCharge.Click += PFastCharge_Click;
|
|
PFastAllCharge.Click += PFastAllCharge_Click;
|
|
PFastDeleteCost.Click += PFastDeleteCost_Click;
|
|
PFastCancelCharge.Click += PFastCancelCharge_Click;
|
|
PFastChangeCost.Click += PFastChangeCost_Click;
|
|
PFastRefreshCost.Click += PFastRefreshCost_Click;
|
|
#endregion
|
|
}
|
|
|
|
/// <summary>
|
|
/// TabControl Tab页切换
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void TcOrg_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
|
|
{
|
|
if (!DgvOrg.GetSelectedRows().Any()) return;
|
|
|
|
if (e.Page.Text == @"团体成员收费")
|
|
{
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
}
|
|
|
|
private void EnrollmentOrgForm_Shown(object sender, EventArgs e)
|
|
{
|
|
DtpBegDate.Value = DateTime.Now.AddDays(-30);
|
|
DtpEndDate.Value = DateTime.Now;
|
|
RiCmbExamType.Items.Add("已婚/未婚");
|
|
RiCmbExamType.Items.AddRange(Global._lstConfig.Where(a => a.Key.Equals("ExamType")).ToList().Select(a => a.Value).ToList());
|
|
RiCmbSex.Items.Add("男/女");
|
|
RiCmbSex.Items.Add("男");
|
|
RiCmbSex.Items.Add("女");
|
|
RiCmbMarriage.Items.Add("所有");
|
|
RiCmbMarriage.Items.Add("已婚");
|
|
RiCmbMarriage.Items.Add("未婚");
|
|
|
|
OnGetPack();
|
|
OnGetFeeItem();
|
|
|
|
TsmiOrgRefresh.PerformClick();
|
|
}
|
|
|
|
#region 交互事件
|
|
|
|
private void TsmiOrgRefresh_Click(object sender, EventArgs e) // 获取团体登记列表
|
|
{
|
|
menuStrip2.Focus();
|
|
OnGetEnrollmentOrg(DtpBegDate.Value, DtpEndDate.Value, NameSearch.Text);
|
|
if (!DgvOrg.GetSelectedRows().Any())
|
|
{
|
|
EmptyDataSource();
|
|
return;
|
|
}
|
|
OnGetEnrollmentOrgGroup(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
private void TsmiOrgAdd_Click(object sender, EventArgs e) // 新增团体登记
|
|
{
|
|
//Action<BaseOrg> action = new Action<BaseOrg>(result => SelectOrg(result));
|
|
//SelectOrgForm selectOrgForm = new SelectOrgForm(action);
|
|
//selectOrgForm.ShowDialog();
|
|
var newRegOrgForm = new NewEnrollmentOrgForm();
|
|
newRegOrgForm.ShowDialog();
|
|
TsmiOrgRefresh.PerformClick();
|
|
}
|
|
|
|
private void DgvOrg_SelectionChanged(object sende1r, DevExpress.Data.SelectionChangedEventArgs e) // 团体列表切换
|
|
{
|
|
if (!DgvOrg.GetSelectedRows().Any()) return;
|
|
|
|
// 清空数据源
|
|
EmptyDataSource();
|
|
|
|
OnGetEnrollmentOrgGroup(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
OnGetOrgPatient();
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
private void DgvGroup_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e) // 分组列表切换
|
|
{
|
|
if (!DgvGroup.GetSelectedRows().Any()) return;
|
|
|
|
if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()) == 0) return;
|
|
|
|
RbAll_Click(sender, e);
|
|
// 获取分组人员
|
|
OnGetGroupPatient(Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()));
|
|
}
|
|
|
|
private void TsmiAdd_Click(object sender, EventArgs e) // 添加分组
|
|
{
|
|
if (!DgvOrg.GetSelectedRows().Any()) return;
|
|
|
|
_lstGroup.Add(new EnrollmentOrgGroup
|
|
{
|
|
OID = Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()),
|
|
AgeMin = 0,
|
|
AgeMax = 999,
|
|
Marriage = "所有",
|
|
Sex = "男/女"
|
|
|
|
});
|
|
DgvGroup.RefreshData();
|
|
|
|
// 选中最后一行
|
|
DgvGroup.UnselectRow(0);
|
|
DgvGroup.FocusedRowHandle = _lstGroup.Count - 1;
|
|
DgvGroup.SelectRow(_lstGroup.Count - 1);
|
|
DgvGroup.FocusedColumn = DgvGroup.VisibleColumns[0];
|
|
DgvGroup.ShowEditor();
|
|
}
|
|
|
|
private void TsmiSave_Click(object sender, EventArgs e) // 保存分组添加/修改
|
|
{
|
|
if (!DgvGroup.GetSelectedRows().Any()) return;
|
|
|
|
DgvGroup.CloseEditor();
|
|
DgvGroup.UpdateCurrentRow();
|
|
foreach (var item in _lstGroup)
|
|
{
|
|
item.Sex = item.Sex == null ? "0" : item.Sex.Equals("男") ? "1" : item.Sex.Equals("女") ? "2" : "0";
|
|
switch (item.ID)
|
|
{
|
|
case 0:
|
|
item.Save();
|
|
break;
|
|
|
|
default:
|
|
OnUpdateGroup(item);
|
|
break;
|
|
}
|
|
}
|
|
OnGetEnrollmentOrgGroup(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除分组 Hx
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void TsmiDelete_Click(object sender, EventArgs e) // 删除分组
|
|
{
|
|
if (!DgvGroup.GetSelectedRows().Any()) return;
|
|
|
|
if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()) == 0) return;
|
|
|
|
if (_lstGroupPatient.Count != 0)
|
|
{
|
|
Global.Msg("info", "该分组中已经存在体检者,不能删除,请核对后重试!");
|
|
return;
|
|
}
|
|
|
|
var item = DgvGroup.GetRow(DgvGroup.GetSelectedRows()[0]) as EnrollmentOrgGroup;
|
|
item?.Delete();
|
|
OnGetEnrollmentOrgGroup(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
private void DgvPatient_DoubleClick(object sender, EventArgs e) // 双击添加分组人员
|
|
{
|
|
if (DgvPatient.FocusedRowHandle < 0) return;
|
|
if (!DgvGroup.GetSelectedRows().Any()) return;
|
|
if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()) == 0) return;
|
|
if (!_hInfo.InRowCell) return;
|
|
var item = _lstPatient[_lstPatient.IndexOf(_lstPatient.Where(a => a.ID == Convert.ToInt64(DgvPatient.GetRowCellValue(DgvPatient.GetSelectedRows()[0], "ID").ToString())).ToList()[0])];
|
|
|
|
if ((DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Marriage").ToString() == "所有" ? false : item?.Marriage != DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Marriage").ToString())
|
|
|| !(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Sex").ToString().Contains(item?.Sex))
|
|
|| !(CalculateAge(item?.Birthday?.ToShortDateString()) >= Convert.ToInt16(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "AgeMin").ToString()))
|
|
|| !(CalculateAge(item?.Birthday?.ToShortDateString()) <= Convert.ToInt16(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "AgeMax").ToString())))
|
|
{
|
|
Global.Msg("info", "分组条件不符");
|
|
return;
|
|
}
|
|
|
|
|
|
var enrollmentOrgPatient = new EnrollmentOrgPatient
|
|
{
|
|
Name = item.Name,
|
|
Birthday = item.Birthday,
|
|
CardNo = item.CardNo,
|
|
CardType = item.CardType,
|
|
DeptName = item.DeptName ?? DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Name").ToString(),
|
|
Education = item.Education,
|
|
Marriage = item.Marriage,
|
|
Nation = item.Nation,
|
|
Sex = item.Sex,
|
|
Tel1 = item.Tel1,
|
|
Tel2 = item.Tel2,
|
|
GroupID = Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()),
|
|
OID = Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()),
|
|
PID = item.PID
|
|
};
|
|
enrollmentOrgPatient.Save();
|
|
OnGetGroupPatient(Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()));
|
|
OnGetOrgPatient();
|
|
//RefreshData();
|
|
}
|
|
|
|
private void DgvGroupPatient_DoubleClick(object sender, EventArgs e) // 双击删除分组人员
|
|
{
|
|
if (DgvGroupPatient.FocusedRowHandle < 0) return;
|
|
|
|
OnCheckIsExist(DgvGroupPatient.GetRow(DgvGroupPatient.GetSelectedRows()[0]) as EnrollmentOrgPatient);
|
|
if (_regItem != null)
|
|
{
|
|
Global.Msg("info", "该分组已经同步到该体检者,不能移除,请刷新后重试!");
|
|
return;
|
|
}
|
|
|
|
if (_hInfo.InRowCell)
|
|
{
|
|
var item = DgvGroupPatient.GetRow(DgvGroupPatient.GetSelectedRows()[0]) as EnrollmentOrgPatient;
|
|
item?.Delete();
|
|
OnGetGroupPatient(Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()));
|
|
OnGetOrgPatient();
|
|
}
|
|
}
|
|
|
|
private void DgvGroup2_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e) // 切换分组
|
|
{
|
|
if (!DgvGroup2.GetSelectedRows().Any()) return;
|
|
// 获取分组收费项目
|
|
OnGetEnrollmentOrgFeeItem(Convert.ToInt64(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "ID").ToString()));
|
|
// 获取分组人员
|
|
OnGetGroupPatient(Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()));
|
|
|
|
DgcPack.DataSource = _lstPack.Where(w => w.Sex.Equals("所有") || w.Sex.Equals(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "Sex").ToString()));
|
|
}
|
|
|
|
private void BtnApplyGroupFeeItem_Click(object sender, EventArgs e) // 应用收费模板
|
|
{
|
|
if (!DgvGroup2.GetSelectedRows().Any()) return;
|
|
|
|
if (!DgvGroupFeeItem.GetSelectedRows().Any()) return;
|
|
|
|
if (!DgvGroupPatient.GetSelectedRows().Any())
|
|
{
|
|
Global.Msg("info", "该分组中没有成员,不能同步,请刷新后重试!");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "是否将收费模板应用到当前分组成员?") == System.Windows.Forms.DialogResult.No) return;
|
|
|
|
OnApplyGroupFeeItem(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "ID").ToString()));
|
|
|
|
|
|
}
|
|
|
|
private void DgvFeeItem_DoubleClick(object sender, EventArgs e) // 双击添加分组项目
|
|
{
|
|
if (DgvFeeItem.FocusedRowHandle < 0) return;
|
|
if (!DgvGroup2.GetSelectedRows().Any()) return;
|
|
if (!_hInfo.InRowCell) return;
|
|
if (DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "CheckTime")?.ToString() != null)
|
|
{
|
|
Global.Msg("info", "该分组项目已经同步,不能修改,请刷新后重试!");
|
|
return;
|
|
}
|
|
|
|
var items = _lstGroupFeeItem.Where(a => a?.KeyNo == DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "KeyNo").ToString()).ToList();
|
|
if (items.Count != 0)
|
|
{
|
|
Global.Msg("info", "已存在该收费项目,请勿重复添加!");
|
|
return;
|
|
}
|
|
|
|
OnAddEnrollmentOrgFeeItem(Convert.ToInt64(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), -1, Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "OID").ToString()), Convert.ToInt64(DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
private void DgvPack_DoubleClick(object sender, EventArgs e) // 双击添加分组套餐
|
|
{
|
|
if (DgvPack.FocusedRowHandle < 0) return;
|
|
if (!DgvGroup2.GetSelectedRows().Any()) return;
|
|
|
|
if (!_hInfo.InRowCell) return;
|
|
if (DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "CheckTime")?.ToString() != null)
|
|
{
|
|
Global.Msg("info", "该分组项目已经同步,不能修改,请刷新后重试!");
|
|
return;
|
|
}
|
|
|
|
if (_lstGroupFeeItem?.Count != 0)
|
|
{
|
|
Global.Msg("info", "该分组已有收费项目,不能添加套餐,套餐只能最先添加,请核对后重试!");
|
|
return;
|
|
}
|
|
|
|
OnAddEnrollmentOrgFeeItem(Convert.ToInt64(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvPack.GetRowCellValue(DgvPack.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "OID").ToString()), -1);
|
|
}
|
|
|
|
private void DgvGroupFeeItem_DoubleClick(object sender, EventArgs e) // 双击删除分组项目
|
|
{
|
|
if (DgvGroupFeeItem.FocusedRowHandle < 0) return;
|
|
|
|
if (!_hInfo.InRowCell) return;
|
|
|
|
var item = DgvGroupFeeItem.GetRow(DgvGroupFeeItem.GetSelectedRows()[0]) as EnrollmentOrgFeeItem;
|
|
|
|
if (DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "CheckTime")?.ToString() != null)
|
|
{
|
|
Global.Msg("info", "该分组项目已经同步,不能修改,请刷新后重试!");
|
|
return;
|
|
}
|
|
|
|
if (DgvGroupFeeItem.FocusedColumn.ToString() == "套餐" && item.PackId != null)
|
|
{
|
|
if (Global.Msg("warn", "确定移除当前套餐吗?") == DialogResult.No) return;
|
|
OnDelItemByPackId(0, Convert.ToInt64(item?.GroupID), Convert.ToInt64(item?.PackId));
|
|
OnGetEnrollmentOrgFeeItem(Convert.ToInt64(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "ID").ToString()));
|
|
return;
|
|
}
|
|
|
|
|
|
item?.Delete();
|
|
OnGetEnrollmentOrgFeeItem(Convert.ToInt64(DgvGroup2.GetRowCellValue(DgvGroup2.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
private void DgvEnrollment_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e) // 切换人员登记列表
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null) return;
|
|
_chooseRegItem = DgvEnrollment.GetRow(DgvEnrollment.GetSelectedRows()[0]) as EnrollmentPatient;
|
|
|
|
topRowIndex = _chooseRegItem.ID;
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
|
|
DgcPack2.DataSource = _lstPack.Where(w => w.Sex.Equals("所有") || w.Sex.Equals(DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "Sex").ToString()));
|
|
|
|
SelectedPatientEvent?.Invoke(_chooseRegItem.ID);
|
|
int rowHandle = DgvCheckCost.LocateByValue("EID", topRowIndex);
|
|
DgvCheckCost.FocusedRowHandle = rowHandle;
|
|
DgvCheckCost.SelectRow(rowHandle);
|
|
}
|
|
|
|
private void DgvEnrollmentFeeItem_DoubleClick(object sender, EventArgs e) // 双击删除个人项目
|
|
{
|
|
if (DgvEnrollmentFeeItem.FocusedRowHandle < 0) return;
|
|
|
|
if (_hInfo.InRowCell)
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
var item = DgvEnrollmentFeeItem.GetRow(DgvEnrollmentFeeItem.GetSelectedRows()[0]) as EnrollmentFeeItem;
|
|
if (item?.OrderNo != null)
|
|
{
|
|
Global.Msg("info", "已生成订单不可取消!");
|
|
return;
|
|
}
|
|
|
|
if (DgvEnrollmentFeeItem.FocusedColumn.ToString() == "套餐" && item.PackId != null)
|
|
{
|
|
if (Global.Msg("warn", "确定移除当前套餐吗?") == DialogResult.No) return;
|
|
OnDelItemByPackId(1, Convert.ToInt64(item?.EID), Convert.ToInt64(item?.PackId));
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
return;
|
|
}
|
|
|
|
item?.Delete();
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
}
|
|
}
|
|
|
|
private void DgvFeeItem2_DoubleClick(object sender, EventArgs e) // 双击添加个人项目
|
|
{
|
|
if (DgvFeeItem2.FocusedRowHandle < 0) return;
|
|
if (!DgvEnrollment.GetSelectedRows().Any()) return;
|
|
|
|
if (!_hInfo.InRowCell) return;
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
var items = _lstEnrollmentFeeItem.Where(a => a?.KeyNo == DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "KeyNo").ToString()).ToList();
|
|
if (items.Count != 0)
|
|
{
|
|
Global.Msg("info", "已存在该收费项目,请勿重复添加!");
|
|
return;
|
|
}
|
|
|
|
var item = new EnrollmentFeeItem()
|
|
{
|
|
EID = _chooseRegItem.ID,
|
|
FID = Convert.ToInt64(DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "ID").ToString()),
|
|
FeeItemCode = DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "FeeItemCode")?.ToString(),
|
|
FeeItemName = DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "FeeItemName")?.ToString(),
|
|
Quantity = 1,
|
|
Unit = DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "Unit")?.ToString(),
|
|
Price = Convert.ToDecimal(DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "Price")?.ToString()),
|
|
SettlePrice = Convert.ToDecimal(DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "SettlePrice")?.ToString()),
|
|
ItemClass = DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "ItemClass")?.ToString(),
|
|
CreateTime = DateTime.Now,
|
|
CreatorCode = Global.currentUser.Code,
|
|
Creator = Global.currentUser.Name,
|
|
DeptCode = DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "DeptCode")?.ToString(),
|
|
DeptName = DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "DeptName")?.ToString(),
|
|
Seq = null,
|
|
KeyNo = DgvFeeItem2.GetRowCellValue(DgvFeeItem2.GetSelectedRows()[0], "KeyNo")?.ToString()
|
|
};
|
|
item.Save();
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void DgvPack2_DoubleClick(object sender, EventArgs e) // 双击添加个人套餐
|
|
{
|
|
if (DgvPack2.FocusedRowHandle < 0) return;
|
|
if (!DgvEnrollment.GetSelectedRows().Any()) return;
|
|
|
|
if (!_hInfo.InRowCell) return;
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (_lstEnrollmentFeeItem?.Count != 0)
|
|
{
|
|
Global.Msg("info", "该分组已有收费项目,不能添加套餐,套餐只能最先添加,请核对后重试!");
|
|
return;
|
|
}
|
|
|
|
OnAddEnrollmentFeeItemByPack(_chooseRegItem.ID, Convert.ToInt64(DgvPack2.GetRowCellValue(DgvPack2.GetSelectedRows()[0], "ID").ToString()), DgvPack2.GetRowCellValue(DgvPack2.GetSelectedRows()[0], "Name").ToString());
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void TsmiPrintCost_Click(object sender, EventArgs e) // 打印收费单
|
|
{
|
|
//if (TabCheckCost.SelectedTabPage == OrgCheckCost)
|
|
//{
|
|
// if (!_lstCheckCost.Any() || _lstCheckCost.Where(w => w.CostTime == null).ToList().Count == 0) return;
|
|
|
|
// try
|
|
// {
|
|
// var list = _lstCheckCost.Where(w => w.CostTime == null).ToList();
|
|
|
|
// _pReport = ReportHelper.PrintTCheckCost(list, DgvOrg.GetRow(DgvOrg.GetSelectedRows()[0]) as EnrollmentOrg);
|
|
// _pReport.Show();
|
|
// _pReport.Dispose();
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// Global.Msg("info", ex.Message);
|
|
// }
|
|
//}
|
|
//else
|
|
//{
|
|
// if (!_lstCheckCost2.Any() || _lstCheckCost2.Where(w => w.CostTime == null).ToList().Count == 0) return;
|
|
|
|
// try
|
|
// {
|
|
// var list = _lstCheckCost2.Where(w => w.CostTime == null && w.OEID == null).ToList();
|
|
|
|
// _pReport = ReportHelper.PrintCheckCost(list, DgvEnrollment.GetRow(DgvEnrollment.GetSelectedRows()[0]) as EnrollmentPatient);
|
|
// _pReport.Show();
|
|
// _pReport.Dispose();
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// Global.Msg("info", ex.Message);
|
|
// }
|
|
//}
|
|
}
|
|
|
|
private void TsmiSend_Click(object sender, EventArgs e) // 发送到科室
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (_lstCheckCost != null && !_lstCheckCost.Concat(_lstCheckCost2).Any())
|
|
{
|
|
Global.Msg("info", "暂无订单!");
|
|
return;
|
|
}
|
|
|
|
var eid = _chooseRegItem.ID;
|
|
|
|
if (_lstCheckCost?.Concat(_lstCheckCost2).Where(w => w.ChargeTime == null && w.EID == eid).ToList().Count != 0)
|
|
{
|
|
Global.Msg("info", "订单还未收费或未记账,不能操作,请核对后重试!");
|
|
return;
|
|
}
|
|
|
|
if (_lstCheckCost?.Concat(_lstCheckCost2).Where(w => w.SendTime == null && w.EID == eid).ToList().Count == 0)
|
|
{
|
|
Global.Msg("info", "所有订单已发送!");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "确定要发送吗?") == DialogResult.No) return;
|
|
|
|
OnSendToDept(eid);
|
|
}
|
|
|
|
private void TsmiPrintGuide_Click(object sender, EventArgs e) // 打印导检单
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (_lstEnrollmentFeeItem.Count == 0)
|
|
{
|
|
Global.Msg("info", "暂无收费项目!");
|
|
return;
|
|
}
|
|
|
|
var eid = _chooseRegItem.ID;
|
|
OnGetRegInfo(eid);
|
|
if (_lstCheckCost.Concat(_lstCheckCost2).Where(w => w.EID == eid).ToList().Count == 0)
|
|
{
|
|
Global.Msg("info", "未生成订单!");
|
|
return;
|
|
}
|
|
|
|
|
|
if (_lstCheckCost.Concat(_lstCheckCost2).Where(w => w.SendTime == null && w.EID == eid).ToList().Count != 0)
|
|
{
|
|
Global.Msg("info", "订单未发送!");
|
|
return;
|
|
}
|
|
|
|
try
|
|
{
|
|
var items = new List<EnrollmentFeeItem>();
|
|
_lstEnrollmentFeeItem.Where(w => w.OrderNo != null && !w.IsHide ).GroupBy(g => g.DeptCode).ForEach(dept =>
|
|
{
|
|
var item = new EnrollmentFeeItem()
|
|
{
|
|
DeptName = dept.FirstOrDefault()?.DeptName,
|
|
FeeItemName = string.Join(@"、", dept.Select(s => s.FeeItemName).ToList()),
|
|
Address = dept.FirstOrDefault()?.Address
|
|
};
|
|
items.Add(item);
|
|
});
|
|
|
|
_pReport = ReportHelper.PrintGuide(items, _regInfo);
|
|
_pReport.Show();
|
|
_pReport.Dispose();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Global.Msg("info", ex.Message);
|
|
}
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
private void RbAll_Click(object sender, EventArgs e) // 选择未分组人员
|
|
{
|
|
if (RbAll.Checked)
|
|
{
|
|
RbFit.Checked = false;
|
|
ImportBtn.Visible = false;
|
|
DgcPatient.DataSource = _lstPatient;
|
|
}
|
|
else
|
|
{
|
|
RbAll.Checked = false;
|
|
ImportBtn.Visible = true;
|
|
DgcPatient.DataSource = _lstPatient.Where(a => (DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Marriage").ToString() == "所有" ? true : a?.Marriage == DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Marriage").ToString())
|
|
&& (DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Sex").ToString().Contains(a?.Sex))
|
|
&& (CalculateAge(a?.Birthday?.ToShortDateString()) > Convert.ToInt16(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "AgeMin").ToString()))
|
|
&& (CalculateAge(a?.Birthday?.ToShortDateString()) < Convert.ToInt16(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "AgeMax").ToString())));
|
|
}
|
|
}
|
|
|
|
private void NewBaseBtn_Click(object sender, EventArgs e) // 新增成员
|
|
{
|
|
Action<BasePatient> action = result => SelectPerson(result);
|
|
SelectPatientForm selectPatientForm = new SelectPatientForm(action, "");
|
|
selectPatientForm.ShowDialog();
|
|
}
|
|
|
|
public void SelectPerson(BasePatient item)
|
|
{
|
|
if (item.ID == 0)
|
|
{
|
|
OnGetPid(item);
|
|
}
|
|
|
|
if (_lstPatient.Where(w => w.PID == item?.ID).ToList().Count != 0)
|
|
{
|
|
Global.Msg("info", "团体已有该成员!");
|
|
return;
|
|
}
|
|
|
|
if(_lstGroupPatient.Where(w => w.PID == item?.ID).ToList().Count != 0)
|
|
{
|
|
Global.Msg("info", "该成员已应用到分组!");
|
|
return;
|
|
}
|
|
|
|
OnAddOrgPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "OID").ToString()), item.ID == 0 ? _baseInfo.ID : item.ID);
|
|
RbAll_Click(new object(), new EventArgs());
|
|
// 获取分组人员
|
|
OnGetOrgPatient();
|
|
}
|
|
|
|
private void ImportBtn_Click(object sender, EventArgs e) // 全部导入
|
|
{
|
|
if (!DgvPatient.GetSelectedRows().Any()) return;
|
|
if (Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()) == 0) return;
|
|
|
|
var item = new EnrollmentOrgPatient();
|
|
var orgPatients = _lstPatient.Where(a => (DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Marriage").ToString() == "所有" ? true : a?.Marriage == DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Marriage").ToString())
|
|
&& (DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Sex").ToString().Contains(a?.Sex))
|
|
&& (CalculateAge(a?.Birthday?.ToShortDateString()) > Convert.ToInt16(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "AgeMin").ToString()))
|
|
&& (CalculateAge(a?.Birthday?.ToShortDateString()) < Convert.ToInt16(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "AgeMax").ToString())));
|
|
|
|
orgPatients.ForEach(a =>
|
|
{
|
|
item.GroupID = Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString());
|
|
item.PID = a.PID;
|
|
item.OID = Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString());
|
|
item.DeptName = item.DeptName ?? DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Name").ToString();
|
|
|
|
item.Save();
|
|
});
|
|
|
|
OnGetGroupPatient(Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()));
|
|
OnGetOrgPatient();
|
|
RbAll.Checked = true;
|
|
RbFit.Checked = false;
|
|
ImportBtn.Visible = false;
|
|
}
|
|
|
|
private void FastCamera_Click(object sender, EventArgs e) // 拍照编辑信息
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
OnGetRegInfo(_chooseRegItem.ID);
|
|
NewEnrollmentPersonForm enrollmentPersonForm = new NewEnrollmentPersonForm(_regInfo, true);
|
|
enrollmentPersonForm.ShowDialog();
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
private void TsmiBatchCtrl_Click(object sender, EventArgs e) // 批量操作
|
|
{
|
|
if (!DgvEnrollment.GetSelectedRows().Any()) return;
|
|
|
|
BatchForm batchForm = new BatchForm(_lstEnrollmentPatient);
|
|
batchForm.ShowDialog();
|
|
}
|
|
|
|
private void NameSearch_KeyDown(object sender, KeyEventArgs e) // 模糊检索
|
|
{
|
|
if (e.KeyCode == Keys.Enter)
|
|
OnGetEnrollmentOrg(DtpBegDate.Value, DtpEndDate.Value, NameSearch.Text);
|
|
}
|
|
|
|
private void FeeItemSearch_TextChanged(object sender, EventArgs e) // 收费项目检索
|
|
{
|
|
DgcFeeItem.DataSource = _lstFeeItem.Where(a => a?.FeeItemName.Contains(FeeItemSearch.Text) == true);
|
|
}
|
|
|
|
private void FeeItemSearch2_TextChanged(object sender, EventArgs e) // 收费项目检索
|
|
{
|
|
DgcFeeItem2.DataSource = _lstFeeItem2.Where(a => a?.FeeItemName.Contains(FeeItemSearch2.Text) == true);
|
|
}
|
|
|
|
private void PatientSearch_TextChanged(object sender, EventArgs e) // 团体成员检索
|
|
{
|
|
DgcEnrollment.DataSource = _lstEnrollmentPatient.Where(a => a?.Name.Contains(PatientSearch.Text) == true || a?.ID.ToString().Contains(PatientSearch.Text) == true || a?.SpellCode?.Contains(PatientSearch.Text) == true);
|
|
DgvEnrollment.ExpandAllGroups();
|
|
}
|
|
|
|
private void FastGroupMove_Click(object sender, EventArgs e) // 批量移除分组成员
|
|
{
|
|
var itemList = new List<EnrollmentOrgPatient>();
|
|
_lstGroupPatient.ForEach(item =>
|
|
{
|
|
OnCheckIsExist(item);
|
|
if (_regItem == null)
|
|
{
|
|
itemList.Add(item);
|
|
}
|
|
});
|
|
|
|
if (itemList.Count() != 0)
|
|
{
|
|
itemList.ForEach(item =>
|
|
{
|
|
item?.Delete();
|
|
});
|
|
OnGetGroupPatient(Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()), Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()));
|
|
OnGetOrgPatient();
|
|
}
|
|
else
|
|
{
|
|
Global.Msg("info", "该分组所有成员已同步,不可移除!");
|
|
}
|
|
}
|
|
|
|
private void FastExport_Click(object sender, EventArgs e) // 导出所有团体成员
|
|
{
|
|
OnGetExcelList();
|
|
|
|
if (_lstExcelEPatient.Count != 0)
|
|
{
|
|
var rpt = new FastReport.Report(); //实例化一个Report报表
|
|
try
|
|
{
|
|
var reportFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "OrgExcel.frx");
|
|
rpt.Load(reportFile);
|
|
|
|
rpt.SetParameterValue("TotalCount", _lstExcelEPatient.Count());
|
|
rpt.SetParameterValue("No", _lstExcelEPatient.Where(w => w.SignTime == null).ToList().Count());
|
|
rpt.SetParameterValue("Yes", _lstExcelEPatient.Where(w => w.SignTime != null).ToList().Count());
|
|
rpt.SetParameterValue("OrgName", DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "Name").ToString());
|
|
rpt.SetParameterValue("TotalFee", _lstExcelEPatient.Sum(s => s.Fee));
|
|
|
|
// 人员数据
|
|
rpt.RegisterData(_lstExcelEPatient, "O");
|
|
DataBand checkCost = rpt.Report.FindObject("OrgExcel") as DataBand;
|
|
checkCost.DataSource = rpt.Report.GetDataSource("O");
|
|
rpt.GetDataSource("O").Enabled = true;
|
|
|
|
rpt.Prepare();
|
|
rpt.Show();
|
|
}
|
|
catch (Exception)
|
|
{
|
|
Global.MsgErr("预览失败,请联系管理员!");
|
|
}
|
|
}
|
|
}
|
|
|
|
private void FastExportTime_Click(object sender, EventArgs e) // 导出指定时间范围成员
|
|
{
|
|
OnGetExcelList();
|
|
|
|
DateTime currentDate = DateTime.Now;
|
|
|
|
Form dateForm = new Form();
|
|
dateForm.Font = new Font("微软雅黑", 12);
|
|
dateForm.Text = "时间选择器";
|
|
dateForm.StartPosition = FormStartPosition.CenterScreen;
|
|
dateForm.Size = new Size(330, 226);
|
|
|
|
Label begLabel = new Label();
|
|
begLabel.Location = new Point(10, 20);
|
|
begLabel.Text = "开始时间:";
|
|
|
|
DateTimePicker begTime = new DateTimePicker();
|
|
begTime.Location = new Point(110, 20);
|
|
begTime.Value = currentDate.AddDays(-6);
|
|
|
|
Label endLabel = new Label();
|
|
endLabel.Location = new Point(10, 70);
|
|
endLabel.Text = "结束时间:";
|
|
|
|
DateTimePicker endTime = new DateTimePicker();
|
|
endTime.Location = new Point(110, 70);
|
|
endTime.Value = currentDate;
|
|
|
|
Button confirmBtn = new Button();
|
|
confirmBtn.Text = "确认选择";
|
|
confirmBtn.Location = new Point(110, 120);
|
|
confirmBtn.AutoSize = true;
|
|
confirmBtn.Click += delegate (object a, EventArgs b)
|
|
{
|
|
if (_lstExcelEPatient.Count != 0)
|
|
{
|
|
var rpt = new FastReport.Report(); //实例化一个Report报表
|
|
try
|
|
{
|
|
var reportFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "OrgExcel.frx");
|
|
rpt.Load(reportFile);
|
|
|
|
var list = _lstExcelEPatient.Where(w => w.SignTime > begTime.Value.Date && w.SignTime < endTime.Value.AddDays(1).Date);
|
|
|
|
rpt.SetParameterValue("TotalCount", list.Count());
|
|
rpt.SetParameterValue("No", list.Where(w => w.SignTime == null).ToList().Count());
|
|
rpt.SetParameterValue("Yes", list.Where(w => w.SignTime != null).ToList().Count());
|
|
rpt.SetParameterValue("OrgName", DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "Name").ToString());
|
|
rpt.SetParameterValue("TotalFee", list.Sum(s => s.Fee));
|
|
|
|
// 人员数据
|
|
rpt.RegisterData(list, "O");
|
|
DataBand checkCost = rpt.Report.FindObject("OrgExcel") as DataBand;
|
|
checkCost.DataSource = rpt.Report.GetDataSource("O");
|
|
rpt.GetDataSource("O").Enabled = true;
|
|
|
|
rpt.Prepare();
|
|
rpt.Show();
|
|
}
|
|
catch (Exception)
|
|
{
|
|
Global.MsgErr("预览失败,请联系管理员!");
|
|
}
|
|
}
|
|
dateForm.Close();
|
|
};
|
|
|
|
dateForm.Controls.Add(begLabel);
|
|
dateForm.Controls.Add(begTime);
|
|
dateForm.Controls.Add(endLabel);
|
|
dateForm.Controls.Add(endTime);
|
|
dateForm.Controls.Add(confirmBtn);
|
|
dateForm.ShowDialog();
|
|
}
|
|
|
|
private void FastDelete_Click(object sender, EventArgs e) // 删除未签到成员
|
|
{
|
|
EnrollmentPatient item = DgvEnrollment.GetRow(DgvEnrollment.GetSelectedRows()[0]) as EnrollmentPatient;
|
|
if (item.Signer != null) return;
|
|
OnCancelRegInfo(item.ID);
|
|
}
|
|
|
|
private void DgvEnrollment_RowCellClick(object sender, RowCellClickEventArgs e)
|
|
{
|
|
if (e.Column.AbsoluteIndex == 0)
|
|
{
|
|
string midValueStr = DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "IsSelected")?.ToString();
|
|
if (midValueStr == "0" || midValueStr == "")
|
|
{
|
|
DgvEnrollment.SetRowCellValue(e.RowHandle, "IsSelected", 1);
|
|
}
|
|
else
|
|
{
|
|
DgvEnrollment.SetRowCellValue(e.RowHandle, "IsSelected", 0);
|
|
}
|
|
return;
|
|
}
|
|
} // 勾选
|
|
|
|
private void FastCancelGroup_Click(object sender, EventArgs e) // 取消组合缴费
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
|
|
var idList = new List<Int64>();
|
|
for (int i = 0; i < DgvEnrollment.RowCount; i++)
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(i, "IsSelected") != null && DgvEnrollment.GetRowCellValue(i, "IsSelected").ToString() == "1")
|
|
{
|
|
idList.Add(Convert.ToInt64(DgvEnrollment.GetRowCellValue(i, "ID").ToString()));
|
|
}
|
|
}
|
|
|
|
if (idList.Count == 0) return;
|
|
|
|
OnCancelGroupTag(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), idList);
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
Invoke(new Action(() =>
|
|
{
|
|
DgcCheckCost.DataSource = null;
|
|
DgcCheckCost2.DataSource = null;
|
|
DgcEnrollmentFeeItem.DataSource = null;
|
|
}));
|
|
//OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
|
|
|
|
}
|
|
|
|
private void FastGroup_Click(object sender, EventArgs e) // 组合缴费
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
|
|
var idList = new List<Int64>();
|
|
for (int i = 0; i < DgvEnrollment.RowCount; i++)
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(i, "IsSelected") != null && DgvEnrollment.GetRowCellValue(i, "IsSelected").ToString() == "1")
|
|
{
|
|
idList.Add(Convert.ToInt64(DgvEnrollment.GetRowCellValue(i, "ID").ToString()));
|
|
}
|
|
}
|
|
|
|
if (idList.Count == 0) return;
|
|
|
|
OnGroupTag(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), idList);
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
Invoke(new Action(() =>
|
|
{
|
|
DgcCheckCost.DataSource = null;
|
|
DgcCheckCost2.DataSource = null;
|
|
DgcEnrollmentFeeItem.DataSource = null;
|
|
}));
|
|
//OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
}
|
|
|
|
private void TsmiPrintGroup_Click(object sender, EventArgs e) // 打印分组收费单
|
|
{
|
|
if (!_lstCheckCost.Any() || _lstCheckCost.Where(w => w.CostTime == null && w.CancelTime == null).ToList().Count == 0) return;
|
|
|
|
try
|
|
{
|
|
var list = _lstCheckCost.Where(w => w.CostTime == null && w.GroupTag && w.CancelTime == null).ToList();
|
|
|
|
_pReport = ReportHelper.PrintTCheckCost(list, DgvOrg.GetRow(DgvOrg.GetSelectedRows()[0]) as EnrollmentOrg);
|
|
_pReport.Show();
|
|
_pReport.Dispose();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Global.Msg("info", ex.Message);
|
|
}
|
|
}
|
|
|
|
private void TsmiPrintTeam_Click(object sender, EventArgs e) // 打印团体收费单
|
|
{
|
|
if (!_lstCheckCost.Any() || _lstCheckCost.Where(w => w.CostTime == null && w.CancelTime == null).ToList().Count == 0) return;
|
|
|
|
try
|
|
{
|
|
var list = _lstCheckCost.Where(w => w.CostTime == null && w.CancelTime == null).ToList();
|
|
|
|
_pReport = ReportHelper.PrintTCheckCost(list, DgvOrg.GetRow(DgvOrg.GetSelectedRows()[0]) as EnrollmentOrg);
|
|
_pReport.Show();
|
|
_pReport.Dispose();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Global.Msg("info", ex.Message);
|
|
}
|
|
}
|
|
|
|
private void TsmiPrintPerson_Click(object sender, EventArgs e) // 打印个人收费单
|
|
{
|
|
if (!_lstCheckCost2.Any() || _lstCheckCost2.Where(w => w.CostTime == null && w.CancelTime == null).ToList().Count == 0) return;
|
|
|
|
try
|
|
{
|
|
var list = _lstCheckCost2.Where(w => w.CostTime == null && w.OEID == null && w.CancelTime == null).ToList();
|
|
|
|
_pReport = ReportHelper.PrintCheckCost(list, DgvEnrollment.GetRow(DgvEnrollment.GetSelectedRows()[0]) as EnrollmentPatient);
|
|
_pReport.Show();
|
|
_pReport.Dispose();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Global.Msg("info", ex.Message);
|
|
}
|
|
}
|
|
|
|
private void FastRecall_Click(object sender, EventArgs e)
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
|
|
EnrollmentPatient item = DgvEnrollment.GetRow(DgvEnrollment.GetSelectedRows()[0]) as EnrollmentPatient;
|
|
if (item.SignTime == null) return;
|
|
OnRecallDept(item.ID);
|
|
} // 撤回发送
|
|
|
|
#region 团体订单
|
|
|
|
private void TFastCancelCharge_Click(object sender, EventArgs e) // 取消记账
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost.GetRow(DgvCheckCost.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
if (item?.SendTime != null)
|
|
{
|
|
Global.Msg("info", "该订单已发送不能取消!");
|
|
return;
|
|
}
|
|
|
|
if (item?.ChargeTime == null)
|
|
{
|
|
Global.Msg("info", "该订单未记账!");
|
|
return;
|
|
}
|
|
|
|
OnCancelCharge(item.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
}
|
|
|
|
private void TFastDeleteCost_Click(object sender, EventArgs e) // 删除订单
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost.GetRow(DgvCheckCost.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
if (item?.Fee == 0 && item?.SendTime == null)
|
|
{
|
|
if (item != null) OnDeleteOrder(item.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
return;
|
|
}
|
|
|
|
if (item?.ChargeTime != null || item?.CostTime != null)
|
|
{
|
|
Global.Msg("info", "该订单已收费或已记账,不能删除!");
|
|
return;
|
|
}
|
|
|
|
if(item?.CancelTime != null)
|
|
{
|
|
Global.Msg("info", "该订单为退费订单留存记录,不能删除!");
|
|
return;
|
|
}
|
|
|
|
if (item == null) return;
|
|
OnDeleteOrder(item.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void TFastAllCharge_Click(object sender, EventArgs e) // 全部记账
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost.GetSelectedRows().Count() == 0) return;
|
|
if (_lstCheckCost == null || _lstCheckCost.Count == 0) return;
|
|
|
|
if (_lstCheckCost.Where(w => w.ChargeTime == null).ToList().Count == 0)
|
|
{
|
|
Global.Msg("info", "所有订单已记账!");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "确定要记账吗?未发送前可以取消记账,发送后不能取消记账!") == DialogResult.No) return;
|
|
|
|
OnFeeCheckCost(1, Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), "0");
|
|
}
|
|
|
|
private void TFastCharge_Click(object sender, EventArgs e) // 单条记账
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost.GetRow(DgvCheckCost.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
if (item.SendTime != null || item.ChargeTime != null) return;
|
|
|
|
if (Global.Msg("warn", "确定要记账吗?未发送前可以取消记账,发送后不能取消记账!") == System.Windows.Forms.DialogResult.No) return;
|
|
|
|
OnFeeCheckCost(1, item.ID, "1");
|
|
|
|
}
|
|
|
|
private void TFastChangeCost_Click(object sender, EventArgs e) // 订单转换
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost.GetRow(DgvCheckCost.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
if (item.GroupTag)
|
|
{
|
|
Global.Msg("info", "该订单已分组设置收费,不可转换!");
|
|
return;
|
|
}
|
|
|
|
OnChangeCost(item.ID, 0);
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 个人订单
|
|
|
|
private void PFastChangeCost_Click(object sender, EventArgs e) // 订单转换
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost2.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost2.GetRow(DgvCheckCost2.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
OnChangeCost(item.ID, Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
}
|
|
|
|
private void PFastCancelCharge_Click(object sender, EventArgs e) // 取消记账
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost2.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost2.GetRow(DgvCheckCost2.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
if (item?.SendTime != null)
|
|
{
|
|
Global.Msg("info", "该订单已发送不能取消!");
|
|
return;
|
|
}
|
|
|
|
if (item?.ChargeTime == null)
|
|
{
|
|
Global.Msg("info", "该订单未记账!");
|
|
return;
|
|
}
|
|
|
|
OnCancelCharge(item.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
}
|
|
|
|
private void PFastDeleteCost_Click(object sender, EventArgs e) // 删除订单
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost2.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost2.GetRow(DgvCheckCost2.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
if (item?.Fee == 0 && item?.SendTime == null)
|
|
{
|
|
if (item != null)
|
|
OnDeleteOrder(item.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
return;
|
|
}
|
|
|
|
if (item?.ChargeTime != null || item?.CostTime != null)
|
|
{
|
|
Global.Msg("info", "该订单已收费或已记账,不能删除!");
|
|
return;
|
|
}
|
|
|
|
if (item?.CancelTime != null)
|
|
{
|
|
Global.Msg("info", "该订单为退费订单留存记录,不能删除!");
|
|
return;
|
|
}
|
|
|
|
if (item == null) return;
|
|
OnDeleteOrder(item.ID);
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void PFastAllCharge_Click(object sender, EventArgs e) // 全部记账
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost2.GetSelectedRows().Count() == 0) return;
|
|
if (_lstCheckCost2 == null || _lstCheckCost2.Count == 0) return;
|
|
|
|
if (_lstCheckCost2.Where(w => w.ChargeTime == null).ToList().Count == 0)
|
|
{
|
|
Global.Msg("info", "所有订单已记账!");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "确定要记账吗?未发送前可以取消记账,发送后不能取消记账!") == DialogResult.No) return;
|
|
|
|
OnFeeCheckCost(0, _chooseRegItem.ID, "0");
|
|
}
|
|
|
|
private void PFastCharge_Click(object sender, EventArgs e) // 单条记账
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (DgvCheckCost2.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost2.GetRow(DgvCheckCost2.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
if (item.SendTime != null || item.ChargeTime != null) return;
|
|
|
|
if (Global.Msg("warn", "确定要记账吗?未发送前可以取消记账,发送后不能取消记账!") == System.Windows.Forms.DialogResult.No) return;
|
|
|
|
OnFeeCheckCost(0, item.ID, "1");
|
|
}
|
|
|
|
private void PFastRefreshCost_Click(object sender, EventArgs e) // 刷新订单
|
|
{
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion 交互事件
|
|
|
|
private void DgvCheckCost_RowStyle(object sender, RowStyleEventArgs e)
|
|
{
|
|
if (DgvCheckCost.RowCount == 0) return;
|
|
if (DgvCheckCost.GetRowCellValue(e.RowHandle, "SendTime") != null)
|
|
{
|
|
e.Appearance.ForeColor = Color.FromArgb(103, 194, 58);
|
|
}
|
|
else if (DgvCheckCost.GetRowCellValue(e.RowHandle, "ChargeTime") != null)
|
|
{
|
|
e.Appearance.ForeColor = Color.DodgerBlue;
|
|
}
|
|
else if (DgvCheckCost.GetRowCellValue(e.RowHandle, "CostTime") != null)
|
|
{
|
|
e.Appearance.ForeColor = Color.FromArgb(234, 149, 24);
|
|
}
|
|
else
|
|
e.Appearance.ForeColor = Color.Black;
|
|
}
|
|
|
|
private void DgvCheckCost2_RowStyle(object sender, RowStyleEventArgs e)
|
|
{
|
|
if (DgvCheckCost2.RowCount == 0) return;
|
|
if (DgvCheckCost2.GetRowCellValue(e.RowHandle, "SendTime") != null)
|
|
{
|
|
e.Appearance.ForeColor = Color.FromArgb(103, 194, 58);
|
|
}
|
|
else if (DgvCheckCost2.GetRowCellValue(e.RowHandle, "ChargeTime") != null)
|
|
{
|
|
e.Appearance.ForeColor = Color.DodgerBlue;
|
|
}
|
|
else if (DgvCheckCost2.GetRowCellValue(e.RowHandle, "CostTime") != null)
|
|
{
|
|
e.Appearance.ForeColor = Color.FromArgb(234, 149, 24);
|
|
}
|
|
else
|
|
e.Appearance.ForeColor = Color.Black;
|
|
}
|
|
|
|
private void DgvCheckCost_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
|
|
{
|
|
GridGroupRowInfo grid = e.Info as GridGroupRowInfo;
|
|
var index = DgvCheckCost.GetDataRowHandleByGroupRowHandle(e.RowHandle);
|
|
grid.GroupText = Convert.ToBoolean(DgvCheckCost.GetRowCellValue(index, "GroupTag")) ? "分组缴费订单" : "未分组缴费订单";
|
|
}
|
|
|
|
private void DgvEnrollmentFeeItem_RowStyle(object sender, RowStyleEventArgs e)
|
|
{
|
|
if (DgvEnrollmentFeeItem.RowCount == 0) return;
|
|
e.Appearance.ForeColor = DgvEnrollmentFeeItem.GetRowCellValue(e.RowHandle, "OrderNo") == null ? Color.Black : Color.DodgerBlue;
|
|
}
|
|
|
|
private void DgvEnrollmentFeeItem_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
|
|
{
|
|
GridGroupRowInfo grid = e.Info as GridGroupRowInfo;
|
|
var index = DgvEnrollmentFeeItem.GetDataRowHandleByGroupRowHandle(e.RowHandle);
|
|
grid.GroupText = DgvEnrollmentFeeItem.GetRowCellValue(index, "OEID") == null ? "个人项目" : "团体项目";
|
|
}
|
|
|
|
private void DgvEnrollment_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
|
|
{
|
|
GridGroupRowInfo grid = e.Info as GridGroupRowInfo;
|
|
var index = DgvEnrollment.GetDataRowHandleByGroupRowHandle(e.RowHandle);
|
|
grid.GroupText = DgvEnrollment.GetRowCellValue(index, "Signer") == null ? "未发送" : "已发送";
|
|
}
|
|
|
|
private void TsmiCheck4Person_Click(object sender, EventArgs e)
|
|
{
|
|
if (!DgvEnrollmentFeeItem.GetSelectedRows().Any()) return;
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
if (_lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count() == 0)
|
|
{
|
|
Global.Msg("info", "没有要处理的收费项目!");
|
|
return;
|
|
}
|
|
|
|
if (_lstEnrollmentFeeItem.Where(w => w.OEID != null && w.OrderNo == null).Count() == _lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count())
|
|
{
|
|
Global.Msg("info", "未处理体检项目无个人项目,请选择统一收费!");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "确定生成缴费订单吗?") == System.Windows.Forms.DialogResult.No) return;
|
|
CheckCostForm checkCostForm = new CheckCostForm(0, _chooseRegItem.ID);
|
|
checkCostForm.ShowDialog();
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void TsmiCheck4Org_Click(object sender, EventArgs e)
|
|
{
|
|
if (!DgvEnrollmentFeeItem.GetSelectedRows().Any()) return;
|
|
if (DgvEnrollment.GetRowCellValue(DgvEnrollment.GetSelectedRows()[0], "ID") == null && _chooseRegItem == null) return;
|
|
|
|
if (_lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count() == 0)
|
|
{
|
|
Global.Msg("info", "没有要处理的收费项目!");
|
|
return;
|
|
}
|
|
|
|
if (_lstEnrollmentFeeItem.Where(w => w.OEID == null && w.OrderNo == null).Count() == _lstEnrollmentFeeItem.Where(w => w.OrderNo == null).Count())
|
|
{
|
|
Global.Msg("info", "未处理体检项目无团体项目,请选择个人收费!");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "确定生成缴费订单吗?") == System.Windows.Forms.DialogResult.No) return;
|
|
CheckCostForm checkCostForm = new CheckCostForm(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), 0);
|
|
checkCostForm.ShowDialog();
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
OnGetEnrollmentFeeItem(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void TsmiOpenFeeItem_Click(object sender, EventArgs e)
|
|
{
|
|
PnlFeeItem.Visible = !PnlFeeItem.Visible;
|
|
TsmiOpenFeeItem.Text = PnlFeeItem.Visible ? "关闭收费项目" : "打开收费项目";
|
|
splitter7.Visible = PnlFeeItem.Visible;
|
|
}
|
|
|
|
private void DgvOrg_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
|
|
{
|
|
if (e.RowHandle >= 0)
|
|
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
|
}
|
|
|
|
private void DgvGroupFeeItem_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
_hInfo = DgvGroupFeeItem.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvFeeItem_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
_hInfo = DgvFeeItem.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvPack_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
_hInfo = DgvPack.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvGroupPatient_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
_hInfo = DgvGroupPatient.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvPatient_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
_hInfo = DgvPatient.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvEnrollmentFeeItem_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
_hInfo = DgvEnrollmentFeeItem.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvFeeItem2_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
_hInfo = DgvFeeItem2.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvPack2_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
_hInfo = DgvPack2.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvGroupFeeItem_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
|
|
{
|
|
if (e.Column.FieldName == "PackName") // 替换"PackName"
|
|
{
|
|
if (e.Value == null || e.Value.ToString() == "")
|
|
{
|
|
e.DisplayText = "加项";
|
|
}
|
|
}
|
|
}
|
|
|
|
private void DgvEnrollment_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
|
|
{
|
|
if (e.Column.FieldName == "Signer") //
|
|
{
|
|
if (e.Value == null || e.Value.ToString() == "")
|
|
{
|
|
e.DisplayText = "未发送";
|
|
}
|
|
}
|
|
}
|
|
|
|
private void DgvGroupPatient_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
|
|
{
|
|
if (e.RowHandle >= 0)
|
|
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
|
}
|
|
|
|
private void DgvPatient_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
|
|
{
|
|
if (e.RowHandle >= 0)
|
|
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
|
}
|
|
|
|
|
|
//void SelectOrg(BaseOrg item)
|
|
//{
|
|
// BaseOrg org = item;
|
|
// _lstOrg.Add(new EnrollmentOrg { Name = item.Name, Contactor1 = item.Contactor, Tel1 = item.Tel1, Tel2 = item.Tel2, Address = item.Address, ExamDate = DateTime.Now, OID = item.ID });
|
|
// DgvOrg.RefreshData();
|
|
//}
|
|
|
|
public event EventHandler<Args<EnrollmentOrg>> GetEnrollmentOrg;
|
|
|
|
public event EventHandler<Args<EnrollmentOrgGroup>> GetEnrollmentOrgGroup;
|
|
|
|
public event EventHandler<Args<BaseOrgPatient>> GetOrgPatient;
|
|
|
|
public event EventHandler<Args<EnrollmentOrgPatient>> GetGroupPatient;
|
|
|
|
public event EventHandler<Args<FeeItem>> GetFeeItem;
|
|
|
|
public event EventHandler<Args<Pack>> GetPack;
|
|
|
|
public event EventHandler<Args<EnrollmentOrgFeeItem>> GetEnrollmentOrgFeeItem;
|
|
|
|
public event EventHandler<Args<EnrollmentOrgFeeItem>> AddEnrollmentOrgFeeItem;
|
|
|
|
public event EventHandler<Args<EnrollmentOrgFeeItem>> ApplyGroupFeeItem;
|
|
|
|
public event EventHandler<Args<EnrollmentPatient>> GetEnrollmentPatient;
|
|
|
|
public event EventHandler<Args<EnrollmentFeeItem>> GetEnrollmentFeeItem;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> GetCheckCost;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> DeleteCheckCost;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> SendToDept;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> FeeCheckCost;
|
|
|
|
public event EventHandler<Args<EnrollmentOrgGroup>> UpdateGroup;
|
|
|
|
public event EventHandler<Args<EnrollmentOrgPatient>> CheckIsExist;
|
|
|
|
public event EventHandler<Args<EnrollmentFeeItem>> AddEnrollmentFeeItemByPack;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> DeleteOrder;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> CancelCharge;
|
|
|
|
public event EventHandler<Args<BaseOrgPatient>> AddOrgPatient;
|
|
|
|
public event EventHandler<Args<BasePatient>> GetPid;
|
|
|
|
public event EventHandler<Args<EnrollmentOrgFeeItem>> DelItemByPackId;
|
|
|
|
public event EventHandler<Args<EnrollmentPatient>> GetRegInfo;
|
|
|
|
public event EventHandler<Args<EnrollmentPatient>> RecallDept;
|
|
|
|
public event EventHandler<Args<EnrollmentPatient>> CancelRegInfo;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> ChangeCost;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> GroupTag;
|
|
|
|
public event EventHandler<Args<EnrollmentCheckCost>> CancelGroupTag;
|
|
|
|
public event EventHandler<Args<EnrollmentPatient>> GetExcelList;
|
|
|
|
protected virtual void OnCancelGroupTag(Int64 oeID, List<Int64> idList)
|
|
{
|
|
CancelGroupTag?.Invoke(this, new Args<EnrollmentCheckCost> { EnrollmentOID = oeID, IdList = idList });
|
|
}
|
|
|
|
protected virtual void OnGroupTag(Int64 oeID, List<Int64> idList)
|
|
{
|
|
GroupTag?.Invoke(this, new Args<EnrollmentCheckCost> { EnrollmentOID = oeID, IdList = idList });
|
|
}
|
|
|
|
protected virtual void OnChangeCost(Int64 ID, Int64 oeID)
|
|
{
|
|
ChangeCost?.Invoke(this, new Args<EnrollmentCheckCost> { ID = ID, EnrollmentOID = oeID });
|
|
}
|
|
|
|
protected virtual void OnCancelRegInfo(Int64 EID)
|
|
{
|
|
CancelRegInfo?.Invoke(this, new Args<EnrollmentPatient> { ID = EID });
|
|
}
|
|
|
|
protected virtual void OnRecallDept(Int64 Id)
|
|
{
|
|
RecallDept?.Invoke(this, new Args<EnrollmentPatient> { ID = Id });
|
|
}
|
|
|
|
protected virtual void OnDelItemByPackId(Int64 Id, Int64 groupId, Int64 packId)
|
|
{
|
|
DelItemByPackId?.Invoke(this, new Args<EnrollmentOrgFeeItem> { ID = Id, GroupID = groupId, PackID = packId });
|
|
}
|
|
|
|
protected virtual void OnGetPid(BasePatient item)
|
|
{
|
|
GetPid.Invoke(this, new Args<BasePatient>
|
|
{
|
|
Name = item.CardType,
|
|
Code = item.CardNo
|
|
});
|
|
}
|
|
|
|
protected virtual void OnAddOrgPatient(Int64 oid, Int64 pid)
|
|
{
|
|
AddOrgPatient?.Invoke(this, new Args<BaseOrgPatient> { BaseOID = oid, ID = pid });
|
|
}
|
|
|
|
protected virtual void OnCancelCharge(Int64 id)
|
|
{
|
|
CancelCharge?.Invoke(this, new Args<EnrollmentCheckCost> { ID = id });
|
|
}
|
|
|
|
protected virtual void OnDeleteOrder(Int64 id)
|
|
{
|
|
DeleteOrder?.Invoke(this, new Args<EnrollmentCheckCost> { ID = id });
|
|
}
|
|
|
|
protected virtual void OnDeleteCheckCost(Int64 orderNo)
|
|
{
|
|
DeleteCheckCost?.Invoke(this, new Args<EnrollmentCheckCost> { ID = orderNo });
|
|
}
|
|
|
|
protected virtual void OnGetCheckCost(Int64 oeID, Int64 enrollmentID)
|
|
{
|
|
GetCheckCost?.Invoke(this, new Args<EnrollmentCheckCost> { EnrollmentOID = oeID, EnrollmentID = enrollmentID });
|
|
}
|
|
|
|
protected virtual void OnGetEnrollmentFeeItem(Int64 enrollmentID)
|
|
{
|
|
GetEnrollmentFeeItem?.Invoke(this, new Args<EnrollmentFeeItem> { EnrollmentID = enrollmentID });
|
|
}
|
|
|
|
protected virtual void OnGetEnrollmentPatient(Int64 oeID)
|
|
{
|
|
GetEnrollmentPatient?.Invoke(this, new Args<EnrollmentPatient> { EnrollmentOID = oeID });
|
|
}
|
|
|
|
protected virtual void OnApplyGroupFeeItem(Int64 oeID, Int64 groupID)
|
|
{
|
|
ApplyGroupFeeItem?.Invoke(this, new Args<EnrollmentOrgFeeItem> { EnrollmentOID = oeID, GroupID = groupID });
|
|
}
|
|
|
|
protected virtual void OnAddEnrollmentOrgFeeItem(Int64 groupID, Int64 oeID, Int64 packID, Int64 oID, Int64 feeItemID)
|
|
{
|
|
AddEnrollmentOrgFeeItem?.Invoke(this, new Args<EnrollmentOrgFeeItem> { GroupID = groupID, EnrollmentOID = oeID, PackID = packID, BaseOID = oID, FeeItemID = feeItemID });
|
|
}
|
|
|
|
protected virtual void OnGetEnrollmentOrgFeeItem(Int64 groupID) // 团体分组号唯一
|
|
{
|
|
GetEnrollmentOrgFeeItem?.Invoke(this, new Args<EnrollmentOrgFeeItem> { GroupID = groupID });
|
|
}
|
|
|
|
protected virtual void OnGetFeeItem()
|
|
{
|
|
GetFeeItem?.Invoke(this, new Args<FeeItem> { });
|
|
}
|
|
|
|
protected virtual void OnGetPack()
|
|
{
|
|
GetPack?.Invoke(this, new Args<Pack> { });
|
|
}
|
|
|
|
protected virtual void OnGetGroupPatient(Int64 groupID, Int64 oeID)
|
|
{
|
|
GetGroupPatient?.Invoke(this, new Args<EnrollmentOrgPatient> { GroupID = groupID, EnrollmentOID = oeID });
|
|
}
|
|
|
|
protected virtual void OnGetOrgPatient()
|
|
{
|
|
GetOrgPatient?.Invoke(this, new Args<BaseOrgPatient> { BaseOID = Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "OID").ToString()), EnrollmentOID = Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()) });
|
|
}
|
|
|
|
protected virtual void OnGetEnrollmentOrgGroup(Int64 orgID)
|
|
{
|
|
GetEnrollmentOrgGroup?.Invoke(this, new Args<EnrollmentOrgGroup> { ID = orgID });
|
|
}
|
|
|
|
protected virtual void OnGetEnrollmentOrg(DateTime begTime, DateTime endTime, String Name)
|
|
{
|
|
GetEnrollmentOrg?.Invoke(this, new Args<EnrollmentOrg> { BegTime = begTime.Date, EndTime = endTime.Date, Name = Name });
|
|
}
|
|
|
|
protected virtual void OnSendToDept(Int64 enrollmentID)
|
|
{
|
|
SendToDept?.Invoke(this, new Args<EnrollmentCheckCost> { ID = enrollmentID });
|
|
}
|
|
|
|
protected virtual void OnFeeCheckCost(Int64 status, Int64 ID, String Code)
|
|
{
|
|
FeeCheckCost?.Invoke(this, new Args<EnrollmentCheckCost> { ID = ID, FeeItemID = status, Code = Code });
|
|
}
|
|
|
|
protected virtual void OnUpdateGroup(EnrollmentOrgGroup item)
|
|
{
|
|
UpdateGroup?.Invoke(this, new Args<EnrollmentOrgGroup> { Item = item });
|
|
}
|
|
|
|
protected virtual void OnCheckIsExist(EnrollmentOrgPatient item)
|
|
{
|
|
CheckIsExist?.Invoke(this, new Args<EnrollmentOrgPatient> { ID = item.PID, EnrollmentOID = item.OID, GroupID = item.GroupID });
|
|
}
|
|
|
|
protected virtual void OnAddEnrollmentFeeItemByPack(Int64 eId, Int64 pId, String pName)
|
|
{
|
|
AddEnrollmentFeeItemByPack?.Invoke(this, new Args<EnrollmentFeeItem>
|
|
{
|
|
EnrollmentID = eId,
|
|
PackID = pId,
|
|
Name = pName
|
|
});
|
|
}
|
|
|
|
protected virtual void OnGetRegInfo(Int64 EID)
|
|
{
|
|
GetRegInfo?.Invoke(this, new Args<EnrollmentPatient>
|
|
{
|
|
ID = EID
|
|
});
|
|
}
|
|
|
|
protected virtual void OnGetExcelList()
|
|
{
|
|
var oeID = Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString());
|
|
GetExcelList?.Invoke(this, new Args<EnrollmentPatient> { EnrollmentOID = oeID });
|
|
}
|
|
|
|
public void ShowExcelList(List<EnrollmentPatient> items)
|
|
{
|
|
_lstExcelEPatient = items;
|
|
}
|
|
|
|
public void ShowCancelRegInfo(bool status)
|
|
{
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
|
|
public void ShowEnrollmentOrg(List<EnrollmentOrg> items)
|
|
{
|
|
_lstOrg = items;
|
|
if (String.IsNullOrEmpty(NameSearch.Text))
|
|
{
|
|
DgcOrg.DataSource = _lstOrg;
|
|
}
|
|
else
|
|
{
|
|
DgcOrg.DataSource = _lstOrg.Where(a => a?.Name.Contains(NameSearch.Text) == true);
|
|
}
|
|
DgvOrg.BestFitColumns();
|
|
}
|
|
|
|
public void ShowEnrollmentOrgGroup(List<EnrollmentOrgGroup> items)
|
|
{
|
|
_lstGroup = items;
|
|
_lstGroup.ForEach(a => a.Sex = a.Sex.Equals("1") ? "男" : a.Sex.Equals("2") ? "女" : "男/女");
|
|
DgcGroup.DataSource = _lstGroup;
|
|
DgvGroup.BestFitColumns();
|
|
DgcGroup2.DataSource = _lstGroup;
|
|
DgvGroup2.BestFitColumns();
|
|
}
|
|
|
|
protected override object CreatePresenter()
|
|
{
|
|
return new EnrollmentOrgPresenter(this);
|
|
}
|
|
|
|
public void ShowOrgPatient(List<BaseOrgPatient> items)
|
|
{
|
|
_lstPatient = items;
|
|
DgcPatient.DataSource = _lstPatient;
|
|
DgvPatient.BestFitColumns();
|
|
}
|
|
|
|
public void ShowGroupPatient(List<EnrollmentOrgPatient> items)
|
|
{
|
|
_lstGroupPatient = items;
|
|
DgcGroupPatient.DataSource = _lstGroupPatient;
|
|
DgvGroupPatient.BestFitColumns();
|
|
//_lstGroupPatientTotal.AddRange(_lstGroupPatient.Where(a => !_lstGroupPatientTotal.Select(b => b.PID).ToList().Contains(a.PID)));
|
|
}
|
|
|
|
public void ShowFeeItem(List<FeeItem> items)
|
|
{
|
|
_lstFeeItem = items;
|
|
DgcFeeItem.DataSource = items;
|
|
|
|
_lstFeeItem2 = items;
|
|
DgcFeeItem2.DataSource = items;
|
|
}
|
|
|
|
public void ShowPack(List<Pack> items)
|
|
{
|
|
items.ForEach(a => a.Sex = a.Sex.Equals("1") ? "男" : a.Sex.Equals("2") ? "女" : "所有");
|
|
items.ForEach(a => a.Marriage = a.Marriage.Equals("1") ? "未婚" : a.Marriage.Equals("2") ? "已婚" : "所有");
|
|
|
|
_lstPack = items;
|
|
DgcPack.DataSource = items;
|
|
DgvPack.BestFitColumns();
|
|
DgcPack2.DataSource = items;
|
|
DgvPack2.BestFitColumns();
|
|
}
|
|
|
|
public void ShowEnrollmentOrgFeeItem(List<EnrollmentOrgFeeItem> items)
|
|
{
|
|
_lstGroupFeeItem = items;
|
|
DgcGroupFeeItem.DataSource = _lstGroupFeeItem;
|
|
DgvGroupFeeItem.BestFitColumns();
|
|
}
|
|
|
|
public void ShowEnrollmentPatient(List<EnrollmentPatient> items)
|
|
{
|
|
items.ForEach(a => a.Sex = a.Sex.Equals("1") ? "男" : a.Sex.Equals("2") ? "女" : a.Sex);
|
|
_lstEnrollmentPatient = items;
|
|
|
|
|
|
Invoke(new Action(() =>
|
|
{
|
|
DgcEnrollment.DataSource = _lstEnrollmentPatient;
|
|
PatientSearch_TextChanged(new object(), new EventArgs());
|
|
DgvEnrollment.ExpandAllGroups();
|
|
if (topRowIndex != -1)
|
|
{
|
|
int rowHandle = DgvEnrollment.LocateByValue("ID", topRowIndex);
|
|
DgvEnrollment.FocusedRowHandle = rowHandle;
|
|
DgvEnrollment.SelectRow(rowHandle);
|
|
}
|
|
}));
|
|
DgvEnrollment.BestFitColumns();
|
|
}
|
|
|
|
public void ShowEnrollmentFeeItem(List<EnrollmentFeeItem> items)
|
|
{
|
|
_lstEnrollmentFeeItem = items;
|
|
DgcEnrollmentFeeItem.DataSource = _lstEnrollmentFeeItem;
|
|
DgvEnrollmentFeeItem.BestFitColumns();
|
|
DgvEnrollmentFeeItem.ExpandAllGroups();
|
|
|
|
}
|
|
|
|
public void ShowCheckCost(List<EnrollmentCheckCost> items)
|
|
{
|
|
_lstCheckCost = items.Where(w => w.OEID != null).ToList();
|
|
DgcCheckCost.DataSource = _lstCheckCost;
|
|
DgvCheckCost.ExpandAllGroups();
|
|
DgvCheckCost.BestFitColumns();
|
|
|
|
DgvCheckCost.SelectRow(DgvCheckCost.LocateByValue("EID", _chooseRegItem.ID));
|
|
DgvCheckCost.FocusedRowHandle = DgvCheckCost.LocateByValue("EID", _chooseRegItem.ID);
|
|
|
|
_lstCheckCost2 = items.Where(w => w.OEID == null).ToList();
|
|
DgcCheckCost2.DataSource = _lstCheckCost2;
|
|
DgvCheckCost2.ExpandAllGroups();
|
|
DgvCheckCost2.BestFitColumns();
|
|
}
|
|
|
|
public void ShowSendToDept(bool status)
|
|
{
|
|
if (status)
|
|
{
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
}
|
|
|
|
public void ShowFeeCheckCost(bool status)
|
|
{
|
|
if (status)
|
|
{
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
}
|
|
}
|
|
|
|
public void ShowCheckIsExist(EnrollmentPatient item)
|
|
{
|
|
_regItem = item;
|
|
}
|
|
|
|
public void ShowPid(BasePatient item)
|
|
{
|
|
Invoke(new Action(() => _baseInfo = item));
|
|
}
|
|
|
|
public void ShowRegInfo(EnrollmentPatient item)
|
|
{
|
|
Invoke(new Action(() => _regInfo = item));
|
|
}
|
|
|
|
public void ShowRecallDept(bool status)
|
|
{
|
|
if (status)
|
|
{
|
|
OnGetCheckCost(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()), _chooseRegItem.ID);
|
|
OnGetEnrollmentPatient(Convert.ToInt64(DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "ID").ToString()));
|
|
}
|
|
}
|
|
|
|
//void RefreshData()
|
|
//{
|
|
// _lstPatient = _lstPatient.Where(a => !_lstGroupPatientTotal.Select(b => b.PID).ToList().Contains(a.PID)).ToList();
|
|
// DgcPatient.DataSource = null;
|
|
// DgcPatient.DataSource = _lstPatient;
|
|
// DgcGroupPatient.DataSource = _lstGroupPatient;
|
|
// DgvGroupPatient.RefreshData();
|
|
//}
|
|
|
|
#region Helper
|
|
|
|
private void DtpBegDate_CloseUp(object sender, EventArgs e)
|
|
{
|
|
if (DtpBegDate.Value <= DtpEndDate.Value) return;
|
|
var end = DtpBegDate.Value;
|
|
Invoke(new Action(() =>
|
|
{
|
|
DtpBegDate.Value = DtpEndDate.Value;
|
|
DtpEndDate.Value = end;
|
|
}));
|
|
}
|
|
|
|
private void DtpEndDate_CloseUp(object sender, EventArgs e)
|
|
{
|
|
if (DtpEndDate.Value >= DtpBegDate.Value) return;
|
|
var beg = DtpEndDate.Value;
|
|
Invoke(new Action(() =>
|
|
{
|
|
DtpEndDate.Value = DtpBegDate.Value;
|
|
DtpBegDate.Value = beg;
|
|
}));
|
|
}
|
|
|
|
private void EmptyDataSource() // 团体列表为空时,清空数据源
|
|
{
|
|
Invoke(new Action(() =>
|
|
{
|
|
DgcGroup.DataSource = null;
|
|
DgcGroup2.DataSource = null;
|
|
DgcPatient.DataSource = null;
|
|
DgcGroupPatient.DataSource = null;
|
|
DgcGroupFeeItem.DataSource = null;
|
|
DgcEnrollment.DataSource = null;
|
|
DgcEnrollmentFeeItem.DataSource = null;
|
|
DgcCheckCost.DataSource = null;
|
|
DgcCheckCost2.DataSource = null;
|
|
}));
|
|
}
|
|
|
|
private int CalculateAge(String birthdayStr) // 计算年龄
|
|
{
|
|
// 获取当前日期
|
|
DateTime currentDate = DateTime.Now;
|
|
string bir = DateTime.Parse(birthdayStr).ToString("yyyy-MM-dd");
|
|
DateTime birthday = DateTime.ParseExact(bir, "yyyy-MM-dd", CultureInfo.InvariantCulture);
|
|
|
|
// 计算年龄
|
|
int age = currentDate.Year - birthday.Year;
|
|
|
|
// 如果生日还未到,年龄减1
|
|
if (currentDate < birthday.AddYears(age))
|
|
{
|
|
age--;
|
|
}
|
|
|
|
return age;
|
|
}
|
|
|
|
#endregion Helper
|
|
}
|
|
} |