Exemple #1
0
        public static String SaveIgnoreGroups(List <String> SubjectID, List <String> Class, List <String> Check, Boolean IsFinal = false)
        {
            string paramInfo = "";
            Dictionary <String, Group> IgnoreGroups = Clone.Dictionary <String, Group>((Dictionary <String, Group>)(CurrentSession.Get("IgnoreGroups") ?? InputHelper.Groups));

            for (int i = 0; i < SubjectID.Count; i++)
            {
                String aKey = SubjectID[i] + "_" + Class[i];
                if (IgnoreGroups.ContainsKey(aKey))
                {
                    IgnoreGroups[aKey].IsIgnored = (Check[i] == "checked"); // Check[i] != "undefined"
                }
                paramInfo += "MH:" + SubjectID[i] + " Class: " + Class[i] + " Check: " + Check[i] + "<br />";
            }
            if (IsFinal)
            {
                InputHelper.Groups = Clone.Dictionary <String, Group>(IgnoreGroups);
                OutputHelper.SaveOBJ("Groups", InputHelper.Groups);
            }
            else
            {
                CurrentSession.Set("IgnoreGroups", Clone.Dictionary <String, Group>(IgnoreGroups));
            }
            return(paramInfo);
        }
Exemple #2
0
        public static String SaveGroups(List <String> SubjectID, List <String> Class, List <int> Group, Boolean IsFinal = false)
        {
            string paramInfo = "";
            Dictionary <String, Group> Groups = Clone.Dictionary <String, Group>((Dictionary <String, Group>)(CurrentSession.Get("Groups") ?? InputHelper.Groups));

            for (int i = 0; i < SubjectID.Count; i++)
            {
                String aKey = SubjectID[i] + "_" + Class[i];
                if (Groups.ContainsKey(aKey)) // bo cung dc
                {
                    Groups[aKey].GroupID = Group[i];
                }

                paramInfo += "MH:" + SubjectID[i] + " Class: " + Class[i] + " Group: " + Group[i] + "<br />";
            }
            if (IsFinal)
            {
                InputHelper.Groups = Clone.Dictionary <String, Group>(Groups);
                OutputHelper.SaveOBJ("Groups", InputHelper.Groups);
            }
            else
            {
                CurrentSession.Set("Groups", Clone.Dictionary <String, Group>(Groups));
            }
            return(paramInfo);
        }