Пример #1
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel      getResult          = null;
            MCodeCom           mCodeCom           = null;
            AdminAcceptListDao adminAcceptListDao = null;

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

            // Get data
            var listSlipStatus  = mCodeCom.GetListCode(Logics.GROUP_SLIP_STATUS, null, true, false);
            var acceptDateStart = DataHelper.GetFirstDayOfMonth();
            var acceptDateEnd   = DataHelper.GetLastDayOfMonth();
            var listAccepts     = adminAcceptListDao.GetListAccepts();

            // Set value
            getResult.ListSlipStatus  = listSlipStatus;
            getResult.AcceptDateStart = acceptDateStart;
            getResult.AcceptDateEnd   = acceptDateEnd;
            getResult.ListAccepts     = listAccepts;

            // Return value
            return(getResult);
        }
Пример #2
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);
        }
Пример #3
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private FilterDataModel GetInfo(FilterDataModel inputObject)
        {
            // Local variable declaration
            FilterDataModel    getResult          = null;
            MCodeCom           mCodeCom           = null;
            AdminAcceptListDao adminAcceptListDao = null;

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

            // Get data
            var listSlipStatus = mCodeCom.GetListCode(Logics.GROUP_SLIP_STATUS, null, true, false);
            var listAccepts    = adminAcceptListDao.GetListAccepts(inputObject);

            // Set value
            getResult.ListSlipStatus = listSlipStatus;
            getResult.ListAccepts    = listAccepts;

            // Return value
            return(getResult);
        }
Пример #4
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++;
            }
        }