예제 #1
0
        public void AppendReward(string uid, int point, string reason, string reasonid)
        {
            if (_rewardStr.IndexOf(uid + ":") >= 0)
            {
                return;
            }

            DateTime tm_now         = DateTime.Now;
            TimeSpan createtimespan = new TimeSpan(tm_create.Ticks);
            TimeSpan nowtimespan    = new TimeSpan(tm_now.Ticks);
            TimeSpan timespan       = nowtimespan.Subtract(createtimespan).Duration();
            int      timeDiff       = timespan.Minutes * 60 + timespan.Seconds;

            int nId = Util.toInt(uid);

            if (nId < 100)
            {
                nId = Global.getUidBySeat(nId);
            }
            if (nId > 0)
            {
                string pair = nId + ":" + timeDiff + ":" + point + ":" + reason + ":" + reasonid;
                if (_rewardStr.Length > 0)
                {
                    _rewardStr += ",";
                }
                _rewardStr += pair;
            }
        }
예제 #2
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("");
        }
예제 #3
0
        public string getResult()
        {
            string    result = "";
            ArrayList akeys  = new ArrayList(m_hashtable.Keys);

            akeys.Sort();
            foreach (int skey in akeys)
            {
                int uid = skey;
                if (skey < 100)
                {
                    uid = Global.getUidBySeat(skey);
                }
                string pair = uid + ":" + m_hashtable[skey];
                result += (result.Length > 0 ? "," : "") + pair;
            }

            string   dir      = Application.StartupPath + "\\" + DateTime.Now.ToString("yyyyMMdd") + "\\";
            string   filename = _xitiId + ".txt";
            FileOper fo       = new FileOper(dir, filename);

            fo.WriteFile(result);
            return(result);
        }