Example #1
0
        public static OperateCardDataSlide Transfer(Activity activity, Enterprise enterprises)
        {
            if (activity == null)
            {
                return(null);
            }

            OperateCardDataSlide operateCardDataSlide = new OperateCardDataSlide();

            operateCardDataSlide.DataType    = DataTypeEnum.Activity;
            operateCardDataSlide.Cover       = activity.Image;
            operateCardDataSlide.Description = activity.Description;
            operateCardDataSlide.Id          = activity.Id;
            operateCardDataSlide.Title       = activity.Name;


            if (enterprises != null)
            {
                var envcards = enterprises.EnvCards;
                List <ExtraCardData> extraCardDatas = new List <ExtraCardData>();
                for (int i = 0; i < envcards.Count; i++)
                {
                    ExtraCardData extraCardData = new ExtraCardData();
                    extraCardData.Cover = envcards[i];
                    extraCardDatas.Add(extraCardData);
                }
                operateCardDataSlide.ExtraCardData = extraCardDatas;
            }

            var details = activity.ActivityDetails;

            if (details != null && details.Count > 0)
            {
                List <ScrollData> scrollDatas = new List <ScrollData>();

                for (int i = 0; i < details.Count; i++)
                {
                    ScrollData scrollData = new ScrollData();
                    scrollData.Cover       = details[i].Image;
                    scrollData.Type        = details[i].Type;
                    scrollData.Description = details[i].Description;
                    scrollData.Src         = details[i].VideoUrl;
                    scrollDatas.Add(scrollData);
                }
                operateCardDataSlide.ScrollData = scrollDatas;
            }

            return(operateCardDataSlide);
        }
Example #2
0
        public Enterprise GetEnterpriseById(int id)
        {
            Enterprise enterprise = new Enterprise();

            // 公司卡片初始化
            List <string> list = new List <string>();

            list.Add("feiyue2\\企业名片1.jpg");
            list.Add("feiyue2\\企业名片2.jpg");
            list.Add("feiyue2\\企业名片3.jpg");

            enterprise.EnvCards = list;

            return(enterprise);
        }
Example #3
0
        public Enterprise GetEnterpriseById(int id)
        {
            Enterprise enterprise = new Enterprise();

            // 公司卡片初始化
            //List<string> list = new List<string>();

            //list.Add("shicun\\互动魔墙里的酒图片\\企业名片1.jpg");
            //list.Add("shicun\\互动魔墙里的酒图片\\企业名片2.jpg");
            //list.Add("shicun\\互动魔墙里的酒图片\\企业名片3.jpg");

            //enterprise.EnvCards = list;



            return(null);
        }
Example #4
0
        public EnterpriseDetail Generator()
        {
            EnterpriseDetail enterpriseDetail = new EnterpriseDetail();

            Enterprise enterprise = new Enterprise();

            enterpriseDetail.Enterprise = enterprise.Generator();

            Product        product   = new Product();
            List <Product> _products = new List <Product>();

            _products.Add(product.Generator());
            _products.Add(product.Generator());
            _products.Add(product.Generator());
            _products.Add(product.Generator());
            enterpriseDetail._products = _products;


            Catalog        catalog   = new Catalog();
            List <Catalog> _catalogs = new List <Catalog>();

            _catalogs.Add(catalog.Generator());
            _catalogs.Add(catalog.Generator());
            _catalogs.Add(catalog.Generator());
            _catalogs.Add(catalog.Generator());
            enterpriseDetail._catalogs = _catalogs;

            Activity        activity    = new Activity();
            List <Activity> _activities = new List <Activity>();

            _activities.Add(activity.Generator());
            _activities.Add(activity.Generator());
            _activities.Add(activity.Generator());
            _activities.Add(activity.Generator());
            enterpriseDetail._activities = _activities;

            Video        video   = new Video();
            List <Video> _videos = new List <Video>();

            _videos.Add(video.Generator());
            //_videos.Add(video.Generator());
            enterpriseDetail._videos = _videos;

            return(enterpriseDetail);
        }
Example #5
0
        //
        //  获取首页企业
        //
        public Enterprise GetEnterprise()
        {
            List <Enterprise> enterprises = GetEnterprises();

            Enterprise r = enterprises[_enterpriseIndex];

            int number = _enterpriseIndex + 1;

            if (number == _enterprises.Count)
            {
                _enterpriseIndex = 0;
            }
            else
            {
                _enterpriseIndex = number;
            }

            return(r);
        }
