Exemple #1
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>ResultModel</returns>
        private void Check(UpdateDataModel inputObject)
        {
            // Local variable declaration
            AdminAcceptListDao adminAcceptListDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminAcceptListDao = new AdminAcceptListDao();
            mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_ACCEPTS))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            int i = 0;
            foreach (var obj in inputObject.ListAccepts)
            {
                if (DataCheckHelper.IsNull(obj.SlipStatus))
                    throw new ExecuteException("E_MSG_00004", string.Format("Trạng thái ({0})", i + 1));
                if(!mCodeCom.IsExist(Logics.GROUP_SLIP_STATUS, obj.SlipStatus, false))
                    throw new DataNotExistException(string.Format("Trạng thái ({0})", i + 1));
                if (!adminAcceptListDao.IsExistAccept(obj.AcceptSlipNo))
                    throw new DataNotExistException(string.Format("Hóa đơn ({0})", i + 1));

                i++;
            }
        }
Exemple #2
0
        /// <summary>
        /// Execute convert output.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private UpdateResponseModel Convert(UpdateDataModel resultObject)
        {
            // Local variable declaration
            UpdateResponseModel responseModel = null;

            // Variable initialize
            responseModel = new UpdateResponseModel();

            // Add message
            responseModel.AddMessage(MessageHelper.GetMessageInfo("I_MSG_00001"));

            // Return value
            return responseModel;
        }
Exemple #3
0
        /// <summary>
        /// Execute convert input.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>DataModel</returns>
        private UpdateDataModel Convert(UpdateRequestModel request)
        {
            // Local variable declaration
            UpdateDataModel inputObject = null;

            // Variable initialize
            inputObject = new UpdateDataModel();

            // Convert data input
            DataHelper.ConvertInput(request, inputObject);

            // Return value
            return inputObject;
        }
Exemple #4
0
        /// <summary>
        /// Update item to cart
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private UpdateDataModel UpdateInfo(UpdateDataModel inputObject)
        {
            // Local variable declaration
            UpdateDataModel getResult = null;
            AdminAcceptListDao adminAcceptListDao = null;

            // Variable initialize
            getResult = new UpdateDataModel();
            adminAcceptListDao = new AdminAcceptListDao();

            // Update data
            foreach (var obj in inputObject.ListAccepts)
            {
                adminAcceptListDao.UpdateAccept(obj);
            }
            // Submit data
            adminAcceptListDao.SubmitChanges();

            // Return value
            return getResult;
        }