Ejemplo n.º 1
0
        public string UpdateImages()
        {
            DateTime tmnow   = DateTime.Now;
            string   result  = "";
            int      nsec    = Util.getTimeDiff_Second(tm_create);
            int      nUpload = 0;

            for (int i = 0; i < RECORD.Length; i++)
            {
                RobotPenImages img = RECORD[i];
                if (img != null)
                {
                    int    seat  = i + 1;
                    int    uid   = Global.getUidBySeat(seat);
                    string names = "";
                    foreach (RobotPenImageGroup group in img.grouplist)
                    {
                        if (group.status == 0)
                        {
                            //TODO: upload
                            foreach (RobotPenImageItem item in group.imglist)
                            {
                                names += (names.Length > 0 ? "|" : "") + item.imgName;
                                string imgPath = m_ImgDir + "\\" + item.imgName;
                                Common.uploadPicture(imgPath);
                                group.status = 1;
                                nUpload++;
                            }
                        }
                    }
                    if (names.Length > 0)
                    {
                        string result_item = uid + ":" + names;
                        result += (result.Length > 0 ? ";" : "") + result_item;
                    }
                }
            }

            if (nUpload > 0)
            {
                Common.uploadRobortPenEvent(rid, createtime, result, nsec);//同步到本地服务和云服务器
            }
            return("");
        }