Example #1
0
        /// <summary>
        /// 列表获取
        /// </summary>
        public IList <ZCourseReflectionsEntity> GetList(ZCourseReflectionsEntity entity, int Page, int PageSize)
        {
            var objectImagesBLL = new ObjectImagesBLL(CurrentUserInfo);

            if (PageSize <= 0)
            {
                PageSize = 15;
            }

            IList <ZCourseReflectionsEntity> eventsList = new List <ZCourseReflectionsEntity>();
            DataSet ds = new DataSet();

            ds = _currentDAO.GetList(entity, Page, PageSize);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                eventsList = DataTableToObject.ConvertToList <ZCourseReflectionsEntity>(ds.Tables[0]);

                foreach (var item in eventsList)
                {
                    item.ImageList = objectImagesBLL.QueryByEntity(new ObjectImagesEntity()
                    {
                        ObjectId = item.ReflectionsId
                    }, null).ToList();
                    if (item.ImageList.Count > 0)
                    {
                        item.ImageURL = item.ImageList[0].ImageURL;
                    }
                }
            }
            return(eventsList);
        }
Example #2
0
        /// <summary>
        /// 列表获取
        /// </summary>
        public IList <MVipShowEntity> GetList(MVipShowEntity entity, int Page, int PageSize)
        {
            var lNewsBLL        = new LNewsBLL(CurrentUserInfo);
            var objectImagesBLL = new ObjectImagesBLL(CurrentUserInfo);
            var itemService     = new ItemService(CurrentUserInfo);

            if (PageSize <= 0)
            {
                PageSize = 15;
            }

            IList <MVipShowEntity> eventsList = new List <MVipShowEntity>();
            DataSet ds = new DataSet();

            ds = _currentDAO.GetList(entity, Page, PageSize);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                eventsList = DataTableToObject.ConvertToList <MVipShowEntity>(ds.Tables[0]);

                if (eventsList != null)
                {
                    foreach (var item in eventsList)
                    {
                        item.ImageList = objectImagesBLL.QueryByEntity(new ObjectImagesEntity()
                        {
                            ObjectId = item.VipShowId
                        }, new OrderBy[] { new  OrderBy {
                                               FieldName = "CreateTime", Direction = OrderByDirections.Desc
                                           } });
                    }
                }
            }
            return(eventsList);
        }
Example #3
0
        /// <summary>
        /// 获取单个商品类别信息
        /// </summary>
        /// <param name="Item_Category_Id"></param>
        /// <returns></returns>
        public ItemCategoryInfo GetItemCategoryById(string Item_Category_Id)
        {
            try
            {
                DataSet ds = new DataSet();
                ds = itemCategoryService.GetItemCategoryById(Item_Category_Id);
                ItemCategoryInfo itemCategoryInfo = new ItemCategoryInfo();
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    itemCategoryInfo = DataTableToObject.ConvertToObject <ItemCategoryInfo>(ds.Tables[0].Rows[0]);

                    var objectImagesBLL = new ObjectImagesBLL(loggingSessionInfo);


                    var tmpImageList = objectImagesBLL.QueryByEntity(new ObjectImagesEntity()
                    {
                        ObjectId = Item_Category_Id
                    }, null);
                    if (tmpImageList != null && tmpImageList.Length > 0)
                    {
                        itemCategoryInfo.ImageUrl = tmpImageList[0].ImageURL;
                    }
                }

                return(itemCategoryInfo);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
        /// <summary>
        /// 获取门店详情
        /// </summary>
        /// <param name="StoreId"></param>
        /// <returns></returns>
        public StoreBrandMappingEntity GetStoreDetail(string StoreId)
        {
            StoreBrandMappingEntity info = new StoreBrandMappingEntity();
            DataSet ds = new DataSet();

            ds = _currentDAO.GetStoreDetail(StoreId);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                info = DataTableToObject.ConvertToObject <JIT.CPOS.BS.Entity.StoreBrandMappingEntity>(ds.Tables[0].Rows[0]);
            }
            ObjectImagesBLL imageServer = new ObjectImagesBLL(this.CurrentUserInfo);

            info.ImageList = imageServer.QueryByEntity(new ObjectImagesEntity()
            {
                ObjectId = StoreId
            }, null);

            return(info);
        }
