Beispiel #1
0
        private static tg_war_copy_count InsertCopyCount(int sceneId, Int64 userid)
        {
            var chuzhencishu = Variable.BASE_RULE.FirstOrDefault(m => m.id == "32074");

            if (chuzhencishu == null)
            {
                return(null);
            }
            var temp = new tg_war_copy_count
            {
                scene_id = sceneId,
                count    = Convert.ToInt32(chuzhencishu.value),
                time     = DateTime.Now.Ticks,
                user_id  = userid,
            };

            temp.Insert();
            return(temp);
        }
Beispiel #2
0
        private static bool CheckCopyCount(tg_war_copy_count temp)
        {
            var time = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd ") + " 00:00:00").Ticks;

            if (temp.time > time)
            {
                return(temp.count > 0);
            }
            var chuzhencishu = Variable.BASE_RULE.FirstOrDefault(m => m.id == "32074");

            if (chuzhencishu == null)
            {
                return(false);
            }
            temp.count = Convert.ToInt32(chuzhencishu.value);
            temp.time  = DateTime.Now.Ticks;
            temp.Update();
            return(true);
        }