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.
1191 lines
43 KiB
1191 lines
43 KiB
using DevExpress.XtraGrid.Views.Grid;
|
|
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
|
using DevExpress.XtraPrinting.Native;
|
|
using PEIS.Base;
|
|
using PEIS.Entity;
|
|
using PEIS.Event;
|
|
using PEIS.Presenter;
|
|
using PEIS.Utils;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Dynamic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading;
|
|
using System.Windows.Forms;
|
|
using System.Net;
|
|
using DevExpress.XtraGrid;
|
|
using DevExpress.Utils;
|
|
|
|
namespace PEIS.View.Enrollment
|
|
{
|
|
public partial class EnrollmentPersonForm : ViewBase, IEnrollmentPersonView
|
|
{
|
|
List<Pack> _lstPack = null;
|
|
List<EnrollmentPatient> _lstRegItems = null, _lstRegItems2 = null;
|
|
List<EnrollmentFeeItem> _lstEFeeItem = null, _lstCopyFeeItem = null;
|
|
List<EnrollmentCheckCost> _lstCheckCost = null;
|
|
List<FeeItem> _lstFeeItem = null, _lstPackFeeItem = null;
|
|
EnrollmentPatient _chooseRegItem = null;
|
|
|
|
GridHitInfo pInfo = new GridHitInfo();
|
|
GridHitInfo fInfo = new GridHitInfo();
|
|
GridHitInfo eInfo = new GridHitInfo();
|
|
// 定义一个委托
|
|
public delegate void SelectedPatientDelegate(long? eid);
|
|
// 声明一个事件,供父窗体订阅
|
|
public event SelectedPatientDelegate SelectedPatientEvent;
|
|
|
|
|
|
|
|
// 指引单、报告单
|
|
private FastReport.Report pReport;
|
|
|
|
public EnrollmentPersonForm()
|
|
{
|
|
InitializeComponent();
|
|
Shown += Reg4PersonForm_Shown;
|
|
|
|
#region 登记列表
|
|
|
|
// 单击选中
|
|
DgvRegItem.SelectionChanged += DgvRegItem_SelectionChanged;
|
|
// 最近一周
|
|
FastLastWeek.Click += FastLastWeek_Click;
|
|
// 最近一个月
|
|
FastOneMonth.Click += FastLastOneMonth_Click;
|
|
// 最近三个月
|
|
FastThreeMonth.Click += FastLastThreeMonth_Click;
|
|
// 刷新登记列表
|
|
TsmiRegRefresh.Click += TsmiRegRefresh_Click;
|
|
// 分组别名
|
|
DgvRegItem.CustomDrawGroupRow += DgvRegItem_CustomDrawGroupRow;
|
|
// 导出Excel
|
|
ExportExcel.Click += ExportExcel_Click;
|
|
//
|
|
|
|
BegDate.CloseUp += BegDate_CloseUp;
|
|
BegDate.Leave += BegDate_CloseUp;
|
|
EndDate.CloseUp += EndDate_CloseUp;
|
|
EndDate.Leave += EndDate_CloseUp;
|
|
NameSearch.KeyDown += NameSearch_KeyDown;
|
|
|
|
#endregion
|
|
|
|
#region 登记操作
|
|
|
|
// 新增登记
|
|
TsmiRegAdd.Click += TsmiRegAdd_Click;
|
|
// 编辑登记
|
|
TsmiRegEdit.Click += TsmiRegEdit_Click;
|
|
// 取消登记
|
|
TsmiRegCancel.Click += TsmiRegCancel_Click;
|
|
|
|
#endregion
|
|
|
|
#region 流程按钮
|
|
|
|
// 收费单
|
|
TsmiProjectPrintCost.Click += TsmiProjectPrintCost_Click;
|
|
// 指引单
|
|
TsmiProjectPrintGuide.Click += TsmiProjectPrintGuide_Click;
|
|
// 生成订单
|
|
TsmiPojectCreateOrder.Click += TsmiPojectCreateOrder_Click;
|
|
// 发送到科室
|
|
TsmiProjectSendDept.Click += TsmiProjectSendDept_Click;
|
|
// 打印申请单
|
|
TsmiProjectPrintApply.Click += TsmiProjectPrintApply_Click;
|
|
|
|
#endregion
|
|
|
|
// 记 账
|
|
FastCharge.Click += FastCharge_Click;
|
|
// 全部记账
|
|
FastAllCharge.Click += FastAllCharge_Click;
|
|
// 删除订单
|
|
FastDeleteCost.Click += FastDeleteCost_Click;
|
|
// 取消记账
|
|
FastCancelCharge.Click += FastCancelCharge_Click;
|
|
// 撤回发送
|
|
FastRecallDept.Click += FastRecallDept_Click;
|
|
// 刷新订单状态
|
|
FastRefreshCost.Click += FastRefreshCost_Click;
|
|
|
|
// 添加套餐
|
|
DgvPack.DoubleClick += DgvPack_DoubleClick;
|
|
// 套餐、加项转换显示
|
|
DgvEFeeItem.CustomColumnDisplayText += DgvEFeeItem_CustomColumnDisplayText;
|
|
// 添加收费项目
|
|
DgvFeeItem.DoubleClick += DgvFeeItem_DoubleClick;
|
|
// 移除收费项目
|
|
DgvEFeeItem.DoubleClick += DgvEFeeItem_DoubleClick;
|
|
|
|
// 改变体检项目行颜色
|
|
DgvEFeeItem.RowStyle += DgvEFeeItem_RowStyle;
|
|
// 改变订单行颜色
|
|
DgvCheckCost.RowStyle += DgvCheckCost_RowStyle;
|
|
|
|
|
|
// 打开/关闭收费项目
|
|
TsmiOpenFeeItem.Click += TsmiOpenFeeItem_Click;
|
|
// 收费项目检索
|
|
FeeItemSearch.TextChanged += FeeItemSearch_TextChanged;
|
|
// 复制项目
|
|
TsmiCopyFeeItem.Click += TsmiCopyFeeItem_Click;
|
|
// 套餐、加项转换显示
|
|
DgvCopyItem.CustomColumnDisplayText += DgvCopyItem_CustomColumnDisplayText;
|
|
|
|
DgvRegItem2.SelectionChanged += DgvRegItem2_SelectionChanged;
|
|
NameSearch2.KeyDown += NameSearch2_KeyDown;
|
|
|
|
#region 判断双击位置
|
|
DgvPack.MouseDown += DgvPack_MouseDown;
|
|
DgvFeeItem.MouseDown += DgvFeeItem_MouseDown;
|
|
DgvEFeeItem.MouseDown += DgvEFeeItem_MouseDown;
|
|
#endregion
|
|
}
|
|
|
|
private void DgvEFeeItem_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
eInfo = DgvEFeeItem.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvFeeItem_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
fInfo = DgvFeeItem.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvPack_MouseDown(object sender, MouseEventArgs e)
|
|
{
|
|
pInfo = DgvPack.CalcHitInfo(e.X, e.Y);
|
|
}
|
|
|
|
private void DgvEFeeItem_RowStyle(object sender, RowStyleEventArgs e)
|
|
{
|
|
if (DgvEFeeItem.RowCount == 0) return;
|
|
if (DgvEFeeItem.GetRowCellValue(e.RowHandle, "OrderNo") == null)
|
|
e.Appearance.ForeColor = Color.Black;
|
|
else
|
|
e.Appearance.ForeColor = Color.DodgerBlue;
|
|
}
|
|
|
|
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 DgvEFeeItem_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 DgvCopyItem_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 Reg4PersonForm_Shown(object sender, EventArgs e)
|
|
{
|
|
BegDate.Value = DateTime.Now;
|
|
EndDate.Value = DateTime.Now;
|
|
|
|
ThreadPool.QueueUserWorkItem(state =>
|
|
{
|
|
OnGetRegItems(0);
|
|
OnGetPackItem(); // 获取体检套餐
|
|
OnGetFeeItem(); // 获取收费项目
|
|
});
|
|
}
|
|
|
|
#region 交互逻辑
|
|
|
|
#region 登记列表
|
|
|
|
private void NameSearch_KeyDown(object sender, KeyEventArgs e) // 模糊检索
|
|
{
|
|
if (e.KeyCode == Keys.Enter) OnGetRegItems(0);
|
|
}
|
|
|
|
private void TsmiRegRefresh_Click(object sender, EventArgs e) // 刷新按钮
|
|
{
|
|
// 使当前控件获得焦点,避免日期选择器修改后未生效
|
|
menuStrip1.Focus();
|
|
OnGetRegItems(0);
|
|
}
|
|
|
|
private void DgvRegItem_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e) // 登记列表切换
|
|
{
|
|
Invoke(new Action(() => _chooseRegItem = null));
|
|
Invoke(new Action(() => _chooseRegItem = DgvRegItem.GetRow(DgvRegItem.GetSelectedRows()[0]) as EnrollmentPatient));
|
|
|
|
OnGetRegInfo(_chooseRegItem.ID);
|
|
OnGetCheckCost(_chooseRegItem.ID);
|
|
OnGetExamFeeItem(_chooseRegItem.ID, "0");
|
|
|
|
//调用
|
|
SelectedPatientEvent?.Invoke(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void DgvRegItem_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) // 分组别名
|
|
{
|
|
GridGroupRowInfo grid = e.Info as GridGroupRowInfo;
|
|
var index = DgvRegItem.GetDataRowHandleByGroupRowHandle(e.RowHandle);
|
|
|
|
grid.GroupText = DgvRegItem.GetRowCellValue(index, "Signer").ToString() == "1" ? "未发送" : DgvRegItem.GetRowCellValue(index, "Signer").ToString() == "2" ? "已发送" : "已完结";
|
|
}
|
|
|
|
private void ExportExcel_Click(object sender, EventArgs e) // 导出数据
|
|
{
|
|
if (DgcRegItem != null)
|
|
{
|
|
try
|
|
{
|
|
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
|
saveFileDialog.Title = "导出Excel";
|
|
saveFileDialog.FileName = "签到名单";
|
|
saveFileDialog.Filter = "Excel文件(*.xls)|*.xls";
|
|
DialogResult dialogResult = saveFileDialog.ShowDialog(this);
|
|
if (dialogResult == DialogResult.OK)
|
|
{
|
|
DevExpress.XtraPrinting.XlsExportOptionsEx options = new DevExpress.XtraPrinting.XlsExportOptionsEx();
|
|
options.ShowGridLines = true;
|
|
options.TextExportMode = DevExpress.XtraPrinting.TextExportMode.Value;
|
|
options.ExportType = DevExpress.Export.ExportType.WYSIWYG;
|
|
DgcRegItem.ExportToXls(saveFileDialog.FileName, options);
|
|
}
|
|
}
|
|
catch (Exception a)
|
|
{
|
|
|
|
Console.WriteLine(a);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region 登记操作
|
|
|
|
private void TsmiRegAdd_Click(object sender, EventArgs e) // 新增登记
|
|
{
|
|
NewEnrollmentPersonForm enrollmentPersonForm = new NewEnrollmentPersonForm(null, false);
|
|
enrollmentPersonForm.ShowDialog();
|
|
OnGetRegItems(0);
|
|
}
|
|
|
|
private void TsmiRegEdit_Click(object sender, EventArgs e) // 编辑登记信息
|
|
{
|
|
if (_lstRegItems == null || _lstRegItems.Count() == 0) return;
|
|
NewEnrollmentPersonForm enrollmentPersonForm = new NewEnrollmentPersonForm(_chooseRegItem, true);
|
|
enrollmentPersonForm.ShowDialog();
|
|
OnGetRegItems(0);
|
|
}
|
|
|
|
private void TsmiRegCancel_Click(object sender, EventArgs e) // 取消登记
|
|
{
|
|
if (_chooseRegItem == null)
|
|
{
|
|
Global.Msg("info", "请先选中体检人员!");
|
|
return;
|
|
}
|
|
|
|
if (_lstEFeeItem != null && _lstEFeeItem.Where(w => w.OrderNo != null).ToList().Count != 0)
|
|
{
|
|
Global.Msg("info", "该体检登记下已有订单,请先取消记账订单后重试!");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "确定取消登记该信息?") == DialogResult.No) return;
|
|
|
|
OnCancelRegInfo(_chooseRegItem.ID);
|
|
OnGetRegItems(0);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 流程按钮
|
|
|
|
private void TsmiPojectCreateOrder_Click(object sender, EventArgs e)
|
|
{
|
|
if (_lstEFeeItem == null)
|
|
{
|
|
Global.Msg("info", "请先添加收费项目!");
|
|
return;
|
|
}
|
|
|
|
if (_lstEFeeItem.Where(w => w.OrderNo == null).ToList().Count == 0)
|
|
{
|
|
Global.Msg("info", "没有要处理的收费项目");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "确定生成缴费订单吗?") == DialogResult.No) return;
|
|
|
|
CheckCostForm checkCostForm = new CheckCostForm(0, _chooseRegItem.ID);
|
|
checkCostForm.ShowDialog();
|
|
OnGetCheckCost(_chooseRegItem.ID);
|
|
OnGetExamFeeItem(_chooseRegItem.ID, "0");
|
|
} // 生成订单
|
|
|
|
|
|
#endregion
|
|
|
|
private void DgvRegItem2_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
|
|
{
|
|
Invoke(new Action(() =>
|
|
{
|
|
OnGetExamFeeItem(Convert.ToInt64(DgvRegItem2.GetRowCellValue(DgvRegItem2.GetSelectedRows()[0], "ID").ToString()), "1");
|
|
}));
|
|
}
|
|
|
|
private void DgvPack_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
if (DgvPack.FocusedRowHandle < 0) return;
|
|
|
|
if (!pInfo.InRowCell) return;
|
|
|
|
if (_chooseRegItem == null)
|
|
{
|
|
Global.Msg("info", "请先选中体检人员!");
|
|
return;
|
|
}
|
|
|
|
|
|
if (_lstEFeeItem?.Count != 0)
|
|
{
|
|
Global.Msg("info", "该登记已有收费项目,不能添加套餐,套餐只能最先添加,请核对后重试!");
|
|
return;
|
|
}
|
|
|
|
OnGetFeeItemByPack(Convert.ToInt64(DgvPack.GetRowCellValue(DgvPack.GetSelectedRows()[0], "ID").ToString()));
|
|
if (_lstPackFeeItem?.Count != 0)
|
|
{
|
|
EnrollmentFeeItem item = new EnrollmentFeeItem();
|
|
Int32 index = 0;
|
|
_lstPackFeeItem.ForEach(a =>
|
|
{
|
|
index++;
|
|
|
|
item.EID = _chooseRegItem.ID;
|
|
item.PackId = Convert.ToInt64(DgvPack.GetRowCellValue(DgvPack.GetSelectedRows()[0], "ID").ToString());
|
|
item.PackName = DgvPack.GetRowCellValue(DgvPack.GetSelectedRows()[0], "Name").ToString();
|
|
item.FID = a.FID;
|
|
item.FeeItemCode = a.FeeItemCode;
|
|
item.FeeItemName = a.FeeItemName;
|
|
item.Quantity = 1;
|
|
item.Unit = a.Unit;
|
|
item.Price = a.Price;
|
|
item.SettlePrice = a.SettlePrice;
|
|
item.ItemClass = a.ItemClass;
|
|
item.CreateTime = DateTime.Now;
|
|
item.CreatorCode = Global.currentUser.Code;
|
|
item.Creator = Global.currentUser.Name;
|
|
item.DeptCode = a.DeptCode;
|
|
item.DeptName = a.DeptName;
|
|
item.Seq = index;
|
|
item.KeyNo = a.KeyNo;
|
|
|
|
item.Save();
|
|
});
|
|
|
|
OnGetExamFeeItem(_chooseRegItem.ID, "0");
|
|
}
|
|
}
|
|
|
|
private void DgvFeeItem_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
if (DgvFeeItem.FocusedRowHandle < 0) return;
|
|
if (!fInfo.InRowCell) return;
|
|
|
|
if (_chooseRegItem == null)
|
|
{
|
|
Global.Msg("info", "请先选中体检人员!");
|
|
return;
|
|
}
|
|
|
|
List<EnrollmentFeeItem> items = _lstEFeeItem.Where(a => a?.KeyNo == DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "KeyNo").ToString()).ToList();
|
|
if (items.Count != 0)
|
|
{
|
|
Global.Msg("info", "已存在该收费项目,请勿重复添加!");
|
|
return;
|
|
}
|
|
|
|
EnrollmentFeeItem item = new EnrollmentFeeItem()
|
|
{
|
|
EID = _chooseRegItem.ID,
|
|
FID = Convert.ToInt64(DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "ID").ToString()),
|
|
FeeItemCode = DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "FeeItemCode")?.ToString(),
|
|
FeeItemName = DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "FeeItemName")?.ToString(),
|
|
Quantity = 1,
|
|
Unit = DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "Unit")?.ToString(),
|
|
Price = Convert.ToDecimal(DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "Price")?.ToString()),
|
|
SettlePrice = Convert.ToDecimal(DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "SettlePrice")?.ToString()),
|
|
ItemClass = DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "ItemClass")?.ToString(),
|
|
CreateTime = DateTime.Now,
|
|
CreatorCode = Global.currentUser.Code,
|
|
Creator = Global.currentUser.Name,
|
|
DeptCode = DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "DeptCode")?.ToString(),
|
|
DeptName = DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "DeptName")?.ToString(),
|
|
Seq = _lstEFeeItem.Count != 0 ? _lstEFeeItem[_lstEFeeItem.Count - 1].Seq + 1 : 1,
|
|
KeyNo = DgvFeeItem.GetRowCellValue(DgvFeeItem.GetSelectedRows()[0], "KeyNo")?.ToString()
|
|
};
|
|
|
|
item.Save();
|
|
OnGetExamFeeItem(_chooseRegItem.ID, "0");
|
|
}
|
|
|
|
private void DgvEFeeItem_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
if (DgvEFeeItem.FocusedRowHandle < 0) return;
|
|
if (!eInfo.InRowCell) return;
|
|
|
|
EnrollmentFeeItem item = DgvEFeeItem.GetRow(DgvEFeeItem.GetSelectedRows()[0]) as EnrollmentFeeItem;
|
|
|
|
if (item.OrderNo != null)
|
|
{
|
|
Global.Msg("info", "已生成订单不可取消!");
|
|
return;
|
|
}
|
|
|
|
if (DgvEFeeItem.FocusedColumn.ToString() == "套餐" && item.PackId != null)
|
|
{
|
|
if (Global.Msg("warn", "确定移除当前套餐吗?") == DialogResult.No) return;
|
|
OnDelItemByPackId(Convert.ToInt64(item?.EID), Convert.ToInt64(item?.PackId));
|
|
OnGetExamFeeItem(_chooseRegItem.ID, "0");
|
|
return;
|
|
}
|
|
|
|
item.Delete();
|
|
OnGetExamFeeItem(_chooseRegItem.ID, "0");
|
|
}
|
|
|
|
private void TsmiProjectPrintGuide_Click(object sender, EventArgs e)
|
|
{
|
|
Console.WriteLine("123");
|
|
if (_lstCheckCost == null || _lstCheckCost.Count == 0)
|
|
{
|
|
Global.Msg("info", "暂无订单!");
|
|
return;
|
|
}
|
|
|
|
if (_lstCheckCost.Where(w => w.SendTime == null).ToList().Count != 0)
|
|
{
|
|
Global.Msg("info", "订单未发送!");
|
|
return;
|
|
}
|
|
|
|
try
|
|
{
|
|
var items = new List<EnrollmentFeeItem>();
|
|
_lstEFeeItem.Where(w => w.OrderNo != null && !w.IsHide && !(w.DeptName.Contains("金域"))).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, _chooseRegItem);
|
|
pReport.Show();
|
|
pReport.Dispose();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Global.Msg("info", ex.Message);
|
|
}
|
|
}
|
|
|
|
private void TsmiProjectPrintCost_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
if (_lstCheckCost == null || _lstCheckCost.Count == 0)
|
|
{
|
|
Global.Msg("info", "暂无订单!");
|
|
return;
|
|
}
|
|
|
|
if (_lstCheckCost.Where(w => w.CostTime == null).ToList().Count == 0)
|
|
{
|
|
Global.Msg("info", "所有订单已收费!");
|
|
return;
|
|
}
|
|
|
|
try
|
|
{
|
|
var list = _lstCheckCost.Where(w => w.CostTime == null && w.CancelTime == null).ToList();
|
|
|
|
pReport = ReportHelper.PrintCheckCost(list, _chooseRegItem);
|
|
pReport.Show();
|
|
pReport.Dispose();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Global.Msg("info", ex.Message);
|
|
}
|
|
}
|
|
|
|
private void TsmiProjectPrintApply_Click(object sender, EventArgs e)
|
|
{
|
|
if (_lstEFeeItem == null || _lstEFeeItem.Count == 0)
|
|
{
|
|
Global.Msg("info", "暂无收费项目!");
|
|
return;
|
|
}
|
|
|
|
try
|
|
{
|
|
pReport = ReportHelper.PrintApply(_lstEFeeItem, _chooseRegItem);
|
|
pReport.Show();
|
|
pReport.Dispose();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Global.Msg("info", ex.Message);
|
|
}
|
|
}
|
|
|
|
private void TsmiProjectSendDept_Click(object sender, EventArgs e)
|
|
{
|
|
if (_lstCheckCost == null || _lstCheckCost.Count == 0)
|
|
{
|
|
Global.Msg("info", "暂无订单!");
|
|
return;
|
|
}
|
|
|
|
if (_lstCheckCost.Where(w => w.ChargeTime == null).ToList().Count != 0)
|
|
{
|
|
Global.Msg("info", "订单还未收费或未记账,不能操作,请核对后重试!");
|
|
return;
|
|
}
|
|
|
|
if (_lstCheckCost.Where(w => w.SendTime == null).ToList().Count == 0)
|
|
{
|
|
Global.Msg("info", "所有订单已发送!");
|
|
return;
|
|
}
|
|
|
|
if (Global.Msg("warn", "确定要发送吗?") == DialogResult.No) return;
|
|
|
|
//CostToHis(_chooseRegItem.ID);
|
|
OnSendToDept(_chooseRegItem.ID);
|
|
OnGetRegItems(0);
|
|
OnGetCheckCost(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void FastAllCharge_Click(object sender, EventArgs e)
|
|
{
|
|
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;
|
|
OnChargeOrder(_chooseRegItem.ID, "0");
|
|
}
|
|
|
|
private void FastCharge_Click(object sender, EventArgs e)
|
|
{
|
|
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", "确定要记账吗?未发送前可以取消记账,发送后不能取消记账!") == DialogResult.No) return;
|
|
|
|
OnChargeOrder(item.ID, "1");
|
|
}
|
|
|
|
private void FastDeleteCost_Click(object sender, EventArgs e)
|
|
{
|
|
if (DgvCheckCost.GetSelectedRows().Count() == 0) return;
|
|
EnrollmentCheckCost item = DgvCheckCost.GetRow(DgvCheckCost.GetSelectedRows()[0]) as EnrollmentCheckCost;
|
|
|
|
if (item.Fee == 0 && item.SendTime == null)
|
|
{
|
|
OnDeleteOrder(item.ID);
|
|
return;
|
|
}
|
|
|
|
if (item.ChargeTime != null || item.CostTime != null)
|
|
{
|
|
Global.Msg("info", "该订单已收费或已记账,不能删除!");
|
|
return;
|
|
}
|
|
|
|
if (item?.CancelTime != null)
|
|
{
|
|
Global.Msg("info", "该订单为退费订单留存记录,不能删除!");
|
|
return;
|
|
}
|
|
|
|
OnDeleteOrder(item.ID);
|
|
}
|
|
|
|
private void FastCancelCharge_Click(object sender, EventArgs e)
|
|
{
|
|
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(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void FastRefreshCost_Click(object sender, EventArgs e)
|
|
{
|
|
OnGetCheckCost(_chooseRegItem.ID);
|
|
}
|
|
|
|
private void TsmiOpenFeeItem_Click(object sender, EventArgs e)
|
|
{
|
|
if (splitContainer2.Panel2Collapsed)
|
|
{
|
|
Invoke(new Action(() =>
|
|
{
|
|
OnGetPackItem(); // 获取体检套餐
|
|
OnGetFeeItem(); // 获取收费项目
|
|
}));
|
|
}
|
|
|
|
splitContainer2.Panel2Collapsed = !splitContainer2.Panel2Collapsed;
|
|
TsmiOpenFeeItem.Text = splitContainer2.Panel2Collapsed ? "打开收费项目" : "关闭收费项目";
|
|
}
|
|
|
|
private void FeeItemSearch_TextChanged(object sender, EventArgs e)
|
|
{
|
|
DgcFeeItem.DataSource = _lstFeeItem.Where(a => a?.FeeItemName.Contains(FeeItemSearch.Text) == true);
|
|
}
|
|
|
|
private void TsmiCopyFeeItem_Click(object sender, EventArgs e)
|
|
{
|
|
if (_lstCopyFeeItem == null || _lstCopyFeeItem.Count == 0) return;
|
|
|
|
if (_chooseRegItem == null)
|
|
{
|
|
Global.Msg("info", "请先选中体检人员!");
|
|
return;
|
|
}
|
|
|
|
if (_lstEFeeItem?.Count != 0)
|
|
{
|
|
Global.Msg("info", "该登记已有收费项目,不能复制,请核对后重试!");
|
|
return;
|
|
}
|
|
|
|
EnrollmentFeeItem item = new EnrollmentFeeItem();
|
|
Int32 index = 0;
|
|
_lstCopyFeeItem.ForEach(a =>
|
|
{
|
|
index++;
|
|
|
|
item.EID = _chooseRegItem.ID;
|
|
item.PackId = a.PackId;
|
|
item.PackName = a.PackName;
|
|
item.FID = a.FID;
|
|
item.FeeItemCode = a.FeeItemCode;
|
|
item.FeeItemName = a.FeeItemName;
|
|
item.Quantity = 1;
|
|
item.Unit = a.Unit;
|
|
item.Price = a.Price;
|
|
item.SettlePrice = a.SettlePrice;
|
|
item.ItemClass = a.ItemClass;
|
|
item.CreateTime = DateTime.Now;
|
|
item.CreatorCode = Global.currentUser.Code;
|
|
item.Creator = Global.currentUser.Name;
|
|
item.DeptCode = a.DeptCode;
|
|
item.DeptName = a.DeptName;
|
|
item.Seq = index;
|
|
item.KeyNo = a.KeyNo;
|
|
|
|
item.Save();
|
|
});
|
|
|
|
OnGetExamFeeItem(_chooseRegItem.ID, "0");
|
|
}
|
|
|
|
private void FastRecallDept_Click(object sender, EventArgs e)
|
|
{
|
|
if (_chooseRegItem == null || _chooseRegItem.SignTime == null) return;
|
|
OnRecallDept(_chooseRegItem.ID);
|
|
OnGetRegItems(0);
|
|
}
|
|
|
|
private void NameSearch2_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.KeyCode == Keys.Enter) OnGetRegItems(1);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 事件
|
|
|
|
// 获取登记列表
|
|
public event EventHandler<Args<dynamic>> GetRegItems;
|
|
public void ShowRegItems(List<EnrollmentPatient> items, int code)
|
|
{
|
|
if (code == 0) {
|
|
items.ForEach(a => a.Sex = a.Sex.Equals("1") ? "男" : a.Sex.Equals("2") ? "女" : "");
|
|
Invoke(new Action(() => _lstRegItems = items));
|
|
Invoke(new Action(() => DgcRegItem.DataSource = null));
|
|
Invoke(new Action(() => { DgcRegItem.DataSource = _lstRegItems.Where(a => a?.Name.Contains(NameSearch.Text) == true || a?.ID.ToString().Contains(NameSearch.Text) == true); }));
|
|
|
|
if (_lstRegItems.Where(a => a?.Name.Contains(NameSearch.Text) == true || a?.ID.ToString().Contains(NameSearch.Text) == true).Count() != 0)
|
|
{
|
|
Invoke(new Action(() => _chooseRegItem = _lstRegItems.Where(a => a?.Name.Contains(NameSearch.Text) == true || a?.ID.ToString().Contains(NameSearch.Text) == true).ToList()[0]));
|
|
Invoke(new Action(() => OnGetRegInfo(_chooseRegItem.ID)));
|
|
Invoke(new Action(() => OnGetExamFeeItem(_chooseRegItem.ID, "0")));
|
|
Invoke(new Action(() => OnGetCheckCost(_chooseRegItem.ID)));
|
|
}
|
|
else
|
|
{
|
|
DgcEFeeItem.DataSource = _lstEFeeItem = null;
|
|
DgcCheckCost.DataSource = _lstCheckCost = null;
|
|
_chooseRegItem = null;
|
|
RegDataBinds(_chooseRegItem);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Invoke(new Action(() => _lstRegItems2 = items));
|
|
Invoke(new Action(() => DgcRegItem2.DataSource = null));
|
|
Invoke(new Action(() => { DgcRegItem2.DataSource = _lstRegItems2.Where(a => a?.Name.Contains(NameSearch2.Text) == true || a?.ID.ToString().Contains(NameSearch2.Text) == true); }));
|
|
if (_lstRegItems2.Where(a => a?.Name.Contains(NameSearch2.Text) == true || a?.ID.ToString().Contains(NameSearch2.Text) == true).Count() == 0) DgcCopyItem.DataSource = _lstCopyFeeItem = null;
|
|
}
|
|
|
|
DgvRegItem.ExpandAllGroups();
|
|
Invoke(new Action(() => { DgvRegItem.BestFitColumns(); DgvRegItem2.BestFitColumns(); }));
|
|
}
|
|
protected virtual void OnGetRegItems(int code)
|
|
{
|
|
dynamic searchData = new ExpandoObject();
|
|
searchData.begDate = BegDate.Value.ToShortDateString();
|
|
searchData.endDate = EndDate.Value.ToShortDateString();
|
|
searchData.name = code == 0 ? NameSearch.Text : NameSearch2.Text;
|
|
searchData.code = code;
|
|
GetRegItems?.Invoke(this, new Args<dynamic>()
|
|
{
|
|
Item = searchData
|
|
});
|
|
}
|
|
|
|
// 获取登记信息
|
|
public event EventHandler<Args<EnrollmentPatient>> GetRegInfo;
|
|
public void ShowRegInfo(EnrollmentPatient item)
|
|
{
|
|
Invoke(new Action(() => _chooseRegItem = item));
|
|
Invoke(new Action(() => RegDataBinds(_chooseRegItem)));
|
|
|
|
if (_lstPack != null)
|
|
{
|
|
Invoke(new Action(() => DgcPack.DataSource = _lstPack.Where(w => w.Sex.Equals("所有") || w.Sex.Equals(_chooseRegItem.Sex.Equals("1") ? "男" : "女"))));
|
|
}
|
|
|
|
}
|
|
protected virtual void OnGetRegInfo(Int64 EID)
|
|
{
|
|
GetRegInfo?.Invoke(this, new Args<EnrollmentPatient>
|
|
{
|
|
ID = EID
|
|
});
|
|
}
|
|
|
|
// 获取体检项目
|
|
public event EventHandler<Args<EnrollmentFeeItem>> GetExamFeeItem;
|
|
public void ShowExamFeeItem(List<EnrollmentFeeItem> items, String code)
|
|
{
|
|
if (code == "0")
|
|
{
|
|
Invoke(new Action(() => _lstEFeeItem = items));
|
|
Invoke(new Action(() => DgcEFeeItem.DataSource = null));
|
|
Invoke(new Action(() => DgcEFeeItem.DataSource = _lstEFeeItem));
|
|
Invoke(new Action(() => DgvEFeeItem.BestFitColumns()));
|
|
}
|
|
else
|
|
{
|
|
Invoke(new Action(() => _lstCopyFeeItem = items));
|
|
Invoke(new Action(() => DgcCopyItem.DataSource = null));
|
|
Invoke(new Action(() => DgcCopyItem.DataSource = _lstCopyFeeItem));
|
|
Invoke(new Action(() => DgvCopyItem.BestFitColumns()));
|
|
}
|
|
|
|
}
|
|
protected virtual void OnGetExamFeeItem(Int64 EID, String code)
|
|
{
|
|
GetExamFeeItem?.Invoke(this, new Args<EnrollmentFeeItem>
|
|
{
|
|
ID = EID,
|
|
Code = code
|
|
});
|
|
}
|
|
|
|
// 获取收费项目
|
|
public event EventHandler<Args<FeeItem>> GetFeeItem;
|
|
public void ShowFeeItem(List<FeeItem> items)
|
|
{
|
|
Invoke(new Action(() => _lstFeeItem = items));
|
|
Invoke(new Action(() => DgcFeeItem.DataSource = null));
|
|
Invoke(new Action(() => DgcFeeItem.DataSource = _lstFeeItem));
|
|
//Invoke(new Action(() => DgvFeeItem.BestFitColumns()));
|
|
}
|
|
protected virtual void OnGetFeeItem()
|
|
{
|
|
GetFeeItem.Invoke(this, new Args<FeeItem> { });
|
|
}
|
|
|
|
// 获取套餐
|
|
public event EventHandler<Args<Pack>> GetPackItem;
|
|
public void ShowPackItem(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") ? "已婚" : "所有");
|
|
Invoke(new Action(() => _lstPack = items));
|
|
Invoke(new Action(() => DgcPack.DataSource = null));
|
|
if (_chooseRegItem == null) return;
|
|
Invoke(new Action(() => DgcPack.DataSource = _lstPack.Where(w => w.Sex.Equals("所有") || w.Sex.Equals(_chooseRegItem.Sex.Equals("1") ? "男" : "女"))));
|
|
Invoke(new Action(() => DgvPack.BestFitColumns()));
|
|
}
|
|
protected virtual void OnGetPackItem()
|
|
{
|
|
GetPackItem?.Invoke(this, new Args<Pack> { });
|
|
}
|
|
|
|
// 获取套餐收费项目
|
|
public event EventHandler<Args<Pack>> GetFeeItemByPack;
|
|
public void ShowFeeItemByPack(List<FeeItem> items)
|
|
{
|
|
Invoke(new Action(() => _lstPackFeeItem = items));
|
|
}
|
|
protected virtual void OnGetFeeItemByPack(Int64 packID)
|
|
{
|
|
GetFeeItemByPack?.Invoke(this, new Args<Pack>
|
|
{
|
|
ID = packID
|
|
});
|
|
}
|
|
|
|
// 获取订单
|
|
public event EventHandler<Args<EnrollmentCheckCost>> GetCheckCost;
|
|
public void ShowCheckCost(List<EnrollmentCheckCost> items)
|
|
{
|
|
Invoke(new Action(() => _lstCheckCost = items));
|
|
Invoke(new Action(() => DgcCheckCost.DataSource = null));
|
|
Invoke(new Action(() => DgcCheckCost.DataSource = _lstCheckCost));
|
|
Invoke(new Action(() => DgvCheckCost.BestFitColumns()));
|
|
}
|
|
protected virtual void OnGetCheckCost(Int64 EID)
|
|
{
|
|
GetCheckCost?.Invoke(this, new Args<EnrollmentCheckCost>
|
|
{
|
|
ID = EID
|
|
});
|
|
}
|
|
|
|
// 记 账
|
|
public event EventHandler<Args<EnrollmentCheckCost>> ChargeOrder;
|
|
public void ShowChargeOrder(bool status)
|
|
{
|
|
if (status)
|
|
{
|
|
Invoke(new Action(() =>
|
|
{
|
|
OnGetCheckCost(_chooseRegItem.ID);
|
|
}));
|
|
}
|
|
}
|
|
protected virtual void OnChargeOrder(Int64 ID, string Code)
|
|
{
|
|
ChargeOrder?.Invoke(this, new Args<EnrollmentCheckCost> { ID = ID, Code = Code });
|
|
}
|
|
|
|
// 发送到科室
|
|
public event EventHandler<Args<EnrollmentCheckCost>> SendToDept;
|
|
public void ShowSendToDept(bool status)
|
|
{
|
|
|
|
}
|
|
protected virtual void OnSendToDept(Int64 EID)
|
|
{
|
|
SendToDept?.Invoke(this, new Args<EnrollmentCheckCost> { ID = EID });
|
|
}
|
|
|
|
// 取消登记
|
|
public event EventHandler<Args<EnrollmentPatient>> CancelRegInfo;
|
|
public void ShowCancelRegInfo(bool status)
|
|
{
|
|
|
|
}
|
|
protected virtual void OnCancelRegInfo(Int64 EID)
|
|
{
|
|
CancelRegInfo?.Invoke(this, new Args<EnrollmentPatient> { ID = EID });
|
|
}
|
|
|
|
// 删除订单
|
|
public event EventHandler<Args<EnrollmentCheckCost>> DeleteOrder;
|
|
public void ShowDeleteOrder(bool status)
|
|
{
|
|
if (status)
|
|
{
|
|
Invoke(new Action(() =>
|
|
{
|
|
OnGetCheckCost(_chooseRegItem.ID);
|
|
OnGetExamFeeItem(_chooseRegItem.ID, "0");
|
|
}));
|
|
}
|
|
}
|
|
protected virtual void OnDeleteOrder(Int64 id)
|
|
{
|
|
DeleteOrder?.Invoke(this, new Args<EnrollmentCheckCost> { ID = id });
|
|
}
|
|
|
|
// 取消记账
|
|
public event EventHandler<Args<EnrollmentCheckCost>> CancelCharge;
|
|
public void ShowCancelCharge(bool status)
|
|
{
|
|
if (status)
|
|
{
|
|
Invoke(new Action(() =>
|
|
{
|
|
OnGetCheckCost(_chooseRegItem.ID);
|
|
}));
|
|
}
|
|
}
|
|
protected virtual void OnCancelCharge(Int64 id)
|
|
{
|
|
CancelCharge?.Invoke(this, new Args<EnrollmentCheckCost> { ID = id });
|
|
}
|
|
|
|
// 移除套餐
|
|
public event EventHandler<Args<EnrollmentFeeItem>> DelItemByPackId;
|
|
protected virtual void OnDelItemByPackId(Int64 eId, Int64 packId)
|
|
{
|
|
DelItemByPackId?.Invoke(this, new Args<EnrollmentFeeItem> { Eid = eId, PackID = packId });
|
|
}
|
|
|
|
// 撤回发送
|
|
public event EventHandler<Args<EnrollmentPatient>> RecallDept;
|
|
protected virtual void OnRecallDept(Int64 Id)
|
|
{
|
|
RecallDept?.Invoke(this, new Args<EnrollmentPatient> { ID = Id });
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region hepler
|
|
|
|
#region 照片处理
|
|
|
|
public Image Base64ToImage(string base64Str)
|
|
{
|
|
if (base64Str == null || base64Str == "")
|
|
{
|
|
return null;
|
|
}
|
|
|
|
byte[] imageBytes = Convert.FromBase64String(base64Str);
|
|
using (MemoryStream ms = new MemoryStream(imageBytes))
|
|
{
|
|
Image image = Image.FromStream(ms);
|
|
return image;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 日期快捷选项
|
|
|
|
private void FastLastThreeMonth_Click(object sender, EventArgs e)
|
|
{
|
|
DateTime currentDate = DateTime.Now;
|
|
|
|
// 计算最近三个月的日期范围
|
|
Invoke(new Action(() =>
|
|
{
|
|
this.BegDate.Value = currentDate.AddDays(-89);
|
|
this.EndDate.Value = currentDate;
|
|
}));
|
|
}
|
|
|
|
private void FastLastOneMonth_Click(object sender, EventArgs e)
|
|
{
|
|
DateTime currentDate = DateTime.Now;
|
|
|
|
// 计算最近一个月的日期范围
|
|
Invoke(new Action(() =>
|
|
{
|
|
this.BegDate.Value = currentDate.AddDays(-29);
|
|
this.EndDate.Value = currentDate;
|
|
}));
|
|
}
|
|
|
|
private void FastLastWeek_Click(object sender, EventArgs e)
|
|
{
|
|
DateTime currentDate = DateTime.Now;
|
|
|
|
// 计算最近7天的日期范围
|
|
Invoke(new Action(() =>
|
|
{
|
|
this.BegDate.Value = currentDate.AddDays(-6);
|
|
this.EndDate.Value = currentDate;
|
|
}));
|
|
}
|
|
|
|
private void EndDate_CloseUp(object sender, EventArgs e)
|
|
{
|
|
if (EndDate.Value < BegDate.Value)
|
|
{
|
|
var beg = EndDate.Value;
|
|
Invoke(new Action(() =>
|
|
{
|
|
EndDate.Value = BegDate.Value;
|
|
BegDate.Value = beg;
|
|
}));
|
|
}
|
|
}
|
|
|
|
private void BegDate_CloseUp(object sender, EventArgs e)
|
|
{
|
|
if (BegDate.Value > EndDate.Value)
|
|
{
|
|
var end = BegDate.Value;
|
|
Invoke(new Action(() =>
|
|
{
|
|
BegDate.Value = EndDate.Value;
|
|
EndDate.Value = end;
|
|
}));
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 控件赋值
|
|
|
|
public void RegDataBinds(EnrollmentPatient item)
|
|
{
|
|
Invoke(new Action(() =>
|
|
{
|
|
NameLabel.Text = item?.Name;
|
|
SexLabel.Text = item?.Sex == "1" ? "男" : "女";
|
|
NationLabel.Text = string.IsNullOrEmpty(item?.Nation?.Trim()) ? "未知" : item?.Nation;
|
|
BirthdayLabel.Text = item?.Birthday?.ToShortDateString();
|
|
AgeLabel.Text = item?.Age.ToString() + item?.AgeClass;
|
|
ExamDateLabel.Text = item?.ExamDate?.ToShortDateString();
|
|
ExamTypeLabel.Text = item?.Type;
|
|
OccupationLabel.Text = item?.Occupation;
|
|
MaritalLabel.Text = item?.Marriage;
|
|
EducationLabel.Text = item?.Education;
|
|
ContractorLabel1.Text = item?.Contactor1;
|
|
TelLabel1.Text = item?.Tel1;
|
|
AddressLabel1.Text = item?.Address1;
|
|
CardNoLabel.Text = item?.CardNo;
|
|
CompanyLabel.Text = item?.Company;
|
|
RegAvatar.Image = Base64ToImage(item?.Photo);
|
|
}));
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region HIS同步记账
|
|
public void CostToHis(Int64 Eid)
|
|
{
|
|
// 设置请求的 URL
|
|
string baseUrl = "http://200.200.200.71:5050/peisReserve/his/costToHis";
|
|
|
|
// 构建带参数的 URL
|
|
string url = $"{baseUrl}?eid={Eid}&isGroup={false}";
|
|
|
|
// 创建 HttpWebRequest 对象
|
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
|
request.Method = "GET";
|
|
|
|
try
|
|
{
|
|
// 发送请求并获取响应
|
|
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
|
{
|
|
// 检查响应是否成功
|
|
if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
// 读取响应流
|
|
using (Stream responseStream = response.GetResponseStream())
|
|
{
|
|
using (StreamReader reader = new StreamReader(responseStream))
|
|
{
|
|
string responseBody = reader.ReadToEnd();
|
|
Console.WriteLine("Response: " + responseBody);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("Failed to get data. Status code: " + response.StatusCode);
|
|
}
|
|
}
|
|
}
|
|
catch (WebException ex)
|
|
{
|
|
Console.WriteLine("Exception occurred: " + ex.Message);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
protected override object CreatePresenter()
|
|
{
|
|
return new EnrollmentPersonPresenter(this);
|
|
}
|
|
|
|
private void Reg4PersonForm_Load(object sender, EventArgs e)
|
|
{
|
|
}
|
|
}
|
|
} |