Ejemplo n.º 1
0
        //
        // GET: /Upload/

        public ActionResult Index(int type = 0, int bid = 0)
        {
            //读取该类型下的图片,然后展示出来,同时也显示上传按钮,上传完成后还可以再上传。
            //当然已上传的图片也可以删除。
            string imgsUrl = string.Empty;
            //if(type==0)
            //{
            //    shop item = m_shopBLL.GetById(bid);
            //    imgsUrl = item.home_pic;
            //}
            //if (type == 1)
            //{
            //    activity item = m_activityBLL.GetById(bid);
            //    imgsUrl = item.pic;
            //}
            shop       item;
            activity   activity;
            food_list  food_list;
            youhui     youhui;
            room_price room_price;

            switch (type)
            {
            case 0:
                item    = m_shopBLL.GetById(bid);
                imgsUrl = item.welcome_pic;
                break;

            case 1:
                item    = m_shopBLL.GetById(bid);
                imgsUrl = item.home_pic;
                break;

            case 2:
                activity = m_activityBLL.GetById(bid);
                imgsUrl  = activity.pic;
                break;

            case 3:
                food_list = m_food_listBLL.GetById(bid);
                imgsUrl   = food_list.pic;
                break;

            case 4:
                youhui  = m_youhuiBLL.GetById(bid);
                imgsUrl = youhui.pic;
                break;

            case 5:
                room_price = m_room_priceBLL.GetById(bid);
                imgsUrl    = room_price.pic;
                break;

            default:
                break;
            }



            ViewBag.imgsUrl = imgsUrl;
            ViewBag.type    = type;
            ViewBag.bid     = bid;
            ViewBag.userid  = GetCurrentPerson();

            return(View());
        }