Esempio n. 1
0
        /// <summary>
        /// 从界面获取出库信息

        /// </summary>
        /// <param name="p_lngMainSeq"></param>
        /// <returns></returns>
        private clsMS_StorageGrossForOut[] m_objGetOutValue(long[] p_lngMainSeq)
        {
            if (p_lngMainSeq == null || p_lngMainSeq.Length == 0)
            {
                return(null);
            }

            clsMS_StorageGrossForOut[]      objSubArr = null;
            List <clsMS_StorageGrossForOut> lisDetail = new List <clsMS_StorageGrossForOut>();
            long              lngRes      = 0;
            DataTable         dtbDetail   = null;
            clsDcl_OutStorage objDSDomain = new clsDcl_OutStorage();

            for (int iSEQ = 0; iSEQ < p_lngMainSeq.Length; iSEQ++)
            {
                lngRes    = objDSDomain.m_lngGetOutStorageDetail(p_lngMainSeq[iSEQ], out dtbDetail);
                objSubArr = m_objGetDetail(dtbDetail);
                if (objSubArr != null && objSubArr.Length > 0)
                {
                    lisDetail.AddRange(objSubArr);
                }
            }
            objDSDomain = null;

            if (lisDetail.Count > 0)
            {
                objSubArr = lisDetail.ToArray();
            }
            return(objSubArr);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取子表内容
        /// </summary>
        /// <param name="p_lngMainSEQ">主表序列号</param>
        /// <param name="p_dtbValue">子表内容</param>
        internal void m_mthGetOutStorageDetail(long p_lngMainSEQ, out DataTable p_dtbValue)
        {
            clsDcl_OutStorage objOSDomain = new clsDcl_OutStorage();
            long lngRes = objOSDomain.m_lngGetOutStorageDetail(p_lngMainSEQ, out p_dtbValue);

            objOSDomain = null;
        }
Esempio n. 3
0
        /// <summary>
        /// 退审

        /// </summary>
        internal void m_mthUnCommitOutStorage()
        {
            if (!m_objViewer.m_blnIsAdmin)
            {
                MessageBox.Show("当前用户没有药库管理权限,不能退审", "药品出库", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            List <DataRow> lstCheckRow = new List <DataRow>();

            for (int iSe = 0; iSe < m_objViewer.m_dgvMainInfo.Rows.Count; iSe++)
            {
                if (Convert.ToBoolean(m_objViewer.m_dgvMainInfo.Rows[iSe].Cells[0].Value))
                {
                    DataRow drCheck = m_objViewer.m_dtvCurrentMainVienPage1[iSe].Row;
                    if (drCheck["STATUS"].ToString() == "2")
                    {
                        lstCheckRow.Add(drCheck);
                    }
                }
            }

            if (lstCheckRow.Count == 0)
            {
                MessageBox.Show("请先选择需退审的药品出库信息", "药品出库", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            DataRow[] drCommit = lstCheckRow.ToArray();

            if (drCommit == null || drCommit.Length == 0)
            {
                MessageBox.Show("没有符合退审条件的药品出库信息", "药品出库", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            long[] lngMainSEQ = new long[drCommit.Length];
            for (int iRow = 0; iRow < drCommit.Length; iRow++)
            {
                lngMainSEQ[iRow] = Convert.ToInt64(drCommit[iRow]["SERIESID_INT"]);
            }

            clsDcl_OutStorage objOSDomain = new clsDcl_OutStorage();
            //long lngRes = objOSDomain.m_lngUnCommit(lngMainSEQ);

            long lngRes = 0;

            clsMS_StorageGrossForOut[] objSubArr = null;
            //List<clsMS_StorageGrossForOut> lisDetail = new List<clsMS_StorageGrossForOut>();
            DataTable dtbDetail = null;

            for (int iSEQ = 0; iSEQ < lngMainSEQ.Length; iSEQ++)
            {
                lngRes    = objOSDomain.m_lngGetOutStorageDetail(lngMainSEQ[iSEQ], out dtbDetail);
                objSubArr = m_objGetDetail(dtbDetail);
                if (objSubArr != null && objSubArr.Length > 0)
                {
                    lngRes = objOSDomain.m_lngUnCommitOutStorage(objSubArr, lngMainSEQ[iSEQ], drCommit[iSEQ]["OUTSTORAGEID_VCHR"].ToString(), m_objViewer.m_strStorageID);
                    if (lngRes > 0)
                    {
                        m_mthUpdateUIAfterUnCommit(drCommit[iSEQ]);
                    }
                }
            }
            objOSDomain = null;

            if (lngRes > 0)
            {
                //m_mthUpdateUIAfterUnCommit(drCommit);
                if (m_objViewer.m_dgvMainInfo.Rows.Count > 0)
                {
                    m_objViewer.m_dgvMainInfo.Rows[0].Selected = true;
                }
                else
                {
                    if (m_objViewer.m_dtbSubDataPage1 != null)
                    {
                        m_objViewer.m_dtbSubDataPage1.Rows.Clear();
                    }
                }
                System.Windows.Forms.MessageBox.Show("退审完成", "药品出库", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("退审失败", "药品出库", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 审核出库
        /// </summary>
        /// <param name="p_drCommit">审核的行</param>
        internal void m_mthCommitOutStorage()
        {
            if (!m_objViewer.m_blnIsAdmin)
            {
                MessageBox.Show("当前用户没有药库管理权限,不能审核", "药品出库", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            List <DataRow> lstCheck    = new List <DataRow>();
            bool           blnNewState = false;

            for (int iSe = 0; iSe < m_objViewer.m_dgvMainInfo.Rows.Count; iSe++)
            {
                if (Convert.ToBoolean(m_objViewer.m_dgvMainInfo.Rows[iSe].Cells[0].Value))
                {
                    DataRow drCheck = m_objViewer.m_dtvCurrentMainVienPage1[iSe].Row;

                    clsDcl_Purchase_Detail clsDcl = new clsDcl_Purchase_Detail();
                    clsDcl.m_lngCheckBillState(2, drCheck["OUTSTORAGEID_VCHR"].ToString(), out blnNewState);
                    if (!blnNewState)
                    {
                        MessageBox.Show("已选中的出库单,包含不是新制状态的单据,请刷新后重试", "药品出库", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        return;
                    }

                    if (drCheck["STATUS"].ToString() == "1")
                    {
                        lstCheck.Add(drCheck);
                    }
                }
            }

            if (lstCheck.Count == 0)
            {
                MessageBox.Show("请先选择需审核的药品出库信息", "药品出库", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            DataRow[] drNew = lstCheck.ToArray();

            if (drNew == null || drNew.Length == 0)
            {
                MessageBox.Show("没有需审核的药品出库信息", "药品出库", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            string strCurrentOutStorageID = string.Empty;

            try
            {
                long[] lngMainSEQ = new long[drNew.Length];
                for (int iMSeq = 0; iMSeq < drNew.Length; iMSeq++)
                {
                    lngMainSEQ[iMSeq] = Convert.ToInt64(drNew[iMSeq]["SERIESID_INT"]);
                }

                clsMS_StorageGrossForOut[] objSubArr = null;
                //List<clsMS_StorageGrossForOut> lisDetail = new List<clsMS_StorageGrossForOut>();
                long                     lngRes      = 0;
                DataTable                dtbDetail   = null;
                clsDcl_OutStorage        objOSDomain = new clsDcl_OutStorage();
                clsMS_AccountDetail_VO[] objAccount  = null;
                for (int iSEQ = 0; iSEQ < lngMainSEQ.Length; iSEQ++)
                {
                    strCurrentOutStorageID = drNew[iSEQ]["OUTSTORAGEID_VCHR"].ToString();
                    lngRes    = objOSDomain.m_lngGetOutStorageDetail(lngMainSEQ[iSEQ], out dtbDetail);
                    objSubArr = m_objGetDetail(dtbDetail);
                    if (objSubArr != null && objSubArr.Length > 0)
                    {
                        objAccount = m_objAccountDetailArr(dtbDetail, Convert.ToInt32(drNew[iSEQ]["FORMTYPE"]), strCurrentOutStorageID);
                        lngRes     = objOSDomain.m_lngCommitOutStorage(objSubArr, objAccount, m_objViewer.LoginInfo.m_strEmpID, lngMainSEQ[iSEQ], m_objViewer.m_blnIsImmAccount);

                        if (lngRes > 0)
                        {
                            m_mthUpdateUIAfterCommit(drNew[iSEQ]);
                        }
                    }
                }

                //if (lisDetail.Count > 0)
                //{
                //    clsDcl_Storage objSTDomain = new clsDcl_Storage();
                //    lngRes = objSTDomain.m_lngSubStorageDetailRealGross(lisDetail.ToArray());

                //    for (int iList = 0; iList < lisDetail.Count; iList++)
                //    {
                //        lngRes = objSTDomain.m_lngSubStorageGross(lisDetail[iList]);
                //    }

                //    if (lngRes > 0)
                //    {
                //        lngRes = objOSDomain.m_lngSetCommitUser(m_objViewer.LoginInfo.m_strEmpID, lngMainSEQ);
                //    }

                //    if (lngRes > 0)
                //    {
                //        p_drCommit = drNew;
                //    }
                //}
                objOSDomain = null;

                if (lngRes > 0)
                {
                    MessageBox.Show("审核完成", "药品出库", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("审核失败", "药品出库", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
        }