Example #5
0
        /// <summary>
        /// 列表获取
        /// </summary>
        public IList <ZCourseEntity> GetCourses(ZCourseEntity entity, int Page, int PageSize)
        {
            var zCourseReflectionsBLL = new ZCourseReflectionsBLL(CurrentUserInfo);
            var zCourseNewsMappingBLL = new ZCourseNewsMappingBLL(CurrentUserInfo);
            var lNewsBLL        = new LNewsBLL(CurrentUserInfo);
            var objectImagesBLL = new ObjectImagesBLL(CurrentUserInfo);

            if (PageSize <= 0)
            {
                PageSize = 15;
            }

            IList <ZCourseEntity> eventsList = new List <ZCourseEntity>();
            DataSet ds = new DataSet();

            ds = _currentDAO.GetCourses(entity, Page, PageSize);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                eventsList = DataTableToObject.ConvertToList <ZCourseEntity>(ds.Tables[0]);

                if (eventsList != null)
                {
                    foreach (var item in eventsList)
                    {
                        item.CourseReflectionsList = zCourseReflectionsBLL.GetList(new ZCourseReflectionsEntity()
                        {
                            CourseId = item.CourseId
                        }, 0, 10000);
                        var mapList = zCourseNewsMappingBLL.QueryByEntity(new ZCourseNewsMappingEntity()
                        {
                            CourseId = item.CourseId
                        }, null);
                        if (mapList != null)
                        {
                            item.NewsList = new List <LNewsEntity>();
                            foreach (var mapItem in mapList)
                            {
                                var newsObj = lNewsBLL.GetByID(mapItem.NewsId);
                                if (newsObj == null)
                                {
                                    continue;
                                }
                                item.NewsList.Add(new LNewsEntity()
                                {
                                    NewsId       = newsObj.NewsId,
                                    NewsTitle    = newsObj.NewsTitle,
                                    PublishTime  = newsObj.PublishTime,
                                    displayIndex = newsObj.displayIndex,
                                });
                            }
                        }
                        item.ImageList = objectImagesBLL.QueryByEntity(new ObjectImagesEntity()
                        {
                            ObjectId = item.CourseId
                        }, null).ToList();
                        if (item.ImageList.Count > 0)
                        {
                            item.ImageUrl = item.ImageList[0].ImageURL;
                        }
                    }
                }
            }
            return(eventsList);
        }
Example #6
0
        /// <summary>
        /// 保存商品类别(新建或者修改)
        /// </summary>
        /// <param name="loggingSessionInfo"></param>
        /// <param name="itemCategoryInfo"></param>
        /// <returns></returns>
        public string SetItemCategoryInfo(LoggingSessionInfo loggingSessionInfo, ItemCategoryInfo itemCategoryInfo)
        {
            string strResult = string.Empty;

            //事物信息
            //cSqlMapper.Instance().BeginTransaction();

            try
            {
                //处理是新建还是修改
                if (itemCategoryInfo.Item_Category_Id == null || itemCategoryInfo.Item_Category_Id.Equals(""))
                {
                    //如果是新建,并且没有传值给DisplayIndex,就取他所在子类里最大的displayindex+1
                    if (itemCategoryInfo.DisplayIndex == null || itemCategoryInfo.DisplayIndex == 0)
                    {
                        int displayindex = 0;
                        //获取他的父类下的子分类的
                        IList <ItemCategoryInfo> list = GetItemCategoryListByParentId(itemCategoryInfo.Parent_Id).OrderByDescending(p => p.DisplayIndex).ToList();
                        if (list != null && list.Count() != 0)
                        {
                            int oldDisplayIndex = list[0].DisplayIndex == null?0: (int)list[0].DisplayIndex;
                            displayindex = oldDisplayIndex + 1;
                        }
                        itemCategoryInfo.DisplayIndex = displayindex;
                    }

                    itemCategoryInfo.Item_Category_Id = NewGuid();
                    //2.提交用户信息
                    if (!SetItemCategoryTableInfo(loggingSessionInfo, itemCategoryInfo))
                    {
                        strResult = "提交用户表失败";
                        return(strResult);
                    }
                }
                else
                {
                    CPOS.BS.DataAccess.ItemCategoryService server = new DataAccess.ItemCategoryService(loggingSessionInfo);
                    strResult = server.SetItemCategoryInfoUpdate(itemCategoryInfo).ToString();
                }
                var objectImagesBLL = new ObjectImagesBLL(loggingSessionInfo);
                var tmpImageList    = objectImagesBLL.QueryByEntity(new ObjectImagesEntity()
                {
                    ObjectId = itemCategoryInfo.Item_Category_Id
                }, null);
                if (tmpImageList != null && tmpImageList.Length > 0)
                {
                    foreach (var tmpImageItem in tmpImageList)
                    {
                        objectImagesBLL.Delete(tmpImageItem);
                    }
                }
                if (itemCategoryInfo.ImageUrl != null && itemCategoryInfo.ImageUrl.Length > 0)
                {
                    objectImagesBLL.Create(new ObjectImagesEntity()
                    {
                        ImageId  = NewGuid(),
                        ObjectId = itemCategoryInfo.Item_Category_Id,
                        ImageURL = itemCategoryInfo.ImageUrl
                    });
                }

                strResult = "保存成功!";
                return(strResult);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            //return "";
        }