Exemplo n.º 1
0
        /// <summary>
        /// Execute convert input.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>DataModel</returns>
        private SaveDataModel Convert(SaveRequestModel request)
        {
            // Local variable declaration
            SaveDataModel inputObject = null;

            // Variable initialize
            inputObject = new SaveDataModel();

            // Convert data input
            DataHelper.ConvertInput(request, inputObject);
            _status = DataHelper.ConvertInputString(request.Status);

            // Return value
            return inputObject;
        }
Exemplo n.º 2
0
        public void UpdateBanner(SaveDataModel inputObject)
        {
            // Get sysdate
            var currentDate = DateTime.Now;

            // Set item
            var entity = GetSingle<Banner>(inputObject.BannerCd, true);
            entity.BannerName = inputObject.BannerName;
            entity.OfferGroupCd = inputObject.OfferGroupCd;
            entity.SortKey = inputObject.SortKey;
            entity.UpdateUser = PageHelper.UserName;
            entity.UpdateDate = currentDate;
            entity.DeleteFlag = inputObject.DeleteFlag;

            // Submit
            EntityManager.SubmitChanges();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(SaveDataModel inputObject)
        {
            // Local variable declaration
            AdminBannerEntryDao adminBannerEntryDao = null;

            // Variable initialize
            adminBannerEntryDao = new AdminBannerEntryDao();

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

            // Check valid
            if (IsAdd && adminBannerEntryDao.IsExistBanner(inputObject.BannerCd))
                throw new DataExistException("Banner");
            if (IsEdit && !adminBannerEntryDao.IsExistBanner(inputObject.BannerCd))
                throw new DataNotExistException("Banner");
        }
Exemplo n.º 4
0
        public void InsertBanner(SaveDataModel inputObject)
        {
            // Get sysdate
            var currentDate = DateTime.Now;

            // Set item
            var entity = new Banner();
            entity.BannerCd = inputObject.BannerCd;
            entity.BannerName = inputObject.BannerName;
            entity.FileId = inputObject.FileId;
            entity.OfferGroupCd = inputObject.OfferGroupCd;
            entity.Notes = string.Empty;
            entity.SortKey = inputObject.SortKey;
            entity.CreateUser = PageHelper.UserName;
            entity.CreateDate = currentDate;
            entity.UpdateUser = PageHelper.UserName;
            entity.UpdateDate = currentDate;
            entity.DeleteFlag = inputObject.DeleteFlag;
            EntityManager.Banners.InsertOnSubmit(entity);

            // Submit
            EntityManager.SubmitChanges();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private SaveResponseModel Convert(SaveDataModel resultObject)
        {
            // Local variable declaration
            SaveResponseModel response = null;

            // Variable initialize
            response = new SaveResponseModel();

            // Set value
            response.AddMessage(MessageHelper.GetMessageInfo("I_MSG_00001"));

            // Return value
            return response;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Save infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private SaveDataModel SaveInfo(SaveDataModel inputObject)
        {
            // Local variable declaration
            SaveDataModel saveResult = null;
            AdminBannerEntryDao adminBannerEntryDao = null;
            StorageFileCom storageFileCom = null;

            // Variable initialize
            saveResult = new SaveDataModel();
            adminBannerEntryDao = new AdminBannerEntryDao();
            storageFileCom = new StorageFileCom();

            if (IsAdd) adminBannerEntryDao.InsertBanner(inputObject); // Insert
            else adminBannerEntryDao.UpdateBanner(inputObject); // Update

            // Update StorageFile
            foreach (var storageFile in storageFileCom.GetListActive(inputObject.FileId, false))
            {
                storageFile.ActiveFlag = true;
                storageFileCom.UpdateActiveFlag(storageFile, false);
            }
            storageFileCom.SubmitChanges();

            return saveResult;
        }