Пример #1
0
        /// <summary>
        /// 获取原始库存VO
        /// </summary>
        /// <param name="p_drDataArr">数据行</param>
        /// <returns></returns>
        private clsDS_Initial_VO[] m_objGetInitialVO(DataRow[] p_drDataArr)
        {
            if (p_drDataArr == null || p_drDataArr.Length == 0)
            {
                return(null);
            }

            clsDS_Initial_VO[]      objInitialVO = null;
            List <clsDS_Initial_VO> lstInitialVO = new List <clsDS_Initial_VO>();

            try
            {
                int intRowsCount = p_drDataArr.Length;

                clsDS_Initial_VO objTemp = null;
                for (int iRow = 0; iRow < intRowsCount; iRow++)
                {
                    if (m_blnCheckIsNullRow(p_drDataArr[iRow]))
                    {
                        continue;
                    }

                    objTemp = m_objGetInitialVO(p_drDataArr[iRow]);
                    lstInitialVO.Add(objTemp);
                }
                objInitialVO = lstInitialVO.ToArray();
            }
            catch (Exception Ex)
            {
                return(null);
            }
            return(objInitialVO);
        }
Пример #2
0
        /// <summary>
        /// 获取原始库存VO
        /// </summary>
        /// <param name="p_dtbDataArr">数据表</param>
        /// <returns></returns>
        private clsDS_Initial_VO[] m_objGetInitialVO(DataTable p_dtbDataArr)
        {
            if (p_dtbDataArr == null || p_dtbDataArr.Rows.Count == 0)
            {
                return(null);
            }
            clsDS_Initial_VO[]      objInitialVO = null;
            List <clsDS_Initial_VO> lstInitialVO = new List <clsDS_Initial_VO>();

            try
            {
                int intRowsCount         = p_dtbDataArr.Rows.Count;
                clsDS_Initial_VO objTemp = null;
                for (int iRow = 0; iRow < intRowsCount; iRow++)
                {
                    objTemp = m_objGetInitialVO(p_dtbDataArr.Rows[iRow]);
                    lstInitialVO.Add(objTemp);
                }
                objInitialVO = lstInitialVO.ToArray();
            }
            catch (Exception Ex)
            {
                return(null);
            }
            return(objInitialVO);
        }
Пример #3
0
        /// <summary>
        /// 获取原始库存VO
        /// </summary>
        /// <param name="p_drData">数据行</param>
        /// <returns></returns>
        private clsDS_Initial_VO m_objGetInitialVO(DataRow p_drData)
        {
            if (p_drData == null)
            {
                return(null);
            }

            double           dblTemp    = 0d;//用作类型转换的临时变量
            clsDS_Initial_VO objInitial = new clsDS_Initial_VO();

            if (double.TryParse(p_drData["IPAMOUNT"].ToString(), out dblTemp))
            {
                objInitial.m_dblIPAMOUNT = Math.Round(dblTemp, 2, MidpointRounding.AwayFromZero);
            }
            else
            {
                objInitial.m_dblIPAMOUNT = 0;
            }
            if (double.TryParse(p_drData["IPRETAILPRICE_INT"].ToString(), out dblTemp))
            {
                objInitial.m_dblIPRETAILPRICE_INT = Math.Round(dblTemp, 4, MidpointRounding.AwayFromZero);
            }
            else
            {
                objInitial.m_dblIPRETAILPRICE_INT = 0;
            }
            if (double.TryParse(p_drData["IPWHOLESALEPRICE_INT"].ToString(), out dblTemp))
            {
                objInitial.m_dblIPWHOLESALEPRICE_INT = Math.Round(dblTemp, 4, MidpointRounding.AwayFromZero);
            }
            else
            {
                objInitial.m_dblIPWHOLESALEPRICE_INT = 0;
            }
            if (double.TryParse(p_drData["OPAMOUNT"].ToString(), out dblTemp))
            {
                objInitial.m_dblOPAMOUNT = Math.Round(dblTemp, 2, MidpointRounding.AwayFromZero);
            }
            else
            {
                objInitial.m_dblOPAMOUNT = 0;
            }
            if (double.TryParse(p_drData["OPRETAILPRICE_INT"].ToString(), out dblTemp))
            {
                objInitial.m_dblOPRETAILPRICE_INT = Math.Round(dblTemp, 4, MidpointRounding.AwayFromZero);
            }
            else
            {
                objInitial.m_dblOPRETAILPRICE_INT = 0;
            }
            if (double.TryParse(p_drData["OPWHOLESALEPRICE_INT"].ToString(), out dblTemp))
            {
                objInitial.m_dblOPWHOLESALEPRICE_INT = Math.Round(dblTemp, 4, MidpointRounding.AwayFromZero);
            }
            else
            {
                objInitial.m_dblOPWHOLESALEPRICE_INT = 0;
            }
            if (double.TryParse(p_drData["PACKQTY_DEC"].ToString(), out dblTemp))
            {
                objInitial.m_dblPACKQTY_DEC = dblTemp;
            }
            else
            {
                objInitial.m_dblPACKQTY_DEC = 0;
            }
            DateTime dtmTemp = DateTime.MinValue;

            if (DateTime.TryParse(p_drData["VALIDPERIOD_DAT"].ToString(), out dtmTemp))
            {
                objInitial.m_dtmVALIDPERIOD_DAT = dtmTemp;
            }
            else
            {
                objInitial.m_dtmVALIDPERIOD_DAT = DateTime.MinValue;
            }

            long lngTemp = 0;

            if (long.TryParse(p_drData["SERIESID_INT"].ToString(), out lngTemp))
            {
                objInitial.m_lngSERIESID_INT = lngTemp;
            }
            else
            {
                objInitial.m_lngSERIESID_INT = 0;
            }
            objInitial.m_strCREATERID         = p_drData["CREATERID"].ToString();
            objInitial.m_strDRUGSTOREID_CHR   = m_objViewer.m_strDeptID;
            objInitial.m_strEXAMERID          = p_drData["examerid"].ToString();
            objInitial.m_strINACCOUNTERID_CHR = p_drData["INACCOUNTERID_CHR"].ToString();
            objInitial.m_strINITIALID_CHR     = p_drData["INITIALID_CHR"].ToString();
            objInitial.m_strIPUNIT_CHR        = p_drData["IPUNIT_CHR"].ToString();
            objInitial.m_strLOTNO_VCHR        = p_drData["LOTNO_VCHR"].ToString();
            objInitial.m_strMEDICINEID_CHR    = p_drData["MEDICINEID_CHR"].ToString();
            objInitial.m_strMEDICINENAME_VCH  = p_drData["MEDICINENAME_VCHR"].ToString();
            objInitial.m_strMEDSPEC_VCHR      = p_drData["MEDSPEC_VCHR"].ToString();
            objInitial.m_strOPUNIT_CHR        = p_drData["OPUNIT_CHR"].ToString();
            objInitial.m_strPRODUCTORID_CHR   = p_drData["productorid_chr"].ToString();
            return(objInitial);
        }