Exemplo n.º 1
0
        private void runSchedule(User user, DicList <CoreError> errors)
        {
            try
            {
                parent.Safe.VerifyUser(user);
            }
            catch (CoreError e)
            {
                if (e.Type != Error.NotSignedLastContract)
                {
                    errors.Add(user.Email, e);
                }

                return;
            }

            try
            {
                runSchedule(
                    repos.Schedule.GetRunnable(user),
                    errors
                    );

                parent.BaseMove.FixSummaries(user);

                user.SetRobotCheckDay();
            }
            catch (CoreError e)
            {
                errors.Add(user.Email, e);
            }
        }
Exemplo n.º 2
0
 public void AddDic(RfDiction dic)
 {
     if (DicList == null)
     {
         DicList = new List <RfDiction>();
     }
     DicList.Add(dic);
 }
Exemplo n.º 3
0
        internal PlainText(String name, String path)
        {
            this.name         = name;
            SectionList       = new DicList <Section>();
            acceptedLanguages = new List <String>();

            Directory.GetFiles(path, "*.json")
            .ToList()
            .ForEach(addSection);
        }
Exemplo n.º 4
0
 private void handleScheduleErrors(DicList <CoreError> userErrors)
 {
     foreach (var(email, errors) in userErrors)
     {
         foreach (var error in errors)
         {
             error.TryLogHandled($"User: {email}");
         }
     }
 }
Exemplo n.º 5
0
        public void Refresh(bool refdic = true, bool refdtl = true)
        {
            if (refdic)
            {
                DicList.Clear();
                DicList.AddRange(PubMaster.Mod.DicSql.QueryDictionList());
            }

            if (refdtl)
            {
                DicDtlList.Clear();
                DicDtlList.AddRange(PubMaster.Mod.DicSql.QueryDictionDtlList());
            }
        }
Exemplo n.º 6
0
        internal Language(String name, IDictionary <String, String> sentences)
        {
            PhraseList = new DicList <Phrase>();

            Name = name.Replace("_", "-");

            foreach (var sentence in sentences)
            {
                var dicPhrase = new Phrase(
                    sentence.Key,
                    sentence.Value
                    );

                PhraseList.Add(dicPhrase);
            }
        }
Exemplo n.º 7
0
        internal Section(String name, JsonDictionary translations)
        {
            LanguageList = new DicList <Language>();

            Name = name;

            foreach (var language in translations)
            {
                var dicLanguage = new Language(
                    language.Key,
                    language.Value
                    );

                LanguageList.Add(dicLanguage);
            }
        }
Exemplo n.º 8
0
 private void runSchedule(IList <Schedule> scheduleList, DicList <CoreError> errors)
 {
     foreach (var schedule in scheduleList)
     {
         try
         {
             inTransaction(
                 "RunSchedule",
                 () => addNewMoves(schedule)
                 );
         }
         catch (CoreError e)
         {
             errors.Add(schedule.User.Email, e);
         }
     }
 }
Exemplo n.º 9
0
        public DicList <CoreError> RunSchedule()
        {
            var errors = new DicList <CoreError>();

            if (!parent.Current.IsRobot)
            {
                throw Error.Uninvited.Throw();
            }

            var users = repos.User
                        .NewQuery()
                        .Where(u => u.Control, c => c.Active)
                        .Where(u => u.Control, c => c.RobotCheck <= DateTime.UtcNow)
                        .Where(u => u.Control, c => !c.IsRobot)
                        .List;

            foreach (var user in users)
            {
                runSchedule(user, errors);
            }

            return(errors);
        }
Exemplo n.º 10
0
 public Diction GetDiction(int dicid)
 {
     return(DicList.Find(c => c.id == dicid));
 }
Exemplo n.º 11
0
 public List <Diction> GetDicList(DictionTypeE type)
 {
     return(DicList.FindAll(c => c.Type == type));
 }
Exemplo n.º 12
0
 public string GetDicName(int diction_id)
 {
     return(DicList.Find(c => c.id == diction_id)?.name ?? "");
 }