/// <summary>
        /// 导入已处理数据
        /// </summary>
        public void m_mthSelectEnAskList()
        {
            clsMedStoreMedAppl_VO objItem = new clsMedStoreMedAppl_VO();

            if (this.m_objViewer.m_lsvEnAsk.SelectedItems[0].Tag != null)
            {
                objItem = (clsMedStoreMedAppl_VO)this.m_objViewer.m_lsvEnAsk.SelectedItems[0].Tag;
                clsMedStoreMedApplDe_VO[] objItemArr = new clsMedStoreMedApplDe_VO[0];
                long lngRes = 0;
                lngRes = this.m_objManage.m_lngGetMedApplDeByApplID(objItem.m_strMedApplID.Trim(), out objItemArr);

                if (lngRes > 0 && objItemArr.Length > 0)
                {
                    m_mthSetOrd(objItem);
                    this.m_objViewer.m_lsvDetail.Items.Clear();
                    for (int i1 = 0; i1 < objItemArr.Length; i1++)
                    {
                        m_mthInsertDetailList(objItemArr[i1]);
                    }
                    m_mthClearArr();
                    m_mthLockRecord();
                    m_mthLockDetailList();
                    m_mthLockMedInputPlan();
                    m_mthLockAddButton();
                    m_mthLockDeleteButton();
                    m_mthLockInsertButton();
                    m_mthLockOkButton();
                    m_mthLockSaveButton();
                }
            }
        }
        /// <summary>
        /// 检测列表中是否已经存在该药品信息
        /// </summary>
        /// <param name="objItem">药品数据</param>
        /// <param name="index">索引</param>
        /// <returns></returns>
        private bool m_mthCheckExistsList(clsMedicine_VO objItem, out int index)
        {
            bool blnResult = true;

            index = 0;

            for (int i = 0; i < this.m_objViewer.m_lsvDetail.Items.Count; i++)
            {
                clsMedStoreMedApplDe_VO objTmp = new clsMedStoreMedApplDe_VO();
                objTmp = (clsMedStoreMedApplDe_VO)this.m_objViewer.m_lsvDetail.Items[i].Tag;
                if (objTmp != null)
                {
                    if (objItem.m_strMedicineID.Trim() == objTmp.m_objMedicine.m_strMedicineID.Trim())
                    {
                        blnResult = false;
                        index     = i;
                        break;
                    }
                }
                else
                {
                    blnResult = true;
                }
            }
            return(blnResult);
        }
        /// <summary>
        /// 设置药品输入窗口的数据
        /// </summary>
        /// <param name="objItem">领药申请明细数据</param>
        private void m_mthSetInputPanl(clsMedStoreMedApplDe_VO objItem)
        {
            this.m_objDetail = objItem;

            if (this.m_objDetail == null)
            {
                m_mthClearDetailInput();
                m_mthUnLockMedInputPlan();
                this.m_objViewer.m_txtMedID.Focus();
                return;
            }
            else
            {
                m_mthClearDetailInput();
                m_mthUnLockMedInputPlan();
                m_mthLockMedicineInput();

                this.m_objViewer.m_txtMedID.Text   = this.m_objDetail.m_objMedicine.m_strMedicineID;
                this.m_objViewer.m_txtMedName.Text = this.m_objDetail.m_objMedicine.m_strMedicineName;
                this.m_objViewer.m_txtMedSpec.Text = this.m_objDetail.m_objMedicine.m_strMedicineName;
                //				this.m_objViewer.m_txtMedID.Tag = this.m_objDetail.m_objMedicine;
                this.m_objViewer.m_txtUnit.Text = this.m_objDetail.m_objUnit.m_strUnitName;
                this.m_objViewer.m_txtUnit.Tag  = this.m_objDetail.m_objUnit;
                this.m_objViewer.m_txtQty.Text  = this.m_objDetail.m_decQty.ToString("######.00");
                this.m_objViewer.m_txtQty.Focus();
                return;
            }
        }
        /// <summary>
        /// 新增明细
        /// </summary>
        private void m_mthAddDetail()
        {
            clsMedStoreMedApplDe_VO objItem = new clsMedStoreMedApplDe_VO();

            objItem.m_objMedicine = new clsMedicine_VO();
            objItem.m_objUnit     = new clsUnit_VO();

            objItem.m_strRowNo     = m_mthGetRowNo();
            objItem.m_strMedApplID = this.m_objViewer.m_txtOrdID.Text.Trim();
            if (this.m_objViewer.m_txtMedID.Tag != null)
            {
                clsStorageMedDetail_VO objItemTmp = (clsStorageMedDetail_VO)this.m_objViewer.m_txtMedID.Tag;
                objItem.m_objMedicine = objItemTmp.m_objMedicine;
                objItem.m_strSysLotNo = objItemTmp.m_strSysLotNo;
            }
            if (this.m_objViewer.m_txtUnit.Tag != null)
            {
                objItem.m_objUnit = (clsUnit_VO)this.m_objViewer.m_txtUnit.Tag;
            }
            objItem.m_strApplDate = clsPublicParm.s_datGetServerDate().ToString("yyyy-MM-dd HH:mm:ss");
            objItem.m_decQty      = Convert.ToDecimal(this.m_objViewer.m_txtQty.Text);

            m_mthAddToAddNewArr(objItem);
            m_mthInsertDetailList(objItem);
        }
 /// <summary>
 ///
 /// </summary>
 public clsControlMedStoreMedAppl()
 {
     m_objManage      = new clsDomainControlMedStore();
     m_objMedStore    = new clsMedStore_VO();
     m_objOperator    = new clsEmployeeVO();
     m_objStorages    = new clsStorage_VO[0];
     m_objDoAddNewArr = new clsMedStoreMedApplDe_VO[0];
     m_objDoUpdateArr = new clsMedStoreMedApplDe_VO[0];
     m_objDoDeleteArr = new clsMedStoreMedApplDe_VO[0];
 }
        /// <summary>
        /// 获得选定列表行的数据
        /// </summary>
        /// <returns></returns>
        private clsMedStoreMedApplDe_VO m_mthGetSelDetailInfo()
        {
            clsMedStoreMedApplDe_VO objResult = new clsMedStoreMedApplDe_VO();

            if (this.m_objViewer.m_lsvDetail.SelectedItems.Count > 0)
            {
                if (this.m_objViewer.m_lsvDetail.Items[m_SelRow].Tag != null)
                {
                    objResult = (clsMedStoreMedApplDe_VO)this.m_objViewer.m_lsvDetail.Items[m_SelRow].Tag;
                }
            }
            return(objResult);
        }
        /// <summary>
        /// 选定明细列表中的行
        /// </summary>
        public void m_mthSelectDetailList()
        {
            clsMedStoreMedApplDe_VO objItem = new clsMedStoreMedApplDe_VO();

            if (this.m_objViewer.m_lsvDetail.SelectedItems.Count > 0)
            {
                if (this.m_objViewer.m_lsvDetail.SelectedItems[0].Tag != null)
                {
                    this.m_SelRow = this.m_objViewer.m_lsvDetail.SelectedItems[0].Index;
                    objItem       = (clsMedStoreMedApplDe_VO)this.m_objViewer.m_lsvDetail.SelectedItems[0].Tag;
                    m_mthSetInputPanl(objItem);
                }
            }
        }
 /// <summary>
 /// 向明细列表中插入新的数据
 /// </summary>
 /// <param name="objItem"></param>
 private void m_mthInsertDetailList(clsMedStoreMedApplDe_VO objItem)
 {
     if (objItem != null)
     {
         if (m_blnIsInsert)
         {
             int intRowNoCount = m_objViewer.m_lsvDetail.Items.Count;
             m_mthChangeRowNo(this.m_SelRow, intRowNoCount, true);
         }
         System.Windows.Forms.ListViewItem lsvItem = new System.Windows.Forms.ListViewItem(objItem.m_strRowNo);
         lsvItem.SubItems.Add(objItem.m_objMedicine.m_strMedicineID);
         lsvItem.SubItems.Add(objItem.m_objMedicine.m_strMedicineName);
         lsvItem.SubItems.Add(objItem.m_objMedicine.m_strMedSpec);
         lsvItem.SubItems.Add(objItem.m_objUnit.m_strUnitName);
         lsvItem.SubItems.Add(objItem.m_decQty.ToString("######.00"));
         lsvItem.Tag = objItem;
         this.m_objViewer.m_lsvDetail.Items.Add(lsvItem);
     }
 }
        /// <summary>
        /// 自动生成领药申请
        /// </summary>
        public void m_mthAutoCalc()
        {
            long lngRes = 0;

            clsMedStoreMedApplDe_VO[] p_objItems = new clsMedStoreMedApplDe_VO[0];

            lngRes = m_objManage.m_lngAutoCalcMedAppl(m_objMedStore.m_strMedStoreID.Trim(), out p_objItems);

            if (lngRes > 0 && p_objItems.Length > 0)
            {
                for (int i = 0; i < p_objItems.Length; i++)
                {
                    m_mthInsertDetailList(p_objItems[i]);
                    m_mthAddToAddNewArr(p_objItems[i]);
                }
            }
            else
            {
                MessageBox.Show("目前无缺药,或未设置限额管理", "系统提示");
            }
        }
        /// <summary>
        /// 向删队列中增加一条记录
        /// </summary>
        /// <param name="objItem">领药申请明细数据</param>
        private void m_mthAddToDeleteArr(clsMedStoreMedApplDe_VO objItem)
        {
            int intVoLength = 0;
            int intRow;

            clsMedStoreMedApplDe_VO[] objItemTmpArr;            //临时VO

            //获得长度
            intVoLength   = m_objDoDeleteArr.Length;
            objItemTmpArr = new clsMedStoreMedApplDe_VO[intVoLength];

            #region  递到临时变量
            for (intRow = 0; intRow < intVoLength; intRow++)
            {
                objItemTmpArr[intRow] = new clsMedStoreMedApplDe_VO();
                objItemTmpArr[intRow] = m_objDoDeleteArr[intRow];
            }
            #endregion

            ++intVoLength;

            m_objDoDeleteArr = new clsMedStoreMedApplDe_VO[intVoLength];

            #region 将临时VO传递回来
            for (intRow = 0; intRow < intVoLength - 1; intRow++)
            {
                m_objDoDeleteArr[intRow] = new clsMedStoreMedApplDe_VO();
                m_objDoDeleteArr[intRow] = objItemTmpArr[intRow];
            }
            #endregion

            #region 增加新的记录
            m_objDoDeleteArr[intVoLength - 1] = new clsMedStoreMedApplDe_VO();
            m_objDoDeleteArr[intVoLength - 1] = objItem;
            #endregion
        }
 /// <summary>
 /// 设置更改后的列表数据
 /// </summary>
 /// <param name="objItem"></param>
 private void m_mthChangeDetailList(clsMedStoreMedApplDe_VO objItem)
 {
     this.m_objViewer.m_lsvDetail.Items[m_SelRow].SubItems[4].Text = objItem.m_objUnit.m_strUnitName.Trim();
     this.m_objViewer.m_lsvDetail.Items[m_SelRow].SubItems[5].Text = objItem.m_decQty.ToString("######.00");
     this.m_objViewer.m_lsvDetail.Items[m_SelRow].Tag = objItem;
 }