Esempio n. 1
0
 public Permission(int id, FormName formName, ActionName actionName, Group group)
 {
     ID = id;
     FormName = formName;
     ActionName = actionName;
     Group = group;
 }
Esempio n. 2
0
 public UserInfo(int id, String nick, String password, Group group)
 {
     ID = id;
     Nick = nick;
     Password = password;
     Group = group;
 }
Esempio n. 3
0
        public void Add(String Nick, String Password, Group Group)
        {
            if (Password != "")
                Password = Authorization.HashCode(Password);
            String queryString = String.Format("INSERT INTO `{0}` VALUES(default,'{1}','{2}',{3});", _table, Nick.Replace("'", "''"), Password, Group.ID);

            _SQL.RunQuery(queryString);
        }
Esempio n. 4
0
 public void Change(int id, String Nick, String Password, Group Group)
 {
     String PasswordTerm = "";
     if (Password != "")
     {
         Password = Authorization.HashCode(Password);
         PasswordTerm = String.Format(", `PASSWORD`='{0}'", Password);
     }
     String queryString = String.Format("UPDATE `{0}` SET `NICK`='{1}'{2}, `ID_GROUP`={3} WHERE `ID`={4}", _table, Nick.Replace("'", "''"), PasswordTerm, Group.ID, id);
     //MessageBox.Show(queryString);
     _SQL.RunQuery(queryString);
 }
Esempio n. 5
0
        public List<Permission> GetGroupPermissions(Group group)
        {
            String queryString = String.Format("SELECT * FROM `{0}` WHERE ID_GROUP={1}", _table, group.ID);
            String netString = _SQL.RunQuery(queryString);
            String[] lines = netString.Split('\n');

            List<Permission> rv = new List<Permission>();
            for (int i = 0; i < lines.Length; i++)
            {
                if (lines[i] == "") continue;

                rv.Add(parseLine(lines[i]));
            }
            return rv;
        }
Esempio n. 6
0
 public void Change(int id, FormName formName, ActionName actionName, Group group)
 {
     String queryString = String.Format("UPDATE `{0}` SET ID_FORM={1}, ID_ACTION={2}, ID_GROUP={3} WHERE ID={4}", _table, formName.ID, actionName.ID, group.ID, id);
     _SQL.RunQuery(queryString);
 }
Esempio n. 7
0
 public void Add(FormName formName, ActionName actionName, Group group)
 {
     String queryString = String.Format("INSERT INTO `{0}` VALUES(default,{1},{2},{3});", _table, formName.ID, actionName.ID, group.ID);
     _SQL.RunQuery(queryString);
 }
Esempio n. 8
0
 public void Change(Group item)
 {
     Change(item.ID, item.Name);
 }