示例#1
0
        /// <summary>
        /// Check processing.
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        private void Check(InitDataModel inputObject)
        {
            // Local variable declaration
            ClientItemDetailsDao clientItemDetailsDao = null;

            // Variable initialize
            clientItemDetailsDao = new ClientItemDetailsDao();

            // Check valid
            if (!clientItemDetailsDao.IsExistItem(inputObject.ItemCd))
            {
                throw new DataNotExistException(string.Format("Sản phẩm ({0})", inputObject.ItemCd));
            }
        }
示例#2
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>ResultModel</returns>
        private void Check(BuyDataModel inputObject)
        {
            // Local variable declaration
            ClientItemDetailsDao clientItemDetailsDao = null;

            // Variable initialize
            clientItemDetailsDao = new ClientItemDetailsDao();

            // Check valid
            if (!clientItemDetailsDao.IsExistItem(inputObject.ItemCd))
            {
                throw new DataNotExistException(string.Format("Sản phẩm ({0})", inputObject.ItemCd));
            }
            if (DataCheckHelper.IsNull(inputObject.ItemQtty))
            {
                throw new ExecuteException("E_MSG_00001", "Số lượng");
            }
            if (inputObject.ItemQtty <= decimal.Zero)
            {
                throw new ExecuteException("E_MSG_00011", "Số lượng");
            }
        }