Example #6
0
        //
        //  初始化数据
        //
        public void InitSingleCardAgent(Enterprise data)
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();

            InitAgency();
            _questionTypeEnum = QuestionTypeEnum.SingleCard;

            //  设置标题
            _title.text = data.Name;

            // 设置封面
            _cover.sprite = SpriteResource.Instance.GetData(MagicWallManager.FileDir + data.Logo);
            CanvasExtensions.SizeToParent(_cover);

            // 处理businesscard
            InitComponents(null);

            // 设置完成回调
            SetOnCreatedCompleted(OnCreatedCompleted);

            isPrepared = true;
        }
Example #7
0
        public Enterprise GetEnterpriseById(int id)
        {
            Enterprise enterprise = new Enterprise();

            string sql = "select * from company where com_id=" + id + " and status = 1";

            var row = _theDataSource.SelectOne(sql);

            enterprise.Ent_id = Convert.ToInt16(row["com_id"]);
            enterprise.Name   = row["name"].ToString();
            bool isCustom = false;

            enterprise.IsCustom = isCustom;
            enterprise.Logo     = row["logo"].ToString();

            //enterprise.Description = row["description"].ToString();
            enterprise.Description   = row["description"].ToString();
            enterprise.Business_card = row["image_namecard"].ToString();
            enterprise.EnvCards      = GetEnvCards(enterprise.Ent_id);

            return(enterprise);
        }
Example #8
0
        private void AddBusinessCard(string name, Enterprise enterprise)
        {
            string catalogDirPath = "HK\\fengxian\\" + name + "\\企业名片";

            if (Directory.Exists(MagicWallManager.FileDir + catalogDirPath))
            {
                DirectoryInfo dirInfo = new DirectoryInfo(MagicWallManager.FileDir + catalogDirPath);
                FileInfo[]    files   = dirInfo.GetFiles();

                List <string> bcards             = new List <string>();
                string        busincessCarcdPath = "";


                for (int i = 0; i < files.Length; i++)
                {
                    var fileName           = files[i].Name;
                    var fileNameWithoutExt = fileName.Replace(files[i].Extension, "");
                    busincessCarcdPath = catalogDirPath + "\\" + fileName;
                }

                enterprise.Business_card = busincessCarcdPath;
            }
        }
        public static CardAgent Generate(MagicWallManager magicWallManager, Vector3 position
                                         , Transform parent, int dataId, DataTypeEnum dataType, FlockAgent refFlockAgent)
        {
            IDaoService daoService = magicWallManager.daoServiceFactory.GetDaoService(refFlockAgent.daoTypeEnum);

            OperateCardData cardData   = null;
            CardAgent       cardPrefab = null;

            //magicWallManager.daoService.getac
            if (dataType == DataTypeEnum.Enterprise)
            {
                Enterprise enterprise = daoService.GetEnterpriseById(dataId);

                Debug.Log("enterprise : " + (enterprise == null));

                var activities = daoService.GetActivitiesByEnvId(enterprise.Ent_id);
                var products   = daoService.GetProductsByEnvId(enterprise.Ent_id);
                var videos     = daoService.GetVideosByEnvId(enterprise.Ent_id);
                var catalogs   = daoService.GetCatalogs(enterprise.Ent_id);
                OperateCardDataCross operateCardDataCross = EnterpriseAdapter
                                                            .Transfer(enterprise, activities, products, videos, catalogs);
                //Debug.Log(operateCardDataCross.ToString());

                //if (CheckIsSimple(operateCardDataCross))
                //{
                //    cardPrefab = magicWallManager.operateCardManager.singleCardPrefab;
                //    cardData = operateCardDataCross;

                //    Debug.Log("Generate 单个企业卡片");
                //}
                //else
                //{
                cardPrefab = magicWallManager.operateCardManager.crossCardPrefab;
                // 单个卡片的逻辑
                //OperateCardDataSingle operateCardDataSingle = new OperateCardDataSingle();

                // Debug.Log("Generate 正常企业卡片");
                cardData = operateCardDataCross;

                //cardData = (OperateCardDataSingle)operateCardDataCross;
                //}
            }
            else if (dataType == DataTypeEnum.Product || dataType == DataTypeEnum.Wine)
            {
                Product    product    = daoService.GetProductDetail(dataId);
                Enterprise enterprise = daoService.GetEnterpriseById(product.Ent_id);

                Debug.Log("enterprise : " + enterprise);

                //Debug.Log("enterprise to null : " + (enterprise == null));


                OperateCardDataSlide operateCardDataSlide = ProductAdapter.Transfer(product, enterprise);
                cardPrefab = magicWallManager.operateCardManager.sliceCardPrefab;
                cardData   = operateCardDataSlide;
            }
            else
            {
                Activity             activity             = daoService.GetActivityDetail(dataId);
                Enterprise           enterprise           = daoService.GetEnterpriseById(activity.Ent_id);
                OperateCardDataSlide operateCardDataSlide = ActivityAdapter.Transfer(activity, enterprise);
                cardPrefab = magicWallManager.operateCardManager.sliceCardPrefab;
                cardData   = operateCardDataSlide;
            }

            // 创建card
            CardAgent cardAgent = Instantiate(cardPrefab, parent);

            cardAgent.GetComponent <Transform>().position = position;
            //cardAgent.DataId = dataId;
            cardAgent.InitComponent(magicWallManager, dataId, dataType, position, refFlockAgent);
            cardAgent.InitData(cardData);
            return(cardAgent);
        }
