Beispiel #1
0
        private void m_miActiveItem_Click(object sender, EventArgs e)
        {
            if (m_lsvDict.SelectedItems.Count <= 0)
            {
                return;
            }

            long lngRes = 0;
            clsEMR_OPInstrumentDomain objDomain = new clsEMR_OPInstrumentDomain();

            for (int i = 0; i < m_lsvDict.SelectedItems.Count; i++)
            {
                int intIdx = m_lsvDict.SelectedItems[i].Index;
                clsEMR_OPInstrument_Dict objDict = m_lsvDict.SelectedItems[i].Tag as clsEMR_OPInstrument_Dict;
                if (objDict == null)
                {
                    continue;
                }
                lngRes = objDomain.m_lngActiveItemFromDict(objDict.m_intOPInstrumentID);

                if (lngRes <= 0)
                {
                    clsPublicFunction.ShowInformationMessageBox("修改失败");
                    return;
                }

                ListViewItem ActiveItem = new ListViewItem((m_lsvActiveItem.Items.Count + 1).ToString());
                ActiveItem.SubItems.Add(objDict.m_strOPInstrumentName);
                ActiveItem.Tag = objDict;
                m_lsvActiveItem.Items.Add(ActiveItem);
            }

            m_mthLoadAllItems();
            m_cmdSaveModify_Click(null, null);
        }
Beispiel #2
0
 /// <summary>
 /// 重新设定已启用项目顺序
 /// </summary>
 private void m_mthReSetAcitveItemOrderID()
 {
     for (int i = 0; i < m_lsvActiveItem.Items.Count; i++)
     {
         m_lsvActiveItem.Items[i].SubItems[0].Text = (i + 1).ToString();
         clsEMR_OPInstrument_Dict objDict = m_lsvActiveItem.Items[i].Tag as clsEMR_OPInstrument_Dict;
         if (objDict != null)
         {
             objDict.m_intOrderID = i + 1;
         }
     }
 }
Beispiel #3
0
        private void m_lsvDict_DoubleClick(object sender, EventArgs e)
        {
            if (m_lsvDict.Items.Count <= 0 || m_lsvDict.SelectedItems.Count != 1)
            {
                return;
            }

            m_objCurrentItem = m_lsvDict.SelectedItems[0].Tag as clsEMR_OPInstrument_Dict;
            if (m_objCurrentItem != null)
            {
                m_cmdSaveItem.Text = "修改项目";
                m_txtItem.Text     = m_objCurrentItem.m_strOPInstrumentName;
            }
        }
Beispiel #4
0
        private void m_cmdSaveItem_Click(object sender, EventArgs e)
        {
            if (m_txtItem.Text.Trim() == string.Empty)
            {
                clsPublicFunction.ShowInformationMessageBox("请先输入手术器械、敷料名称!");
                return;
            }
            clsEMR_OPInstrumentDomain objDomain = new clsEMR_OPInstrumentDomain();
            long lngRes = 0;

            int intInstrumentID = -1;

            lngRes = objDomain.m_lngCheckSameItemID(m_txtItem.Text.Trim(), out intInstrumentID);

            if (m_objCurrentItem == null)
            {
                if (intInstrumentID > 0)
                {
                    clsPublicFunction.ShowInformationMessageBox("已存在该项目!");
                    return;
                }
                lngRes = objDomain.m_lngAddNewToDict(m_txtItem.Text.Trim());
            }
            else
            {
                if (intInstrumentID > 0 && intInstrumentID != m_objCurrentItem.m_intOPInstrumentID)
                {
                    clsPublicFunction.ShowInformationMessageBox("已存在该项目!");
                    return;
                }
                lngRes = objDomain.m_lngModifyToDisc(m_objCurrentItem.m_intOPInstrumentID, m_txtItem.Text.Trim());
            }

            if (lngRes > 0)
            {
                m_mthLoadAllItems();

                int intIdx = m_intGetAllItemsRowNum(m_txtItem.Text.Trim());
                if (intIdx >= 0)
                {
                    m_lsvDict.Items[intIdx].EnsureVisible();
                }
                m_objCurrentItem   = null;
                m_txtItem.Text     = string.Empty;
                m_cmdSaveItem.Text = "保存项目";
            }
        }
Beispiel #5
0
        private void m_cmdSaveModify_Click(object sender, EventArgs e)
        {
            if (m_lsvActiveItem.Items.Count <= 0)
            {
                return;
            }

            try
            {
                this.Cursor = Cursors.WaitCursor;
                clsEMR_OPInstrumentDomain objDomain = new clsEMR_OPInstrumentDomain();
                clsEMR_OPInstrument_Dict  objDict   = null;
                long lngRes = 0;
                for (int i = 0; i < m_lsvActiveItem.Items.Count; i++)
                {
                    objDict = m_lsvActiveItem.Items[i].Tag as clsEMR_OPInstrument_Dict;
                    if (objDict != null)
                    {
                        if (objDict.m_intOrderID == i)
                        {
                            continue;
                        }
                        lngRes = objDomain.m_lngUpdateOrderID(objDict.m_intOPInstrumentID, i);
                    }
                }
                if (lngRes > 0)
                {
                    m_mthLoadActiveItems();
                    clsPublicFunction.ShowInformationMessageBox("修改成功!");
                }
                else
                {
                    clsPublicFunction.ShowInformationMessageBox("修改失败!");
                }
            }
            catch (Exception ex)
            {
                clsPublicFunction.ShowInformationMessageBox("发生如下错误\r\n" + ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #6
0
        private void m_miDeActiveItem_Click(object sender, EventArgs e)
        {
            if (m_lsvActiveItem.SelectedItems.Count <= 0)
            {
                return;
            }

            long lngRes = 0;
            clsEMR_OPInstrumentDomain objDomain = new clsEMR_OPInstrumentDomain();

            ListViewItem[] selectedItem = new ListViewItem[m_lsvActiveItem.SelectedItems.Count];
            for (int i = 0; i < m_lsvActiveItem.SelectedItems.Count; i++)
            {
                clsEMR_OPInstrument_Dict objDict = m_lsvActiveItem.SelectedItems[i].Tag as clsEMR_OPInstrument_Dict;
                if (objDict == null)
                {
                    continue;
                }
                lngRes = objDomain.m_lngDeActiveItemFromDict(objDict.m_intOPInstrumentID);

                if (lngRes <= 0)
                {
                    clsPublicFunction.ShowInformationMessageBox("修改失败");
                    return;
                }
                selectedItem[i] = m_lsvActiveItem.SelectedItems[i];
            }

            for (int i = 0; i < selectedItem.Length; i++)
            {
                m_lsvActiveItem.Items.Remove(selectedItem[i]);
            }

            for (int i = 0; i < m_lsvActiveItem.Items.Count; i++)
            {
                clsEMR_OPInstrument_Dict objDict = m_lsvActiveItem.Items[i].Tag as clsEMR_OPInstrument_Dict;
                objDict.m_intOrderID = i + 1;
                m_lsvActiveItem.Items[i].SubItems[0].Text = (i + 1).ToString();
            }
            m_mthLoadAllItems();

            m_cmdSaveModify_Click(null, null);
        }