Exemplo n.º 1
0
        private void lvTPNItems_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if ((null == lbOrders.SelectedItem) || (null == lvTPNItems.SelectedItem))
            {
                return;
            }

            recipemonitorlist.TPNItemModel item = (recipemonitorlist.TPNItemModel)lvTPNItems.SelectedItem;
            if ("_EXPAND_".Equals(item.Code))
            {
                this.tpnView.showTPN(true);
            }

            else if ("_COLLAPSED_".Equals(item.Code))
            {
                this.tpnView.showTPN(false);
            }

            else if (!string.IsNullOrWhiteSpace(item.Code) && (0 < item.ID))
            {
                OrdersModel ord = (OrdersModel)lbOrders.SelectedItem;

                tpnmonitor.frmCalDetail frmDetail = new tpnmonitor.frmCalDetail();
                frmDetail.init(AppConst.db, ord.RecipeID, item.Code);
                frmDetail.ShowDialog();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// TPN参数监护和敢于
        /// </summary>
        private void TPNCustodyIntervene(bool _isIntervene)
        {
            if (0 == lvTPNItems.SelectedItems.Count)
            {
                BLPublic.Dialogs.Alert("请选择要监护的项目");
                lvTPNItems.Focus();
                return;
            }

            if (!WinCustodyEdit.chkWin(_isIntervene))
            {
                return;
            }

            if ((1 == lvTPNItems.SelectedItems.Count) && (0 >= ((recipemonitorlist.TPNItemModel)lvTPNItems.SelectedItems[0]).ID))
            {
                BLPublic.Dialogs.Alert("请选择TPN项目");
                lvTPNItems.Focus();
                return;
            }

            recipemonitorlist.TPNItemModel tpn = null;
            if (null == WinCustodyEdit.OnSetObject)
            {
                if (!WinCustodyEdit.TPNCustodyIntervene(this.patient.PatientCode, _isIntervene,
                                                        (id, objStr, desc) =>
                {
                    if (_isIntervene)
                    {
                        this.addIntervene(id, objStr, desc);
                    }
                    else
                    {
                        this.addCustody(id, objStr, desc);
                    }

                    lbOpRecord.Items.Refresh();
                }))
                {
                    return;
                }
            }

            foreach (object o in lvTPNItems.SelectedItems)
            {
                tpn = (recipemonitorlist.TPNItemModel)o;
                if (0 < tpn.ID)
                {
                    WinCustodyEdit.OnSetObject(WinCustodyEdit.OBJTYP_TPN, tpn.Code, tpn.Name, tpn.Value + tpn.Unit,
                                               Convert.ToDateTime(((OrdersModel)lbOrders.SelectedItem).OrderTime));
                }
            }
        }