Example #10
0
        public static OperateCardDataCross Transfer(Enterprise enterprise, List <Activity> activities,
                                                    List <Product> products, List <Video> videos, List <Catalog> catalogs)
        {
            if (enterprise == null)
            {
                return(null);
            }

            OperateCardDataCross operateCardDataCross = new OperateCardDataCross();

            operateCardDataCross.Id          = enterprise.Ent_id;
            operateCardDataCross.Title       = enterprise.Name;
            operateCardDataCross.Cover       = enterprise.Business_card;
            operateCardDataCross.DataType    = DataTypeEnum.Enterprise;
            operateCardDataCross.Description = enterprise.Description;

            // index;
            Dictionary <CrossCardNavType, List <ScrollData> > dics = new Dictionary <CrossCardNavType, List <ScrollData> > ();

            List <ScrollData> list       = new List <ScrollData>();
            ScrollData        scrollData = new ScrollData();

            scrollData.Cover = enterprise.Business_card;
            scrollData.Type  = 0;
            list.Add(scrollData);
            dics.Add(CrossCardNavType.Index, list);

            // category
            if (catalogs != null && catalogs.Count > 0)
            {
                List <ScrollData> categoryList = new List <ScrollData>();
                for (int i = 0; i < catalogs.Count; i++)
                {
                    var        cat = catalogs[i];
                    ScrollData sd  = new ScrollData();
                    sd.Type        = 0;
                    sd.Cover       = cat.Img;
                    sd.Description = cat.Description;
                    categoryList.Add(sd);
                }
                dics.Add(CrossCardNavType.CataLog, categoryList);
            }

            // product
            if (products != null && products.Count > 0)
            {
                List <ScrollData> l = new List <ScrollData>();
                for (int i = 0; i < products.Count; i++)
                {
                    var        prod = products[i];
                    ScrollData sd   = new ScrollData();
                    sd.Type        = 0;
                    sd.Cover       = prod.Image;
                    sd.Description = prod.Description;
                    l.Add(sd);
                }
                dics.Add(CrossCardNavType.Product, l);
            }

            // activity
            if (activities != null && activities.Count > 0)
            {
                List <ScrollData> l = new List <ScrollData>();
                for (int i = 0; i < activities.Count; i++)
                {
                    var        data = activities[i];
                    ScrollData sd   = new ScrollData();
                    sd.Type        = 0;
                    sd.Cover       = data.Image;
                    sd.Description = data.Description;
                    l.Add(sd);
                }
                dics.Add(CrossCardNavType.Activity, l);
            }

            // video
            if (videos != null && videos.Count > 0)
            {
                List <ScrollData> l = new List <ScrollData>();
                for (int i = 0; i < videos.Count; i++)
                {
                    var        data = videos[i];
                    ScrollData sd   = new ScrollData();
                    sd.Type        = 1;
                    sd.Cover       = data.Cover;
                    sd.Src         = data.Address;
                    sd.Description = data.Description;
                    l.Add(sd);
                }
                dics.Add(CrossCardNavType.Video, l);
            }

            operateCardDataCross.ScrollDic = dics;


            return(operateCardDataCross);
        }
        public Enterprise GetEnterpriseById(int id)
        {
            Enterprise enterprise = new Enterprise();

            return(null);
        }