private void GetData() { Neusoft.HISFC.BizLogic.Manager.AdjustPrice pric = new Neusoft.HISFC.BizLogic.Manager.AdjustPrice(); string strMorning = this.neuDateTimePicker1.Value.ToShortDateString() + " 00:00:00"; string strNight = this.neuDateTimePicker2.Value.ToShortDateString() + " 23:59:59"; ArrayList List = pric.SelectPriceAdjustHead(Convert.ToDateTime(strMorning), Convert.ToDateTime(strNight)); AddDataToTree(List); }
private void neuTreeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { try { Neusoft.HISFC.BizLogic.Manager.AdjustPrice pric = new Neusoft.HISFC.BizLogic.Manager.AdjustPrice(); ArrayList List = pric.SelectPriceAdjustTail(e.Node.Tag.ToString()); AddDataToTable(List); } catch (Exception ee) { MessageBox.Show(ee.Message); } SerWidth(); }
private void SaveInfo() { try { this.neuSpread1.StopCellEditing(); Neusoft.HISFC.BizLogic.Manager.AdjustPrice price = new Neusoft.HISFC.BizLogic.Manager.AdjustPrice(); //获取调价单流水号 string SequenceNo = price.GetAdjustPriceSequence(); Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); //Neusoft.FrameWork.Management.Transaction Addtrans = new Neusoft.FrameWork.Management.Transaction(price.Connection); //Addtrans.BeginTransaction(); price.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); #region 判断时间是否有效 if (!ckbImmediate.Checked) //定时生效 { if (this.dtpImmediate.Value < System.DateTime.Now) { this.dtpImmediate.Focus(); Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("生效的时间不能小于当前时间")); return; } } #endregion //获取要调价的信息 ArrayList list = GetInfo(SequenceNo); if (list == null) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("获取调价信息出错")); return; } #region 调价头表和明细表 保存调价信息 foreach (Neusoft.HISFC.Models.Fee.Item.AdjustPrice info in list) { //如果有以前调价还没有生效的 ,跟这次调价有冲突的 ,作废以前的调价记录 int temp = price.UpdateAdjustPriceDetail(info.OrgItem.ID); } //插入调价头表 //插入调价明细表 bool PriceHead = false; bool Result = true; foreach (Neusoft.HISFC.Models.Fee.Item.AdjustPrice info in list) { if (!PriceHead) { //向调价头表中插入一条新的记录 fin_com_adjustundrugpricehead if (price.InsertAdjustPrice(info) <= 0) { Result = false; break; } else { PriceHead = true; } } //向调价明细中插入新的记录 fin_com_adjustundrugpricedetai if (price.InsertAdjustPriceDetail(info) <= 0) { Result = false; break; } } if (Result) { //提交数据 Neusoft.FrameWork.Management.PublicTrans.Commit(); MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("保存成功")); if (AdjustTable != null) { AdjustTable.Clear(); } } else { //回退信息 Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("保存调价信息失败")); } #endregion #region 如果是立即生效 保存非药品 价格 if (ckbImmediate.Checked) //立即生效 { Neusoft.HISFC.BizLogic.Fee.Item manItem = new Neusoft.HISFC.BizLogic.Fee.Item(); manItem.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); Neusoft.HISFC.Models.Fee.Item.Undrug temItem = null; foreach (Neusoft.HISFC.Models.Fee.Item.AdjustPrice info in list) { //先转化成ITEM然后执行更新操作 temItem = new Neusoft.HISFC.Models.Fee.Item.Undrug(); //药品编码 temItem.ID = info.OrgItem.ID; //默认价 temItem.Price = info.NewItem.Price; //儿童价 temItem.ChildPrice = info.NewItem.ChildPrice; //特诊价 temItem.SpecialPrice = info.NewItem.SpecialPrice; //执行更新操作。 if (manItem.AdjustPrice(temItem) < 1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg(manItem.Err)); return; } //{6DF09817-9532-4129-BE60-DED731C7E5B9} 更新所有含有该项目的复合项目价格 //manItem.QueryZTListByDetailItem(temItem); } } #endregion } catch (Exception ex) { MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg(ex.Message)); } }