Exemplo n.º 1
0
        public List <ActivityDetail> GetActivityDetails(int act_id)
        {
            List <ActivityDetail> activityDetails = new List <ActivityDetail>();
            string sql = "select * from activity where act_id='" + act_id + "'" + " and status = 1";

            var    row      = _theDataSource.SelectOne(sql);
            string material = row["material"].ToString();

            List <MWMaterial> mWMaterials = (List <MWMaterial>)DaoUtil.ConvertMaterialJson(material);

            for (int i = 0; i < mWMaterials.Count; i++)
            {
                MWMaterial data = mWMaterials[i];
                //Debug.Log(data[i]["cuteffect_id"]);
                ActivityDetail activityDetail = new ActivityDetail();
                if (data.type == "video")
                {
                    activityDetail.Type     = 1;
                    activityDetail.Image    = data.cover;
                    activityDetail.VideoUrl = data.path;
                }
                else if (data.type == "image")
                {
                    activityDetail.Type  = 0;
                    activityDetail.Image = data.path;
                }
                activityDetail.Description = data.description;
                activityDetails.Add(activityDetail);
            }

            return(activityDetails);
        }
Exemplo n.º 2
0
        public List <SceneConfig> GetShowConfigs()
        {
            List <SceneConfig> sceneConfigs = new List <SceneConfig>();

            string showConfigStr = _manager.globalData.GetConfig().ShowConfig;

            SceneTypeEnum[] sceneTypes = new SceneTypeEnum[]
            {
                SceneTypeEnum.CurveStagger,
                SceneTypeEnum.FrontBackUnfold,
                SceneTypeEnum.LeftRightAdjust,
                SceneTypeEnum.MidDisperse,
                SceneTypeEnum.Stars,
                SceneTypeEnum.UpDownAdjustCutEffect,
            };

            DataTypeEnum[] dataTypes = new DataTypeEnum[] {
                DataTypeEnum.Enterprise,
                DataTypeEnum.Activity,
                DataTypeEnum.Product,
            };


            JsonData data = JsonMapper.ToObject(DaoUtil.ConvertShowConfigStr(showConfigStr));

            for (int i = 0; i < data.Count; i++)
            {
                //Debug.Log(data[i]["cuteffect_id"]);
                SceneConfig sceneConfig = new SceneConfig();
                sceneConfig.sceneType = sceneTypes[int.Parse(data[i]["cuteffect_id"].ToString()) - 1];
                sceneConfig.dataType  = dataTypes[int.Parse(data[i]["contcom_type"].ToString())];
                // 设置场景时间
                sceneConfig.durtime = GetSceneDurTime(sceneConfig.sceneType);
                //Debug.Log("sceneType:" + sceneConfig.sceneType + "---dataType:" + sceneConfig.dataType + "---durtime:" + sceneConfig.durtime);
                sceneConfigs.Add(sceneConfig);
            }

            return(sceneConfigs);
        }
Exemplo n.º 3
0
        public List <Video> GetVideosByEnvId(int envId)
        {
            List <Video> videos = new List <Video>();

            string sql = "select video from company where com_id=" + envId + " and status = 1";

            //Debug.Log("GetVideosByEnvId : " + sql);

            var row = _theDataSource.SelectOne(sql);

            if (row != null)
            {
                string material = row["video"].ToString();

                object mWMaterialsObj = DaoUtil.ConvertMaterialJson(material);
                if (mWMaterialsObj != null)
                {
                    List <MWMaterial> mWMaterials = (List <MWMaterial>)mWMaterialsObj;

                    for (int i = 0; i < mWMaterials.Count; i++)
                    {
                        MWMaterial data = mWMaterials[i];
                        //Debug.Log(data[i]["cuteffect_id"]);
                        Video video = new Video();
                        video.V_id = i;
                        if (data.type == "video")
                        {
                            video.Cover   = data.cover;
                            video.Address = data.path;
                        }
                        video.Description = data.description;
                        videos.Add(video);
                    }
                }
            }

            return(videos);
        }
Exemplo n.º 4
0
        public List <ProductDetail> GetProductDetails(int pro_id)
        {
            List <ProductDetail> productDetails = new List <ProductDetail>();

            string sql = "select * from product where prod_id=" + pro_id;
            var    row = _theDataSource.SelectOne(sql);

            if (row != null)
            {
                string material = row["material"].ToString();

                List <MWMaterial> mWMaterials = (List <MWMaterial>)DaoUtil.ConvertMaterialJson(material);

                for (int i = 0; i < mWMaterials.Count; i++)
                {
                    MWMaterial data = mWMaterials[i];
                    //Debug.Log(data[i]["cuteffect_id"]);
                    ProductDetail productDetail = new ProductDetail();

                    if (data.type == "video")
                    {
                        productDetail.Type     = 1;
                        productDetail.Image    = data.cover;
                        productDetail.VideoUrl = data.path;
                    }
                    else if (data.type == "image")
                    {
                        productDetail.Type  = 0;
                        productDetail.Image = data.path;
                    }
                    productDetail.Description = data.description;
                    productDetails.Add(productDetail);
                }
            }
            return(productDetails);
        }