Пример #1
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();
        }
Пример #2
0
 partial void DeleteBanner(Banner instance);
Пример #3
0
 partial void UpdateBanner(Banner instance);
Пример #4
0
 partial void InsertBanner(Banner instance);
Пример #5
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel getResult = null;
            AdminBannerEntryDao adminBannerEntryDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            getResult = new InitDataModel();
            adminBannerEntryDao = new AdminBannerEntryDao();
            mCodeCom = new MCodeCom();

            // Get data
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, false, false);
            var listOfferGroup = adminBannerEntryDao.GetListOfferGroup();
            var banner = new Banner();
            if (!IsAdd) banner = adminBannerEntryDao.GetSingleBanner(inputObject.BannerCd);
            else banner.FileId = DataHelper.GetUniqueKey();

            // Set value
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.ListOfferGroup = listOfferGroup;
            getResult.Banner = banner;

            // Return value
            return getResult;
        }