747 lines
27 KiB
C#
747 lines
27 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Data;
|
||
using System.Drawing;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Windows.Forms;
|
||
using SOH.Kernel;
|
||
using SOH.BLL;
|
||
using SOH.Entities;
|
||
using EAS;
|
||
using EAS.Data;
|
||
using EAS.Services;
|
||
using SOH.Data;
|
||
using SOH.Entities.DTO;
|
||
using SOH.ShouFei;
|
||
|
||
namespace SOH.QianTai
|
||
{
|
||
[ModuleAttribute(ModuleID = "8EC61C2D-0905-4881-A4A8-E29B4DAF5A96", ModuleName = "前台临时加项")]
|
||
public partial class frmLinShiJiaXiang : SOH.Window.baseChildForm
|
||
{
|
||
private short fddm; //分店代码
|
||
private List<Entities.DTO.dto_zhxm> led; //根据分店选出所有的未注销的组合项目
|
||
private short lxz; //类型:1个人 2团检
|
||
private int tmh; //条码号
|
||
private Role role;
|
||
|
||
public frmLinShiJiaXiang()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
|
||
private void frmLinShiJiaXiang_Load(object sender, EventArgs e)
|
||
{
|
||
this.gvZHX.AutoGenerateColumns = false;
|
||
this.gvZHX_TJ.AutoGenerateColumns = false;
|
||
this.gvLSJX.AutoGenerateColumns = false;
|
||
|
||
//获取分店代码
|
||
string fddmstr = LoginUser.yydm;
|
||
short fd = 0;
|
||
short.TryParse(fddmstr, out fd);
|
||
fddm = fd;
|
||
|
||
//查询所有的组合项目
|
||
var vs = ServiceContainer.GetService<It_zhxm>();
|
||
led = vs.GetZhxm(fddm);
|
||
|
||
LoadKS();
|
||
LoadYS();
|
||
//Load_ZHXM_TJ("", 0, 0);
|
||
//设置加项收费方式默认为自费
|
||
this.cbJFFS.SelectedIndex = 1;
|
||
|
||
//查询用户套餐折率和加项折率
|
||
var vs1 = ServiceContainer.GetService<Iczyrole>();
|
||
role = vs1.GetRoleByczyid(LoginUser.username);
|
||
|
||
|
||
}
|
||
|
||
private void Load_tab1_TC(short xb, short hyzk)
|
||
{
|
||
var vs = ServiceContainer.GetService<IQianTai2>();
|
||
List<t_tc> ltt = vs.GetTCByCondition2(xb, hyzk, fddm);
|
||
if (ltt == null)
|
||
{
|
||
this.cbTJTC.DataSource = null;
|
||
}
|
||
else
|
||
{
|
||
this.cbTJTC.DisplayMember = "tcmc";
|
||
this.cbTJTC.ValueMember = "tcbm";
|
||
this.cbTJTC.DataSource = ltt;
|
||
}
|
||
this.cbTJTC.SelectedIndex = -1;
|
||
|
||
}
|
||
|
||
//加载科室
|
||
private void LoadKS()
|
||
{
|
||
//string fddm_str = LoginUser.yydm; //分店代码
|
||
//int fddm = 0;
|
||
//Int32.TryParse(fddm_str, out fddm);
|
||
int lx = -1;
|
||
var vs = ServiceContainer.GetService<It_ks>();
|
||
List<keshi> ltk = vs.GetAllks("", lx, fddm);
|
||
if (ltk == null)
|
||
{
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
this.cbTJKS.DisplayMember = "ksmc";
|
||
this.cbTJKS.ValueMember = "ksbm";
|
||
this.cbTJKS.DataSource = ltk;
|
||
}
|
||
}
|
||
|
||
|
||
List<t_ygzd> lty = new List<t_ygzd>();
|
||
//加载体检医生
|
||
private void LoadYS()
|
||
{
|
||
var vs = ServiceContainer.GetService<It_ygzd>();
|
||
lty = vs.GetListByFddm(fddm);
|
||
|
||
if (lty != null)
|
||
{
|
||
//this.cbYWDB.DataSource = lty;
|
||
//this.cbYWDB.DisplayMember = "xm";
|
||
//this.cbYWDB.ValueMember = "bm";
|
||
|
||
this.cbJYYS.Items.AddRange(lty.ToArray());
|
||
this.cbJYYS.SelectedIndex = -1;
|
||
}
|
||
}
|
||
|
||
//确定按钮
|
||
private void btnQD_Click(object sender, EventArgs e)
|
||
{
|
||
if (this.gvLSJX.DataSource == null || this.gvLSJX.Rows.Count == 0)
|
||
{
|
||
MessageBox.Show("没有加项信息");
|
||
return;
|
||
}
|
||
|
||
|
||
|
||
List<dto_lsjx> ldl = this.gvLSJX.DataSource as List<dto_lsjx>;
|
||
if (ldl == null || ldl.Count == 0)
|
||
{
|
||
MessageBox.Show("没有加项信息");
|
||
return;
|
||
}
|
||
var vs = ServiceContainer.GetService<IQianTai>();
|
||
short jffs = (short)this.cbJFFS.SelectedIndex;
|
||
|
||
var FenDianService = ServiceContainer.GetService<IFenDian>();
|
||
FenDian fd = FenDianService.getFenDianById(Convert.ToInt32(LoginUser.yydm));
|
||
|
||
OperationResult or = vs.LSJX(ldl, tmh, jffs, lxz, fddm, LoginUser.username, fd.isPaidui.ToString());
|
||
if (or.State == 1)
|
||
{
|
||
if (jffs == 0)
|
||
{
|
||
var vser = ServiceContainer.GetService<IShouFei>();
|
||
List<dto_tmdy> nody = vser.getycztm(tmh);
|
||
frmprinttm ftm = new frmprinttm();
|
||
ftm.init(tmh, 0, 0, nody);
|
||
ftm.print();
|
||
}
|
||
|
||
|
||
MessageBox.Show(or.Message);
|
||
Clear();
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("临时加项失败," + or.Message);
|
||
return;
|
||
}
|
||
}
|
||
|
||
//取消按钮
|
||
private void btnQX_Click(object sender, EventArgs e)
|
||
{
|
||
Clear();
|
||
}
|
||
|
||
private void Clear()
|
||
{
|
||
//清空信息
|
||
this.tbTm.Text = "";
|
||
this.tbXM.Text = "";
|
||
this.tbXB.Text = "";
|
||
this.tbNL.Text = "";
|
||
this.tbHYZK.Text = "";
|
||
this.cbDYZYD.Checked = false;
|
||
this.gvZHX.DataSource = null;
|
||
this.gvLSJX.DataSource = null;
|
||
this.cbJFFS.SelectedIndex = -1;
|
||
this.tbLJJ.Text = "0";
|
||
this.nudZL.Value = 100;
|
||
this.tbSSJE.Text = "0";
|
||
this.gvLSJX.DataSource = null;
|
||
this.gvZHX_TJ.DataSource = null;
|
||
this.cbJYYS.SelectedIndex = -1;
|
||
this.txbXydb.Text = "";
|
||
tmh = 0;
|
||
lxz = 0;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 根据助记符,性别和婚姻状况加载组合项
|
||
/// </summary>
|
||
/// <param name="zjf"></param>
|
||
/// <param name="xb"></param>
|
||
/// <param name="hyzk"></param>
|
||
private void Load_ZHXM_TJ(string zjf, short xb, short hyzk)
|
||
{
|
||
if (led == null)
|
||
{
|
||
return;
|
||
}
|
||
//var data = led.Where(t => (xb == 2 ? true : (t.xb == xb && t.xb == 2)) && (hyzk == 2 ? true : (t.hyzk == hyzk && t.hyzk == 2)) && ((zjf == null || zjf == "") ? true : (t.zjm.Contains(zjf))));
|
||
var data = led.Where(t => ((zjf == null || zjf == "") ? true : (t.zjm.Contains(zjf))));
|
||
if (data.Any())
|
||
{
|
||
List<Entities.DTO.dto_zhxm> ld = data.OrderBy(t => t.ksbm).ToList();
|
||
this.gvZHX_TJ.DataSource = null;
|
||
this.gvZHX_TJ.DataSource = ld;
|
||
}
|
||
else
|
||
{
|
||
this.gvZHX_TJ.DataSource = null;
|
||
}
|
||
}
|
||
|
||
private void tbZJF_KeyDown(object sender, KeyEventArgs e)
|
||
{
|
||
if (e.KeyCode == Keys.Enter)
|
||
{
|
||
short xb = (short)(this.tbXB.Text == "男" ? 0 : (this.tbXB.Text == "女" ? 1 : 2));
|
||
short hyzk = (short)(this.tbHYZK.Text == "未婚" ? 0 : (this.tbHYZK.Text == "已婚" ? 1 : 2));
|
||
string zjf = this.tbZJF.Text.Trim();
|
||
zjf = zjf.ToLower();
|
||
Load_ZHXM_TJ(zjf, xb, hyzk);
|
||
}
|
||
}
|
||
|
||
private void cbTJKS_SelectedValueChanged(object sender, EventArgs e)
|
||
{
|
||
string ksmc = this.cbTJKS.SelectedItem == null ? "" : this.cbTJKS.SelectedItem.ToString();
|
||
if (string.IsNullOrEmpty(ksmc))
|
||
{
|
||
return;
|
||
}
|
||
for (int i = 0; i < this.gvZHX_TJ.Rows.Count; i++)
|
||
{
|
||
string temp = this.gvZHX_TJ.Rows[i].Cells["ksmc3"].Value.ToString();
|
||
if (temp.Equals(ksmc))
|
||
{
|
||
this.gvZHX_TJ.FirstDisplayedScrollingRowIndex = i;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
//双击选择组合项
|
||
private void gvZHX_TJ_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||
{
|
||
if (e.RowIndex == -1)
|
||
{
|
||
return;
|
||
}
|
||
t_ygzd ygzdd = new t_ygzd();
|
||
ygzdd = (t_ygzd)this.cbJYYS.SelectedItem;
|
||
|
||
if (string.IsNullOrEmpty(txbXydb.Text) && (ygzdd == null || ygzdd.bm == -1 || ygzdd.bm == 0))
|
||
{
|
||
MessageBox.Show("请选择加项医生或者输入业务代表信息!");
|
||
this.txbXydb.Focus();
|
||
return;
|
||
}
|
||
|
||
//判断是否在已交费的组合项目中存在选中的项目
|
||
dto_zhxm dz = this.gvZHX_TJ.Rows[e.RowIndex].DataBoundItem as dto_zhxm;
|
||
//拼接加项实体
|
||
dto_lsjx dl = new dto_lsjx();
|
||
dl.zhbm = dz.zhbm;
|
||
dl.zhmc = dz.zhmc;
|
||
dl.ksbm = dz.ksbm;
|
||
|
||
|
||
//dl.jyys = ygzdd == null ? "无" : ygzdd.xm;
|
||
dl.jyys = this.txbXydb.Text;
|
||
|
||
//dl.jyys = this.cbJYYS.SelectedText == null ? "" : this.cbJYYS.SelectedText;
|
||
//建议医生编码,没有为0
|
||
if (ygzdd == null || ygzdd.bm == -1 || ygzdd.bm == 0)
|
||
{
|
||
dl.jyysbm = 0;
|
||
//dl.jyys = this.txbXydb.Text;
|
||
}
|
||
else
|
||
{
|
||
//dl.jyys = this.txbXydb.Text;
|
||
dl.jyysbm = ygzdd.bm;
|
||
}
|
||
|
||
dl.jg_v = dz.jg;
|
||
double zl = (double)this.nudZL.Value;
|
||
dl.zl = short.Parse(zl.ToString());
|
||
dl.zhj_v = dz.jg * zl / 100;
|
||
|
||
//获取已交费的组合项目列表的数据源
|
||
List<dto_zhxm> ltz = this.gvZHX.DataSource as List<dto_zhxm>;
|
||
if (ltz == null)
|
||
{
|
||
ltz = new List<dto_zhxm>();
|
||
}
|
||
//加项grid中的数据源
|
||
List<dto_lsjx> ltj = this.gvLSJX.DataSource as List<dto_lsjx>;
|
||
if (ltj == null)
|
||
{
|
||
ltj = new List<dto_lsjx>();
|
||
}
|
||
|
||
if (ltz.Where(t => t.zhbm == dz.zhbm).Any() || ltj.Where(t => t.zhbm == dl.zhbm).Any())
|
||
{
|
||
MessageBox.Show("该组合项目已经在套餐项目或者加项中存在!");
|
||
return;
|
||
}
|
||
else //加项和套餐中都没有的,直接放到加项中
|
||
{
|
||
ltj.Add(dl);
|
||
this.gvLSJX.DataSource = null;
|
||
this.gvLSJX.DataSource = ltj;
|
||
//设置加项费用-累计价和实收金额
|
||
SetJXFY();
|
||
|
||
//移除原来的项
|
||
//List<Entities.DTO.dto_zhxm> list = this.gvZHX_TJ.DataSource as List<Entities.DTO.dto_zhxm>;
|
||
//list.Remove(dz);
|
||
//this.gvZHX_TJ.DataSource = list;
|
||
}
|
||
|
||
|
||
}
|
||
|
||
//从选择的组合项目中去掉组合项
|
||
private void gvLSJX_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||
{
|
||
if (e.RowIndex == -1)
|
||
{
|
||
return;
|
||
}
|
||
int rindex = this.gvLSJX.SelectedRows[0].Index;
|
||
dto_lsjx dl = this.gvLSJX.Rows[rindex].DataBoundItem as dto_lsjx;
|
||
List<dto_lsjx> ltj = this.gvLSJX.DataSource as List<dto_lsjx>;
|
||
if (ltj == null)
|
||
{
|
||
ltj = new List<dto_lsjx>();
|
||
MessageBox.Show("操作中发生异常");
|
||
return;
|
||
}
|
||
ltj.Remove(dl);
|
||
this.gvLSJX.DataSource = null;
|
||
this.gvLSJX.DataSource = ltj;
|
||
//设置加项费用-累计价和实收金额
|
||
SetJXFY();
|
||
|
||
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
///根据新折率设置加项费用和实收金额
|
||
/// </summary>
|
||
private void SetJXFY()
|
||
{
|
||
List<dto_lsjx> ldl = new List<dto_lsjx>();
|
||
if (this.gvLSJX.DataSource == null)
|
||
{
|
||
this.tbLJJ.Text = "0";
|
||
this.tbSSJE.Text = "0";
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
ldl = this.gvLSJX.DataSource as List<dto_lsjx>;
|
||
double ljj = 0D;
|
||
double ssje = 0D;
|
||
for (int i = 0; i < ldl.Count; i++)
|
||
{
|
||
dto_lsjx dl = ldl[i];
|
||
ljj += dl.jg_v;
|
||
ssje += dl.zhj_v;
|
||
}
|
||
int ljjint = (int)ljj;
|
||
int ssjeint = (int)ssje;
|
||
this.tbLJJ.Text = ljjint.ToString();
|
||
this.tbSSJE.Text = ssjeint.ToString();
|
||
}
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 折率变化
|
||
/// </summary>
|
||
/// <param name="zl"></param>
|
||
private void ZLChange(short zl)
|
||
{
|
||
List<dto_lsjx> ldl = new List<dto_lsjx>();
|
||
if (this.gvLSJX.DataSource == null)
|
||
{
|
||
this.tbLJJ.Text = "0";
|
||
this.tbSSJE.Text = "0";
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
ldl = this.gvLSJX.DataSource as List<dto_lsjx>;
|
||
List<dto_lsjx> ldl2 = new List<dto_lsjx>();
|
||
double ljj = 0D;
|
||
double ssje = 0D;
|
||
for (int i = 0; i < ldl.Count; i++)
|
||
{
|
||
dto_lsjx dl = ldl[i];
|
||
dl.zl = zl;
|
||
dl.zhj_v = dl.jg_v * zl / 100;
|
||
ldl2.Add(dl);
|
||
ljj += dl.jg_v;
|
||
ssje += dl.zhj_v;
|
||
}
|
||
this.gvLSJX.DataSource = null;
|
||
this.gvLSJX.DataSource = ldl2;
|
||
int ljjint = (int)ljj;
|
||
int ssjeint = (int)ssje;
|
||
this.tbLJJ.Text = ljjint.ToString();
|
||
this.tbSSJE.Text = ssjeint.ToString();
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 折率变化
|
||
/// </summary>
|
||
/// <param name="je"></param>
|
||
private void JEChange(short zl)
|
||
{
|
||
List<dto_lsjx> ldl = new List<dto_lsjx>();
|
||
if (this.gvLSJX.DataSource == null)
|
||
{
|
||
this.tbLJJ.Text = "0";
|
||
this.tbSSJE.Text = "0";
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
ldl = this.gvLSJX.DataSource as List<dto_lsjx>;
|
||
List<dto_lsjx> ldl2 = new List<dto_lsjx>();
|
||
double ljj = 0D;
|
||
double ssje = 0D;
|
||
for (int i = 0; i < ldl.Count; i++)
|
||
{
|
||
dto_lsjx dl = ldl[i];
|
||
dl.zl = zl;
|
||
dl.zhj_v = dl.jg_v * zl / 100;
|
||
ldl2.Add(dl);
|
||
ljj += dl.jg_v;
|
||
ssje += dl.zhj_v;
|
||
}
|
||
this.gvLSJX.DataSource = null;
|
||
this.gvLSJX.DataSource = ldl2;
|
||
int ljjint = (int)ljj;
|
||
int ssjeint = (int)ssje;
|
||
this.tbLJJ.Text = ljjint.ToString();
|
||
this.tbSSJE.Text = ssjeint.ToString();
|
||
}
|
||
}
|
||
|
||
private void nudZL_ValueChanged(object sender, EventArgs e)
|
||
{
|
||
if ((short)this.nudZL.Value < role.jxzl)
|
||
{
|
||
MessageBox.Show("加项折率超出角色权限");
|
||
//this.udJXZL.UpButton();
|
||
this.nudZL.Value = role.jxzl;
|
||
return;
|
||
}
|
||
|
||
short zl = (short)this.nudZL.Value;
|
||
ZLChange(zl);
|
||
}
|
||
|
||
//根据条码获取信息
|
||
private void tbTm_KeyDown(object sender, KeyEventArgs e)
|
||
{
|
||
if (e.KeyCode != Keys.Enter) //非回车键
|
||
{
|
||
return;
|
||
}
|
||
string tmstr = this.tbTm.Text.Trim();
|
||
if (string.IsNullOrEmpty(tmstr) || tmstr.Length != 10)
|
||
{
|
||
MessageBox.Show("条码格式错误");
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
int tm = 0;
|
||
if (Int32.TryParse(tmstr, out tm))
|
||
{
|
||
//条码格式正确,进入查询
|
||
//select * from t_changeitem where tm=1000001963 and lx=1 and sfbj=0
|
||
var vs = ServiceContainer.GetService<IQianTai>();
|
||
dto_gzb dg = vs.GetInfoByTm(tm);
|
||
if (dg == null)
|
||
{
|
||
MessageBox.Show("未能找到条码对应的客户");
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
if (dg.tmztz == 2 || dg.tmztz == 3) //2-已经交费等待体检的,3-加项未收费,这两种可以临时加项
|
||
{
|
||
//公共信息赋值
|
||
tmh = tm;
|
||
lxz = dg.lx;
|
||
|
||
//个检和团检都从t_tempdjxm中查询相关的已交费组合项目
|
||
List<dto_zhxm> ldz = vs.GetZhxm_YJF_JJX(tm);
|
||
this.gvZHX.DataSource = null;
|
||
this.gvZHX.DataSource = ldz;
|
||
|
||
this.tbXM.Text = dg.xm;
|
||
this.tbXB.Text = dg.v_xb;
|
||
this.tbNL.Text = dg.nl.ToString();
|
||
this.tbHYZK.Text = dg.hyzk == 0 ? "未婚" : (dg.hyzk == 1 ? "已婚" : "");
|
||
//this.cbJFFS.SelectedIndex = (int)th.jxgzfbj;
|
||
//this.nudZL.Value = th.jxzl; //加项折率
|
||
|
||
//根据性别和婚姻状况加载相关组合项目
|
||
Load_ZHXM_TJ("", dg.xb, dg.hyzk);
|
||
|
||
//如果是个检,收费方式为自费;如果是团检,可能自费可能收费
|
||
if (dg.lx == 1) //个检
|
||
{
|
||
this.cbJFFS.SelectedIndex = 1; //计费方式 自费
|
||
//载入个检的套餐项目及是否有已经加项的项目
|
||
this.nudZL.Value = 100; //个人加项折率
|
||
this.nudZL.ReadOnly = false;
|
||
}
|
||
else //团检
|
||
{
|
||
//团检设置加项折率
|
||
//根据htbm和htfzbm 查询收费方式
|
||
//select jxgzfbj,jxzl from t_htfzb where htfzbm=166 and htbm=82
|
||
var vs_htfz = ServiceContainer.GetService<It_htfzb>();
|
||
int htfzbm = dg.tcbm; //团检中的htfzbm存在tcbm中
|
||
t_htfzb th = vs_htfz.GetModelByfzbm(htfzbm);
|
||
if (th == null)
|
||
{
|
||
//按常理不存在这个情况
|
||
}
|
||
else
|
||
{
|
||
this.cbJFFS.SelectedIndex = (int)th.jxgzfbj;
|
||
this.nudZL.Value = th.jxzl; //加项折率
|
||
//this.tbXM.Text = dg.xm;
|
||
//this.tbXB.Text = dg.v_xb;
|
||
//this.tbNL.Text = dg.nl.ToString();
|
||
//this.tbHYZK.Text = dg.hyzk == 0 ? "未婚" : (dg.hyzk == 1 ? "已婚" : "");
|
||
//this.cbJFFS.SelectedIndex = (int)th.jxgzfbj;
|
||
//this.nudZL.Value = th.jxzl; //加项折率
|
||
//this.nudZL.ReadOnly = true;
|
||
//根据性别和婚姻状况加载相关组合项目
|
||
//Load_ZHXM_TJ("", dg.xb, dg.hyzk);
|
||
}
|
||
|
||
////加载已交费的组合项目信息
|
||
//var vs_htxmb = ServiceContainer.GetService<It_zhxm>();
|
||
//List<t_zhxm> lth = vs_htxmb.GetzhxmByhtfzbm(htfzbm);
|
||
//this.gvZHX.DataSource = null;
|
||
//this.gvZHX.DataSource = lth;
|
||
}
|
||
|
||
Load_tab1_TC(dg.xb, dg.hyzk);
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("此客户的状态不能进行加项");
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("条码格式错误");
|
||
return;
|
||
}
|
||
|
||
}
|
||
}
|
||
List<t_ygzd> listNew = new List<t_ygzd>();
|
||
private void cbJYYS_TextUpdate(object sender, EventArgs e)
|
||
{
|
||
//清空combobox
|
||
this.cbJYYS.Items.Clear();
|
||
//清空listNew
|
||
listNew.Clear();
|
||
//遍历全部备查数据
|
||
|
||
var data = lty.Where(t => ((this.cbJYYS.Text == null || this.cbJYYS.Text == "") ? true : (t.zjm.Contains(this.cbJYYS.Text))));
|
||
if (data.Any())
|
||
{
|
||
listNew = data.ToList();
|
||
//combobox添加已经查到的关键词
|
||
this.cbJYYS.Items.AddRange(listNew.ToArray());
|
||
//设置光标位置,否则光标位置始终保持在第一列,造成输入关键词的倒序排列
|
||
this.cbJYYS.SelectionStart = this.cbJYYS.Text.Length;
|
||
//保持鼠标指针原来状态,有时候鼠标指针会被下拉框覆盖,所以要进行一次设置。
|
||
Cursor = Cursors.Default;
|
||
//自动弹出下拉框
|
||
this.cbJYYS.DroppedDown = true;
|
||
}
|
||
}
|
||
|
||
private void cbTJTC_SelectionChangeCommitted(object sender, EventArgs e)
|
||
{
|
||
if (this.cbTJTC.Text != "System.Data.DataRowView")
|
||
{
|
||
t_ygzd ygzdd = new t_ygzd();
|
||
ygzdd = (t_ygzd)this.cbJYYS.SelectedItem;
|
||
|
||
if (string.IsNullOrEmpty(txbXydb.Text) && (ygzdd == null || ygzdd.bm == -1 || ygzdd.bm == 0))
|
||
{
|
||
MessageBox.Show("请选择加项医生或者输入业务代表信息!");
|
||
this.txbXydb.Focus();
|
||
return;
|
||
}
|
||
|
||
string tcbmstr = this.cbTJTC.SelectedValue == null ? "" : this.cbTJTC.SelectedValue.ToString();
|
||
short tcbm = 0;
|
||
short.TryParse(tcbmstr, out tcbm);
|
||
|
||
var vs = ServiceContainer.GetService<It_zhxm>();
|
||
List<Entities.DTO.dto_zhxm> zhxms = vs.GetZhxmBytcbm(tcbm);
|
||
|
||
foreach(dto_zhxm zz in zhxms)
|
||
{
|
||
//获取已交费的组合项目列表的数据源
|
||
List<dto_zhxm> ltz = this.gvZHX.DataSource as List<dto_zhxm>;
|
||
if (ltz == null)
|
||
{
|
||
ltz = new List<dto_zhxm>();
|
||
}
|
||
//加项grid中的数据源
|
||
List<dto_lsjx> ltj = this.gvLSJX.DataSource as List<dto_lsjx>;
|
||
if (ltj == null)
|
||
{
|
||
ltj = new List<dto_lsjx>();
|
||
}
|
||
|
||
if (ltz.Where(t => t.zhbm == zz.zhbm).Any() || ltj.Where(t => t.zhbm == zz.zhbm).Any())
|
||
{
|
||
MessageBox.Show("该加项包项目已经在套餐项目或者加项中存在!");
|
||
return;
|
||
}
|
||
}
|
||
|
||
foreach (dto_zhxm zx in zhxms)
|
||
{
|
||
//判断是否在已交费的组合项目中存在选中的项目
|
||
dto_zhxm dz = zx;
|
||
//拼接加项实体
|
||
dto_lsjx dl = new dto_lsjx();
|
||
dl.zhbm = dz.zhbm;
|
||
dl.zhmc = dz.zhmc;
|
||
dl.ksbm = dz.ksbm;
|
||
|
||
|
||
//dl.jyys = ygzdd == null ? "无" : ygzdd.xm;
|
||
dl.jyys = this.txbXydb.Text;
|
||
|
||
//dl.jyys = this.cbJYYS.SelectedText == null ? "" : this.cbJYYS.SelectedText;
|
||
//建议医生编码,没有为0
|
||
if (ygzdd == null || ygzdd.bm == -1 || ygzdd.bm == 0)
|
||
{
|
||
dl.jyysbm = 0;
|
||
//dl.jyys = this.txbXydb.Text;
|
||
}
|
||
else
|
||
{
|
||
//dl.jyys = this.txbXydb.Text;
|
||
dl.jyysbm = ygzdd.bm;
|
||
}
|
||
|
||
dl.jg_v = dz.jg;
|
||
double zl = (double)this.nudZL.Value;
|
||
dl.zl = short.Parse(zl.ToString());
|
||
dl.zhj_v = dz.jg * zl / 100;
|
||
|
||
//获取已交费的组合项目列表的数据源
|
||
List<dto_zhxm> ltz = this.gvZHX.DataSource as List<dto_zhxm>;
|
||
if (ltz == null)
|
||
{
|
||
ltz = new List<dto_zhxm>();
|
||
}
|
||
//加项grid中的数据源
|
||
List<dto_lsjx> ltj = this.gvLSJX.DataSource as List<dto_lsjx>;
|
||
if (ltj == null)
|
||
{
|
||
ltj = new List<dto_lsjx>();
|
||
}
|
||
|
||
/*if (ltz.Where(t => t.zhbm == dz.zhbm).Any() || ltj.Where(t => t.zhbm == dl.zhbm).Any())
|
||
{
|
||
MessageBox.Show("该加项包项目已经在套餐项目或者加项中存在!");
|
||
|
||
this.gvLSJX.DataSource = null;
|
||
this.tbLJJ.Text = "0";
|
||
this.tbSSJE.Text = "0";
|
||
return;
|
||
}
|
||
else //加项和套餐中都没有的,直接放到加项中
|
||
{*/
|
||
ltj.Add(dl);
|
||
this.gvLSJX.DataSource = null;
|
||
this.gvLSJX.DataSource = ltj;
|
||
//设置加项费用-累计价和实收金额
|
||
SetJXFY();
|
||
|
||
//移除原来的项
|
||
//List<Entities.DTO.dto_zhxm> list = this.gvZHX_TJ.DataSource as List<Entities.DTO.dto_zhxm>;
|
||
//list.Remove(dz);
|
||
//this.gvZHX_TJ.DataSource = list;
|
||
/* }*/
|
||
}
|
||
|
||
/*
|
||
|
||
if (tcbm == a_tcbm)
|
||
{
|
||
|
||
}
|
||
else
|
||
{
|
||
a_tcbm = tcbm;
|
||
this.gvJXMX.DataSource = null;
|
||
this.gvJXXM.DataSource = null;
|
||
Load_tab1_TCXM(tcbm);
|
||
GetTCJG();
|
||
GetJXJG();
|
||
tb_tcZJM.Text = "";
|
||
}
|
||
this.btnDJ.Focus();*/
|
||
}
|
||
}
|
||
}
|
||
}
|